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
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.

18 thoughts on “SCUMM Script”

  1. 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!

    Reply
  2. 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.

    Reply
  3. 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?

    Reply
  4. 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.)

    Reply
  5. Wow, that’s a cool peek behind the curtain of SCUMM! It’s amazing how much creativity and ingenuity went into those old LucasArts games. Makes you appreciate them even more!

    Reply
  6. Wow, this is a fascinating look into the history of SCUMM! It’s amazing to see how the language evolved and the constraints they were working with back then. Makes you appreciate those old games even more!

    Reply
  7. UIDAI has made the Aadhaar services really easy to access online. The entire process — from updating details to downloading the Aadhaar card — is smooth and convenient. It’s a great step towards digital empowerment for citizens.

    Reply
  8. I recently used the Bihar Bhumi portal to check my land records, and I must say the process was very simple. I got all the details of my Khasra and Khatauni within minutes without visiting any office.

    Reply
  9. UP Bhulekh is a big step towards digital transparency in land records. It not only saves time but also minimizes the chances of errors and fraud. By putting land details online, the government has made the system more open and accountable.

    Reply
  10. Sometimes the portal gets a bit slow during the last few days of return filing, but overall it’s very user-friendly and informative.

    Reply
  11. Wow, this is a cool dive into the history of SCUMM! Kinda crazy how limited it was at first, but hey, it worked! Makes you appreciate how far coding has come. Speaking of coding, have you guys checked out deepseekmathv2? I hear it’s the future! Unlock the power of DeepSeek’s latest DeepSeekMathV2 model specifically designed for advanced mathematical reasoning, logic puzzles, and coding algorithms. Our platform provides a free, instant Q&A service with no configuration needed. Visit https://deepseekmathv2.win/ today to experience the next generation of AI reasoning.

    Reply

Leave a Reply to webland Cancel reply