Tuesday, 24 November 2015

Jumping the gun

Further analysis of the code reveals a very different story to that I painted last post. I am, in fact, quite a way off from being able to render a screen accurately. Indeed, the amount of code I need to reverse-engineer before being able to render came as quite a shock! I assumed that most of the remaining code was to handle special objects and AI; however every object to be rendered calls into a jump table that calls common routines at least 2 layers deep, and all are rife with magic numbers.

I'm sure though, that I only have to understand a handful of them before the rest of them simply fall into place. And that is what I attempted to do tonight, with moderate success. Still, I've only just scratched the surface.

The up side is that once I can render a screen, there's not much of the game left to reverse-engineer. Underneath the impressive graphics, the game mechanic is deceptively simple; something later games in the series built upon with an enhanced engine.

One other thing I now understand; there is a utility available that supposedly lets you dissect the game's graphics and data structures, allowing you to study sprites, objects, room contents, and the entire map - the ultimate idea being that you could update or create your own game within the confines of the existing data structures. The only thing is, the menu option to render the room doesn't actually do anything!

Well that's because you have to reverse-engineer pretty much the entire game to actually render a single room and notably, the game disassembly available on the same site covers around 5-10% of the game code. No doubt I'm not the first one to be taken by surprise!

However, I do hope to go one better than the author of the above-mentioned utility!

UPDATE: The author of said utility has responded to my email claiming it was mere laziness that prevented him from finishing his utility! I suspect the truth of the matter - evidenced by the (lack of) information available on the site - is that he either had no idea what lay ahead, or more likely was put off by the effort required (most of the original reverse-engineering effort was done by someone else).

No comments:

Post a Comment