So I spent a little while working only on the building data structures, and in the end knocked up a simple map editor for testing basic room and building layouts.
After playing around with some really simple wall layouts for a few days, it dawned on me that I could make a fairly major progress leap by importing some map data from somewhere else (for testing purposes of course - not as the actual game levels!). All of the test offices that I’d built in my simple editor were extremely basic, because I’m not going to waste time building complex maps when the format is changing all the time. But there are hundreds of games out there with similar map data structures, and thousands of levels that have been made before, sometimes in incredible detail. So I had a little think and came up with the obvious answer – Doom maps.
Doom maps come in WAD files, and they’re a pleasure to work with. After printing the unofficial doom map specs I wrote the tool you see above to import any level from episode 1 of Doom, and it took no more than three hours from start to finish. Despite being essentially two dimensional, some of the maps in Doom really are quite intricate, and obviously way more interesting to look at (and work with) than the test square rooms I’d been using previously. There’s also something really exciting about hacking through someone else’s data file and importing their data – generally you have a mess of nonsense on screen for a while, then you make some crucial fix – some intuitive leap about the data’s inner workings, and suddenly you’re looking at an incredible 3d model that some level designer has spent hours working on.
With my doom map importer finished and working, I then made the final connection by re-exporting the doom map in my own map file format, and then loaded that result up in Subversion’s simple map editor. Doom maps don’t really work in the same was as Subversion maps (our maps don't support arbitrary floor and ceiling heights yet), but if you look closely (and you know Doom reasonably well) you should be able to recognise the map from the game.
Part of the problem I have now is that the frame rate is extremely low with this many walls – I’m rendering every wall semi-transparently, which is a double whammy in terms of performance because it means every wall has to be depth sorted and then rendered in back to front order every frame, and it means I can’t use display lists to optimise things because the rendering order changes depending on the camera position. This problem only became apparent after loading the fairly complex doom maps into the editor, but I was aware it would bite us eventually. John Carmack faced a very similar problem over a decade ago, and his solution was to invent an entirely new way of rendering based around Binary Space Partition trees (bsp trees) – an incredibly intuitive leap that is still in common use in todays modern games.









