kb1
Junior Member
Posts: 229
Registered: 11-06 |
I dabbled with this exact issue in my home port. I added a modification of the Legacy 3D floor stuff into the port. It works pretty good, and is certainly impressive (good job SoM!), but I've always wondered how to correct some of the rendering problems (like sprites occasionally being clipped incorrectly.) One day, I'll take the time to understand exactly what's happening, and see if I can correct some of the issues. (Has anyone made any progress in this area?)
Anyway, I decided to try them out in a new map, and immediately realized that, as stated above, it was not possible to add things on top of the 3D floor, in a Doom format map, which lacks the Z-coordinate in it's thing definition.
So, I came up with this hack, which is ugly, but works pretty well. Basically, I "overload" the angle field with the Z-coordinate. The angle field is 16-bits wide, but only 3 are needed to set a thing's angle to 1 of 8 possible angles.
My port looks for a map definition lump (some ports use MAPINFO, MAPDATA, MAPSETUP, etc). If I find my map definition lump, I parse it, and look for a flag "Z_IN_ANGLE_FIELD". If set to True, my map load code expects the angle field to contain both the thing's angle, and the thing's Z-coordinate divided by 8.
In other words, the lower 3 bits of the angle field specify the angle, and the upper 13 bits get multiplied by 8, and used as a Z-coordinate.
This hack, of course requires map editor support to be useful. However, as more ports support 3D floors, maybe this method can become standard. Of course, moving to Hexen format is the cleanest approach.
|