Amiga 4ever

Mattias Ljungström Nov 7 2016

We're currently in the final hectic stages of our game project Future Unfolding. I wanted a distraction one Sunday afternoon and decided to port a model I created in '92 on my Amiga 500.

The 3D model was part of an unfinished demo I was working on back then. It was created by redrawing a buckminster ball (aka C60) on graph paper and then reading out the coordinates by hand. It has 60 vertices and 32 sides. The Amiga has a blitter that can draw multi-side polygons so the model wasn't triangulated.

3D model screenshot Flat shaded model running on Amiga

Last year as I was home for Christmas my brother and me took out the Amiga from my parents attic. About half of the disks were still working after 20 years of storage. I copyied some of my old source code for fun and archiving at that time.

Amiga disks can't be read in a PC disk drive. Instead, to transfer the data you open a serial port (with a null modem cable to a Windows computer) to download a tool called Amiga Explorer on your Amiga. This software can then be used to copy disks over to your PC.

Image of asm src code on Amiga emulator Parts of the demo source code

It took a while for me to get around to finally port the model over to a format our custom game engine could read. I started by doing some quick text edits in TextMate column mode, and then some search/replace to setup the data as two C++ arrays.

The Amiga model uses multi-side polygons, to be precise 5 or 6 sided. The loading code triangulates these as they are read from the array data. The setup code also calculates normals per polygon and then assigns these to all the triangles for that polygon. This is because my hand modeled polygons are not perfectly flat, and the triangles would otherwise have different normals. This would result in visible edges after lighting.

Apparently I hadn't setup the polygon winding correctly back then, so I added a check to see which side was outwards and flipped the incorrect sides.

Screenshot from Future Unfolding Asset used in-game as part of a sphere effect

The final model is used in the game to create a special sphere effect used in a small part of the game. It doesn't look like it did in '92, but I'm happy this asset is finally going to make it into a released product.

Do you have a question or comment? Get in touch on Twitter.