Another World Game in Lua/Love2D ๐ŸŒ

Explore the classic Another World by Eric Chahi, a 1991 legendary game, recreated using Lua and Love2D. No prior introduction needed!

Another World Game in Lua/Love2D ๐ŸŒ
GC_AlbanR
239 views โ€ข May 26, 2025
Another World Game in Lua/Love2D ๐ŸŒ

About this video

Do I need to introduce the legendary Another World by Eric Chahi ?

This incredible game released in 1991 on ST and Amiga computers which took two years for Eric to make ... all by himself !

I played it on the Atari ST version back in the days and, although today I can compare it with the (as usual ?) superior Amiga version, this was an exceptional game on the ST which owns its legendary status on all platforms.

Recently, I've read Fabien Sanglard's articles in which he does a technical analysis of the game and its ports.
If you don't know his site, I highly recommend it, it's a real treasure !
Fabien Sanglard is a french expatriate who settled in the United States where he works as a software engineer in the Silicon Valley.
https://fabiensanglard.net/

Not only Another World was a gaming revolution but I realized how Eric Chahi had designed a very smart architecture by implementing a virtual machine executing bytecode and this was way before Java !
He explains on the Another World official website (https://www.anotherworld.fr/) and in various interviews that his goal was to iterate as fast possible, as he was designing the game while he was programming it.
In order to do that, he wrote all the necessary tools like his script and polygons editors.

In his article (https://fabiensanglard.net/another_world_polygons/index.html), Fabien Sanglard wrote: "There is very little code in Another World. The original Amiga version was reportedly 6,000 lines of assembly[2]. The PC DOS executable is only 20 KiB. Surprising for such a vast game which shipped on a single 1.44 MiB floppy. That is because most of the business logic is implemented via bytecode. The Another World executable is in fact a virtual machine host which reads and executes uint8_t opcodes."
...
"Another World VM defines 256 variables, 64 threads, 29 opcodes, and four framebuffers[3]. That's it. If you build a VM host capable of handling these, you can run the game. If you are able to make the VM fast enough to run at 20 frames per seconds, you can actually play the game."

This is when I thought: what if I'd go and implement the Another World vm in Lua using the Love 2D framework !?
I can use canvases to implement the framebuffers and Love has polygons, sounds and much more built-in. It should be doable, right ?


The source code of Another World was never published nor the exact specifications for its virtual machine implementation.
However, a guy named Grรฉgory Montoir had reverse-engineered the vm code and he had written his own implementation in C language.
Fabien Sanglard forked Gregory's code and made it easier to read.
https://github.com/fabiensanglard/Another-World-Bytecode-Interpreter

But there's more! Gregory Montoir also wrote a Javascript HTML 5 version to be played in a browser!
https://cyxx.github.io/another_js/
The code is also available on Github: https://github.com/cyxx/another_js

So this is the version I started with as it was much easier to port to Lua.

So here's my version of the Another World vm written in Lua/Love2D.

I didn't try to implement everything needed to play the full game because my goal was to only play the intro.
In the end, I think it wouldn't be too much work to have the game playable but I'm not sure if I want to do this and, for me, it was just a little side project (which actually took longer than I expected).

Compared to Gregory's Javascript version, I added sound effects end music because it was easy to implement with Love.
Ok, for the music I cheated a little; it's just an mp3 played at the right time (using the vm play_music instruction).

The code layout is very close to the Javascript version and most of the function names are identical.
However, there are a few things that were not that simple to implement.

There are a few rendering bugs here and there and the character font is not the true Another World font. Instead I used an Atari ST system font I've found on the Internet.

The project is only 1183 lines of code, including comments which is not a lot.
In the video, the code runs in debug mode in order to print the instructions the vm is decoding in real time. Ultimately, this must have a negative impact on performance but it's barely noticeable.

I had fun making this and the most important thing for me was to dive into this masterpiece again.

Thank you Eric Chahi.

Video Information

Views

239

Likes

8

Duration

2:51

Published

May 26, 2025

Related Trending Topics

LIVE TRENDS

Related trending topics. Click any trend to explore more videos.