Hacker News new | ask | show | jobs
by t0mek 1807 days ago
"Another World", the game, is an interesting example of this approach. It's implemented in a mini-VM, with 29 opcodes - apart from the low-level "mov", "call", "ret", etc. there are high-level ones too, like "fill fb" or "draw txt". The VM design was closely related to the art style of the game, based on polygons, not bitmaps.

With this approach it was fairly easy to port the game to various platforms. "Only" the VM implementation had to be ported, while the bytecode remains the same. Of course, the VM implementation had to be tied to the graphics and sound subsystems of the target platform.

There's a super-interesting series of blog posts, starting with [1], describing the "Another World" internals and also the design of all the platforms to which it was ported: Amiga, Atari ST, PC, Genesis, SNES and GBA.

[1] https://fabiensanglard.net/another_world_polygons/index.html

3 comments

You might be interested to know that Another World was not Eric Chahi's first game to implement a VM. Infernal Runner (Amstrad CPC, 1985) was recently reverse-engineered to be playable in the browser. Some details and source: https://github.com/cyxx/infernal_js
I've never played it, but apparently it's being ported to the Zx Spectrum Next and the C64, which are supposedly herculean efforts due to the limitations on those machines
Another famous example: adventure games using z-machine (Infocom), and later SCUMM.