Search This Blog

Sunday, October 3, 2010

Where is All the Data?

In my previous post I showed how the level editor can load vertices and edges from the original Doom wadfiles. I´ve since completed the holy trinity of Doom map data by loading sectors!

Sectors have proven to be the single most difficult thing in this game so far. I´ve already discussed my troubles dividing them into triangles, and that remains a problem area. To get the Doom levels working properly I had to expand my algorithm to account for sectors inside of other sectors, which included creating fake extra lines to connect them and treat them as a single polygon.

I´ll probably do a separate blog post to describe the whole process of creating triangles out of sectors after (if?) I fix some last niggling issues. I also read an article by Carmack about how he did it for the iPhone port of Doom, and he just used a 3rd party library. What a hack!*

Small issues aside, the level loading already works pretty well:
Top left: Gloom, Bottom right: Doom
What brightened my day when I tried this is that my assumptions turned out to be correct: the whole level renders super smooth, without any optimizations at all! I just brute force draw every wall and floor, regardless of whether it´s actually visible or not, and the game runs without a hitch.

After all that I had to go all the way, so I spent some time fixing the lighting in my engine, found a set of original Doom textures online (they´re also in the wad file but stored in a weird way) and added those, as well as lighting information, to the level loader.

I think the result is quite nice:
MAP01: ENTRYWAY
It still needs a little bit of tweaking (the lighting is a bit flat, the textures aren´t offset correctly and there´s still some sector problems).

At this point, though, I think it would be a lot more interesting to get some collision and physics in there so we can actually walk around in this thing!

*Carmack is not a hack

No comments:

Post a Comment