SCUMM internals and syntax for the sake of nostalgia
Tags: gamedev, programming
Published: 2018-04-18 23:56:39

---
title: SCUMM internals and syntax for the sake of nostalgia
published: true
tags: gamedev, programming
canonical_url: https://monades.roperzh.com/scumm-internals-syntax/
---

I spent an unbelievable amount of time playing games from the LucasArts franchise circa 1999 in an [Intel 486](https://en.wikipedia.org/wiki/Intel_80486). It was already an old computer at the time, but it was more than enough to play games like Maniac Mansion and Monkey Island.

As I grew up and learned more about computers, I found that “SCUMM” wasn’t just the name of a bar in Monkey Island, it was the platform on which all my favorite childhood games were programmed on.

This post explores the SCUMM scripting language based on a list of sources, from talks to interviews and various posts.

## Brief History

SCUMM stands for “Script Creation Utility for Maniac Mansion”, and as the name implies, it was created as to serve as a toolset to develop Maniac Mansion.

The game had to work in a [Commodore 64](https://en.wikipedia.org/wiki/Commodore_64), so as it was done with other games at the time, the game was developed at first in Assembly, but in order to deal with the complexity of the game (it had seven different characters and a huge amount of combinations), Ron Gilbert decided to create a higher level syntax.

> I started kind of hand-coding it all in assembly language, […] and it was just obvious this was going to be a very difficult task without some kind of a language to be able to abstract the gameplay.
> 
> — _Ron Gilbert, [interview for IGN](http://www.ign.com/articles/2007/04/26/interview-scumm-of-the-earth)_

Once Maniac Mansion was finished, they realized that SCUMM could be used as a general purpose tool to create adventure games.

It’s worth noting that SCUMM wasn’t only a scripting language, it also included other utilities named after body fluids like SPIT (a font editor) and FLEM (a graphical interface.)

## Concepts and Syntax

The syntax of SCUMM scripts is really high level and strongly related to the characteristic graphics interface of the adventure games that were built with it:

![Screenshot of a scene of Maniac Mansion gameplay.](https://user-images.githubusercontent.com/4419992/38932439-8d028ea0-42ec-11e8-9512-b8736cafa401.jpg)<figcaption>
    <i>
      Screenshot of a scene of Maniac Mansion gameplay portraying a typical SCUMM interface: a character, objects to interact with and actions.
    </i>
  </figcaption>

If you haven’t played any of the old school LucasArts adventure games (and I really encourage you [to do it](https://en.wikipedia.org/wiki/Commodore_64)), they consist of a story/puzzle that you must solve: you are in control of a character, which is able to interact with objects via a set of predefined actions placed at the bottom of the screen.

The scripting language itself is a very well done abstraction: it has almost a 1:1 mapping regarding what you see in the screen to what you code, and is based upon simple concepts/keywords like:

- `room`: each screen that the user sees is a `room`, which is no more than a group of `object` definitions.
- `actor`: the characters in the game, actors can wear `costumes` and interact with `object`s.
- `object`: elements in the `room`, objects can have `verbs`, which are related to actions you can apply to them.
- `costumes`: definitions of a player costume.
- `sounds`: definitions of sounds.

Doing a more detailed summary of the syntax would be pointless, but if you are interested, the [SCUMM Tutorial](https://web.archive.org/web/20160721004826/http://www.wilmunder.com/Arics_World/Games_files/SCUMM%20Tutorial%200.1.pdf) is an in-depth resource. You can even write your own games using compilers like [SCUMMC](https://github.com/AlbanBedel/scummc) and [SCUMM-8](https://github.com/Liquidream/scumm-8).

To give you a taste of what a bit of code may look like, let’s try to code the scene in the image above (Dave in the doorstep)

```
room "doorstep" doorstep {
  sounds {
    "SFX/doorclos" door-close
    "SFX/dooropen" door-open
  }

  costumes {
    "costumes\dave" dave-skin
  }

  enter {
    ; Code to set up the room lives here,
    ; you can trigger sounds, animations, etc.
  }

  exit {
    ; Things to do when exiting the room,
    ; cleaning states, stopping sounds, etc
  }

  object Key {
    name is "key"

    verb look-at {
      say-line "it is a key"
    }

    verb pick-up {
      pick-up-object key
    }
  }
}
```

## Multitasking

> Probably the most distinctive part of SCUMM was that it was multi-tasking. This meant that multiple scripts could effectively run simultaneously. You might create a clock on the wall in Zak McKracken’s office and have it animate. There would be a single, very simple script just for the clock that would tell the animation engine to change from one image of the clock to the next, tell the sound engine to play the “tick” sound, and then tell the script to “sleep-for 1 second” and then repeat.
> 
> — _Aric Wilmunder, [Gamasutra interview](https://www.gamasutra.com/view/feature/196009/the_scumm_diary_stories_behind_.php?print=1)_

Another of the outstanding points of SCUMM is how easy it made for the developer to add cooperative multitasking into the system. You could trigger a task with the `do` keyword and the task will keep running _once per frame_ until it hits a `break-here`, then it runs the next task.

For example, in the next image, we can think that every ghost pirate and the shadow moving in the background is a separate script running on its own:

![5ad7c8f06a421525259541](https://user-images.githubusercontent.com/4419992/38961725-39f60436-4340-11e8-856f-0c0f0f0e91bc.gif)

Here’s a script transcripted from [Gilbert’s talk](https://www.youtube.com/watch?v=wNpjGvJwyL8) which details how you would make a clock tick:

```
script clock-tick {
  do {
    clock-state = not clock-state
    object living-room-clock state clock-state
    play-sound clock-tick
    break-here 60
  }
}
```

## Other interesting bits

To wrap up, here are some bits that may be interesting:

- The SCUMM compiler was written in Yacc and Lex.
- SCUMM requires carriage returns at the end of lines but how things are tabbed does not matter. It is not possible to put open brace, an instruction and a closing brace on the same line.
- The SCUMM system has global and local variables. A global variable can be used throughout the game. A local variable is specific to a script.

## Resources

- [SCUMM tutorial](https://web.archive.org/web/20160721004826/http://www.wilmunder.com/Arics_World/Games_files/SCUMM%20Tutorial%200.1.pdf)
- [Interview: SCUMM of the Earth](http://www.ign.com/articles/2007/04/26/interview-scumm-of-the-earth)
- [Scripting Test](https://blog.thimbleweedpark.com/scripting_test)
- [A New Force in Games, Part 3: SCUMM](https://www.filfre.net/2015/07/a-new-force-in-games-part-3-scumm/)
- [The SCUMM Diary](https://www.gamasutra.com/view/feature/196009/the_scumm_diary_stories_behind_.php?print=1)
- [David Fox Talk](https://youtu.be/1SLVyjUCOIo)
- [Ron Gilbert comment on SCUMM](https://www.pagetable.com/?p=614)
- [Ron Gilbert - Maniac Mansion postmortem talk](https://www.youtube.com/watch?v=wNpjGvJwyL8)