21/12/2005 @23:27:36 ^01:59:30
HAPPY BIRTHDAY
The Overdetailed Map Cheat is 5 years old!!
Doom has always had a map. It is well known that the game is not properly three-dimensional, that inside the map there is one and only one sector at any given point. You can embed it into the plane in a well-defined way, and thus get a map of it from above. I'm sure that mathematically there is a precise way to express this but you get the idea.
Doom has always had cheat codes. In particular if you go to the map and type "iddt" it firstly shows you all the lines, even ones you haven't seen yet, or wouldn't be able to see normally. Then if you type it again it shows you where all the things are, in the form of small green triangles. A third time returns it to normal.
You can make some inferences of thing types from this display. A good working knowledge of the radius and speed of the monster types can let you identify some of them if they're awake. For example archviles move very quickly usually in long straight lines. Lost souls move very slowly and tend to clump together. Spiderdemons are very large, so if there's a triangle always with a lot of space around it, it might be one of those. And so on. Also, you can use context. If something looks like it is on a pedestal in a prominent location in a room, chances are it's a key or a weapon or something.
In Boom's map cheat, things stayed much the same as in Doom's, except that keys show up as coloured crosses. MBF, which implements friendly monsters, shows them in a different colour. Prboom, descendent of Boom and MBF, shows things that count towards your items percentage in different colour. That was useful because I hate missing items but not amazing.
However this isn't where the overdetailed map cheat came from. We have to go back to well before I was using Prboom, even before I had a Linux machine.
At the end of 1999, the RISC OS engine "Doom It Yourself" released a new version which incorporated Boom game logic. Prior to that it had just been a port of Doom to RISC OS and POSIX systems, and with RISC OS optimisations. Not all of Boom's code was included, there was none of the new menus, HUD etc; just enough that DIY could play maps that required either Boom map features or removal of common engine limits. It also enhanced the map cheat, but didn't just use what Boom had done, but took it further.
(In fact I thought DIY's map cheat was actually Boom's map cheat, and was quite surprised to find Prboom didn't have all DIY's extra shapes and stuff. But I digress.)
DIY's new map cheat classified things into one of a number of categories; monsters, ammo, health, keys, powerups, lamps, corpses, obstacles, etc. As you can imagine, this was enormously helpful and a huge step up from what I was used to. But it didn't go far enough. You couldn't tell the difference between a dropped shotgun and a BFG, or between an imp and an archvile (if it was still asleep), or between a stimpack and a health potion, for those 100% items. There was a classification, but it was too broad. The thing to do was now obvious - extend it.
Of course it was about a year before I actually did anything, but eventually I set about making a finer classification which I called the Overdetailed Map Cheat. I reused the extra hexagon, pentacle and key shapes DIY had added, and made a whole load more; I added a lot of extra colours, and tied them all up together in some lookup tables. It was good. Weapon shapes looked like the guns themselves. Items were easily visible. The monsters were all different sizes of triangle; the spiderdemon's is so comically large it still makes me laugh to this day. You could almost play the entire game on the map.
But this was all years ago in DIY. When I switched to Prboom, I lost it all.
I resisted switching engines and platforms for a long time. I knew I'd lose all the stuff I'd put in to DIY, but in the end Prboom won over by the fact that it ran on a computer that could play modern detailed maps without the frame rate falling through the floor, and with the convenience of fast access to the entire internet's library of WADs without having to muck about with copying files by floppy disc. I always thought it wasn't so bad because I could still hack on the engine source, but that took even longer. Software development in Linux annoyed the hell out of me since no Unix text editors seemed to hold a candle to RISC OS's Zap. It took three years to find Vim and use it enough until it stopped annoying me. There's still tons of stuff I miss about RISC OS's GUI but it's been so long I've learned to live without them. X sucks except as a way to have half a dozen terminals all visible at once.
In fact I might never have hacked on the game engine again had it not been for Prboom 2.2.6's live monsters counter. 226 has a lot of useful bug fixes over 224 but also had this thing that was always wrong and it annoyed me so much I had to fix it. That started me off hacking at it again. It wasn't like I hadn't been reading Prboom's source in the interim and becoming familiar with its differences from DIY.
So the next thing I did was fish out the old DIY map cheat code and put it into Prboom. Aided by the fact that the compiler on both platforms was GCC it turned out to be surprisingly easy, and made me wonder why I hadn't done it earlier. Anyway I mean it's mostly data, shapes and colours and lookup tables and that. There's very little executable code. In fact I severely reduced the amount of code because I decided doing an inefficient linear search on three different lookup tables was stupid compared to having one big array indexed by thing number (the only reason I'd done it like that was because, elsewhere in the source, collectable things are distinguished by sprite number, not thing number like everything else)
There was more work to do though as Prboom does have all Boom's extra user interface and in particular you can reconfigure the map colours inside the game. It took a bit longer to add this in as I was having to write new code but it worked, and there was an extra page of colours in Options->Setup->Automap.
And there we might have left it. But I thought, why am I adding new features to the stable branch? Shouldn't I be editing the development version (2.3.x)? I had tried 23x (or 240 if you get it from upstream SVN) and found it to run quite acceptably well, and indeed have a lot of useful enhancements that I felt I could do with. There's a console, a decent key binding system, the sound code is better, blah blah blah. After about a week I imported the development version into my repository and then added the map cheat to it. It was quite a bit different, mainly because of the new console variable and menu system (the actual map code remains largely the same)
So there you go. There are still some issues that will always remain. For instance it's completely oblivious to dehacked patches. For example Scythe 2 replaces Commander Keen with another monster but on the map cheat it still looks like Commander Keen. Then there's other stuff that's a matter of style - I like the default colours but someone else might hate them or strongly disagree with my choice of shapes or whatever. The sizes of triangle for each monster are chosen by radius only and don't take height into account so demons are larger than barons which somehow seems the wrong way round. And I can't decide if barrels should only show up in clutter mode or not. They can be relevant to gameplay. But so can monster corpses, if there's an archvile around. But those don't appear in important mode. I don't know.
Furthermore, the development version is, well, just that. Unstable. Although it has enough new useful stuff in it that I want to keep working on it, it's so full of bugs and global variables that interact in bizarre ways and patched up code edited by seventeen different people that doing anything can be quite frustrating. However that's a topic for another day...
Hells bells, that was a load of self-indulgent rubbish.