Another World Source Code Review
Dedicated to the nerds grown in the 90s
Recently i have read an interesting article by Fabien Sanglard about a milestone of videogames: “Another World”.
I spent two weeks reading and reverse engineering further the source code of Another World(“Out Of This World” in North America). I based my work on Gregory Montoir’s “binary to C++” initial reverse engineering from the DOS executable.
I was amazed to discover an elegant system based on a virtual machine interpreting bytecode in realtime and generating fullscreen vectorial cinematic in order to produce one of the best game of all time.
All this shipping on a 1.44MB floppy disk and running within 600KB of RAM: Not bad for 1991 !
Sanglard has made a complete review of the sourcecode of the game, and has discovered some interesting facts.
This was possible partly because the binary was small (20KB). Why so small ?
Because ANOTHER.EXE was not the game itself but just a virtual machine:
– Hosting bytecode.
– Providing system calls.
The bytecode performs all the game logic with its own opcodes but uses syscalls for “heavy” stuff like drawing, playing music, sound and managing assets.
To implement only the virtual machine for the target OS reduced the effort and the game was broadly ported to more than a dozen platforms
Fabien has also created his own version of “Another World Virtual Machine”:
In the code on github you can see how every opcode have been implemented. All of them are pretty easy to understand except for the renditions ones.
The trick is that the polygon segment source where the vertices should be read is embedded with the opcode id.