SCUMM Script

Ron Gilbert posted this as a comment on The Mansion – Technical Aspects, I am re-posting it here as an article.

SCUMM script was a little odd. When I first started designing the language, I was going to base it on Lisp. I was use to using it to customize emacs that we used to do all our coding. This was not on PCs, but on large multiuser UNIX machines. The Lucasfilm games group was part of the Lucasfilm computer division (which later became Pixar) and we had some very smart people that connected the C64 to the UNIX machine. From my UNIX terminal, I had complete control over the C64 and wrote a source level debugger for SCUMM. The 6502 assembler was custom written by Chip Morningstar and ran on the UNIX machine.

But I digress. So, SCUMM started out as Lisp based, but I quickly abandon that approach in favor of something that looked a little more C-like, but some aspects of Lisp remained, mostly in the naming conventions. Commands and variables used – (dashes) as separators.

sandy-rescued = 1

This was a single variable, not sandy minus rescued. So how did SCUMM do subtraction? You didn’t. Until Monkey Island, there was no way to do complex expressions. if you wanted to subtract a value you used:

count -= 5

If you had a complex expression, you had to chain them using +=, -=, /= and *= using temp variables. Ugly, but it made the interpreter much simpler.

(Side note, the C64 interpreter was not named SPUTM, that name didn’t come about until the PC version).

One of the goals I had for the SCUMM system was that non-programers could use it. I wanted SCUMM scripts to look more like movies scripts, so the language got a little too wordy. This goal was never really reached, you always needed to be a programmer. :-(

Some examples:

actor sandy walk-to 67,8

This is the command that walked an actor to a spot.

actor sandy face-right
actor sandy do-animation reach
walk-actor razor to-object microwave-oven
start-script watch-edna
stop-script watch-edna
say-line dave "Don't be a tuna head."
say-line selected-kid "I don't want to use that right now."
if (melt-down) {
  say-line selected-kid "I don't think this game is very fun."

There were no functions, everything was a ‘script’, a small piece of code that looked a lot like a function, but it ran in it’s own virtual process.

script watch-clock {
  do {
    object clock state ON
    break-time 60
    object clock state OFF
    break-time 60

Note the lack of a until/while on the do loop. The script would just continue until someone killed it.

Time was always measured in jiffies (1/60 second). Later on I added the ability to say ‘break-time 1 minute’ and the compiler just multiplied by 60 before emitting the opcode.

If you did…

start-script watch-edna
start-script clock-tick

…you now had 2 additional scripts running and they all ran at the same time using preemptive multitasking. It was a heck of a lot better than doing state engines. If you wanted to keep an eye on something, you’d just say…

start-script watch-edna

…and then forget about it. That one script could do whatever it needed and start a cut-scene if the need arose.

This may seem pretty tame today, but back then, it was like magic.

Bonus information: The SCUMM compiler was written in Yacc and Lex.

pixelstats trackingpixel

21 Responses to “SCUMM Script”

  1. Ron Gilbert says:

    If I knew you were going to post it as an article, I would have proof read better.


  2. enthusi says:

    Ah, great that you shed some light on the mysteries of this giant among games ;-)
    I really appreciate your work, even more after having had those insights of the code during reversing.
    Thanks alot Ron!

  3. Mariano says:

    Thank you for these great articles! I always wondered how the SCUMM worked internally. I suppose it should be very difficult to create a system like this for an 8-bit machine.

  4. Thomas says:

    There are two questions I would like to ask Ron Gilbert about SCUMM. It is mentioned that the language was originally based on Lisp (including the S-expression syntax I presume). What exactly was the reason to change to a more C-like language? Infocom had ZIL which was Lisp based and it apparently worked pretty well for them. Were you aware of that at the time or was Emacs Lisp the only inspiration?

    The second question I have concerns the aim to provide a natural language like interface for non-programmers (mentioned in one of the talks that is available on Youtube). Inform 7 tries to do that and seems to be quite successful. What is your current view on using “natural language” to script (adventure) games?

  5. Joe Z says:

    I have a (hopefully) quick question for Ron Gilbert also regarding SCUMM:

    You mentioned that all of the scripts ran concurrently in a preemptively multitasked way. What exactly did you mean by that?

    Do you just step through all active scripts running the next “step” for each script? Or are you preempting based on more complex criteria such as when state variables change and/or timers expire? (Seems like the latter would be way more complicated than necessary.)

  6. playstation 3 mkv files…

    [...]SCUMM Script «[...]…

  7. I’m impressed, I have to admit. Rarely do I encounter a blog that’s
    both educative and engaging, and let me tell you, you’ve hit the nail on the head. The issue is an issue that too few men and women are speaking intelligently about. Now i’m very happy that I found this in my hunt for something regarding

  8. [...] ?Ricostruirei lo SCUMM. Non il linguaggio nello specifico, ma ci? che portava in quei giochi. (…) Monterei un motore e un linguaggio dove le idee divertenti possano essere oggetto di risate a pranzo e implementate gi?┬ánel pomeriggio. Lo SCUMM questo lo faceva, ed ? qualcosa che oggi sta venendo meno.? [...]

  9. There is definately a lot to know about this issue. I love all of the points you have made.

  10. Obviously high resolution videotape quality contains much memory, that?s why it gives you superior quality.

  11. Sweet blog! I found it while searching on Yahoo News.
    Do you have any suggestions on how to get listed in Yahoo News?
    I’ve been trying for a while but I never seem to get there! Thank you

    Feel free to surf to my webpage: financial help and advice

  12. fitness tips says:

    Great post! We are linking to this great article on our site.
    Keep up the good writing.

  13. Have you ever thought about creating an ebook or guest authoring on other websites?
    I have a blog centered on the same information you discuss and would really like to have you share some stories/information.
    I know my viewers would appreciate your work.
    If you are even remotely interested, feel free to shoot me
    an e-mail.

  14. This is the forthcoming Fallout four Beta Keys.
    With this Fallout 4 Generator you will be capable to make beta keys to use on your
    Xbox 360|Ps3 |or even Personal computer. Providing you opportunity to enter the planet of the new redesigned Fallout four : Forgotten Order
    in a beta phase. We are a large gaming local community with tons of
    keys on each and every platform. Our keys are coming from numerous developers this sort of
    as Obsidian Entertainment who by themselves need to have beta testers for this sport ahead
    of release day. Each beta keys coming from our Fallout four Beta Keys Generator
    will be produced from our databases and discover the unused legitimate keys and provide
    them to you in a solitary simply click. Every keys. As we can continuously get beta keys and feed
    our databases our apps are constantly up-to date.

  15. He? there! I’m at wor? surfing around your blog from m? new iphone 4!
    Just wanted to say I lov? reading your ?log and look forward
    to all your p?sts! Carry on the great work!

    Also visit my homepage; FCS Networker Discount

  16. Loadout Hack says:

    Greate pieces. Keep writing such kind of information on your site.

    Im really impressed by your site.
    Hello there, You’ve performed an excellent job. I’ll definitely digg
    it and for my part suggest to my friends. I’m confident they’ll be benefited from this site.

    my homepage :: Loadout Hack

  17. Erusou says:

    Great information. Lucky me I ran across your site by chance (stumbleupon).
    I have book marked it for later!

    Look into my web page … hacker software (Erusou)

  18. Nancy says:

    Thanks for a marvelous posting! I actually enjoyed reading it, you are a great author.I will
    always bookmark your blog and may come back someday. I want to
    encourage that you continue your great job, have a nice morning!

    My web page – time management (Nancy)

  19. Hello, yeah this paragraph is actually fastidious and
    I have learned lot of things from it regarding blogging.

  20. You really make iit seem really easy together with your presentation however I
    to find this matter to be really one thhing which I think I’d by no
    means understand. It sort of feels too complicated and extremely
    huge for me. I’m looking forward in your next put up, I will ttry too get the hang
    of it!

    Stop bby my web-site; Communicating change

Leave a Reply

To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word