Remix.run Logo
rob74 7 hours ago

This is taking a lot of inspiration from Doom, but the actual raycasting engine is more like Doom's predecessors, the most well-known of which is probably Wolfenstein 3D: perpendicular walls, constant floor and ceiling height. Wolf3D didn't have textured floors and ceilings because of performance reasons, but several other similar games had them. Doom and IIRC Duke Nukem as well used a BSP engine which was much more flexible (walls could intersect at any angle, variable floor and ceiling heights), although the levels were still "flat" (you couldn't have several "stories" inside a level, e.g. you couldn't design a bridge that you could walk over and under).

badsectoracula 6 hours ago | parent | next [-]

> Duke Nukem as well used a BSP engine

The Build engine didn't use BSP, it treated connections between sectors as portals and rasterized the walls as (90 degree rotated) trapezoids while performing clipping against those portals. This allowed it to have dynamic wall geometry (e.g. moving trains, rotating light fixtures, etc) as well as "room-over-room" setups as long as you couldn't see both rooms at the same time (in both Blood and Shadow Warrior they found a workaround for it allowing to create more "3D" spaces by making identically shaped sectors with the floor of one sector acting as a portal to the ceiling of the other sector - supposedly this wasn't "natively" supported by the engine, but it was flexible enough for the game studios who used it -without even having access to the source- to do it themselves).

The first level of Duke Nukem 3D does use a few Build tricks - e.g. another one is that sprites can be "axis aligned" instead of following the camera and they can also have collision - this can be used to create rudimentary 3D geometry by treating each sprite as an axis aligned quad and in the first level it is used to make a bridge between two buildings (right before the level exit button).

kridsdale1 2 hours ago | parent [-]

I always loved that the bridge you mentioned could take damage and fall down, screwing you over in the very first level, unless you knew where the Jetpack was stashed.

bluedino 6 hours ago | parent | prev | next [-]

> Wolf3D didn't have textured floors and ceilings because of performance reasons, but several other similar games had them

Blake Stone Rise of the Triad used later versions of the Wolf3D engine and had textured floors/ceilings

> Doom and IIRC Duke Nukem as well used a BSP engine which was much more flexible

Duke Nukem (Build engine) did not use BSP

https://www.jonof.id.au/forum/topic-137.html#msg1548

torginus 2 hours ago | parent | prev | next [-]

With regard to floors, afaik even DOOM didn't do them correctly. With vertical walls, the perspective divide needs to be done only once per column of pixels for a given wall segment.

For floors, unfortunately there's no such luxury, and if I remember correctly DOOM subdivided floors into patches, and only did proper perspective at the corners, and interpolated inbetween.

Jare an hour ago | parent [-]

For floors the perspective divide is once per row, just like for walls it's once per column.

The BSP may have led to some floor subdivisions, especially as it needs convex sectors. I don't remember if the engine would coalesce adjacent floor spans into a single one, but I hope it did.

Grumbledour 7 hours ago | parent | prev | next [-]

Later on, in Shadow Warrior, you could even do that, i think they used portals to implement it and i remeber it was a pain to set up in the editor.

kridsdale1 2 hours ago | parent | next [-]

That did give us our first software rendered transparent water rooms though (Quake had the water opaque unless you had 3DFX card IIRC)

mrob an hour ago | parent [-]

GLQuake introduced the r_wateralpha setting, which allowed transparent water, but the maps were still compiled with visibility calculations that assumed the water surfaces were opaque. You got visual artifacts unless you enabled r_novis to ignore the pre-calculated visibility calculations. Modern computers can handle it, but this was a heavy performance cost at the time.

To work around this, people used an unofficial tool to patch the maps to support transparent water:

https://vispatch.sourceforge.net/

classichasclass an hour ago | parent | prev [-]

Yes, essentially with a second rendering pass. Not cheap to implement which is why the game used it relatively sparingly.

scrumper 7 hours ago | parent | prev [-]

I thought at first it was just a skinned Wolfenstein 3D. Which is grossly unfair. A lot of work here.