Did you ever notice that the theater in level 1 of Duke Nukem 3D has a big hallway off the lobby, and when you go through there, it& #39;s a bathroom? Just the one.
It& #39;s a doorless unisex public bathroom with urinals. Weird.
It& #39;s a doorless unisex public bathroom with urinals. Weird.
I only realized this because the duke3dmaps tumblr posted some screenshots from the November 1995 beta (3 months pre-release) and it turns out there were gendered bathrooms then. https://duke3dmaps.tumblr.com/post/646006098449580032/fresh-november-1995-screenshots-of-hollywood">https://duke3dmaps.tumblr.com/post/6460...
BTW I& #39;m certain the real reason they put a bathroom in this level was this stupidly huge mirror.
This is a huge flex from the engine: look at us, we can do fucking MIRRORS
This is a huge flex from the engine: look at us, we can do fucking MIRRORS
you can shoot them with a gun, and they will get bullet holes, and then if you hit them with an explosive (even one that hasn& #39;t exploded yet...), it STOPS BEING A MIRROR
here& #39;s the best part: if you use a noclip code, you can walk through them.
because it turns out that the way the engine handles mirrors is by having surfaces tagged as mirrors, and there& #39;s an identical copy of the room on the other side, with some Magic to make the sprites work out
like in the bathroom there& #39;s a phone number on one of the walls.
If you& #39;re inside the mirror, you can see it& #39;s been mirrored
If you& #39;re inside the mirror, you can see it& #39;s been mirrored
but here& #39;s a fun question: so the game has remote-controlled bombs, right? and you can use them to destroy mirrors.
So what if you& #39;re in the mirror when you destroy it?
So what if you& #39;re in the mirror when you destroy it?
it gets SLIGHTLY weird and broken
fun fact: You can explore around in the mirror dimension but if you go to far, you will die.
even with God Mode active.
even with God Mode active.
so to learn more we need to open up the level in the editor.
Here& #39;s the bathroom in 2D mode, and that red line at the top is the mirror.
Here& #39;s the bathroom in 2D mode, and that red line at the top is the mirror.
then if we switch into 3D mode, you can see that it& #39;s got something weird going on with it. That "S" is a special effect called a Sector Effector
Duke3D uses a lot of these. You basically stick these sprites in areas and it& #39;ll control some special attributes of that area.
But here& #39;s the neat thing about Duke3D& #39;s mirrors:
So there& #39;s two ways this might "obviously" work, either:
1. The level developer has to manually create a copy of the room
2. The engine automatically clones the room at run time
So there& #39;s two ways this might "obviously" work, either:
1. The level developer has to manually create a copy of the room
2. The engine automatically clones the room at run time
And the answer is #2... but only mostly.
Because here& #39;s a differently centered view of that 2D map before.
See what& #39;s on the other side of the mirror? There& #39;s a room there.
See what& #39;s on the other side of the mirror? There& #39;s a room there.
and if you zoom out, it turns out there& #39;s a HUGE room back there.
but yeah. it& #39;s just a big empty room
BECAUSE it turns out that yes, the BUILD engine can build a reflection for you, but it does it at load time.
When the level is loaded, it finds the mirrors and copies that geometry into the room on the other side of the mirror
When the level is loaded, it finds the mirrors and copies that geometry into the room on the other side of the mirror
So to include a mirror, you have to leave enough room for the game to copy the geometry, or the mirror won& #39;t work properly.
this is also why you die if you wander too far inside the mirror: you& #39;ve moved outside the map.
Because the game considers the empty room to be the area you can move around in, not the real geometry.
Because the game considers the empty room to be the area you can move around in, not the real geometry.
SO here& #39;s the next question:
it won& #39;t work if the mirror-room is too small, right?
what exactly will happen?
TIME TO EDIT THE LEVEL AND SEE WHAT HAPPENS!
it won& #39;t work if the mirror-room is too small, right?
what exactly will happen?
TIME TO EDIT THE LEVEL AND SEE WHAT HAPPENS!
so it turns out that the answer is... the mirror just doesn& #39;t work, unless you& #39;re inside the area of the room on the other side of the mirror. Basically the mirror-geometry is only defined for that size of a space.
you can see here that it& #39;s working fine, then you back up too much and it breaks, then it starts working again when you get closer
You see the same "deader than God" effect when you go into it, too.
You can walk into it with noclip, but as soon as you step outside the map& #39;s real geometry, it kills you.
You can walk into it with noclip, but as soon as you step outside the map& #39;s real geometry, it kills you.
This sort of thing was honestly my favorite part of FPSes in the 90s: Getting a game, then getting hold of the level editors and finding how much of it was just a big hack
for example, here& #39;s the first shot of the game, in the editor.
Doesn& #39;t it look cool? You& #39;ve got sloped surfaces, a huge vista of a city, and SHADOWS on the ground! Isn& #39;t that neat?
Doesn& #39;t it look cool? You& #39;ve got sloped surfaces, a huge vista of a city, and SHADOWS on the ground! Isn& #39;t that neat?
it turns out the ceiling is a sort of skybox, which is normal for games, really, but it& #39;s implemented very weirdly.
The room has an actual shape, but by marking the ceiling as parallax, it& #39;s hidden.
The room has an actual shape, but by marking the ceiling as parallax, it& #39;s hidden.
As for the shadows: if you look at the 2D version of the level, you& #39;ll notice that the part in the middle isn& #39;t shaped how you& #39;d expect. it& #39;s just a rectangle, right? nope, it& #39;s got a weird border around it, but only on two sides.
because it turns out you can adjust the brightness level of sectors individually, and so to build a shadow, they split the floor into multiple sectors, then manually darkened those sectors to fake a shadow
And you know that neat bit near the beginning of the first level, where you fall down an AC shaft and onto the street?
The build engine can& #39;t do that! It& #39;s impossible!
The build engine can& #39;t do that! It& #39;s impossible!
So like Doom and Wolfenstein 3D, Duke Nukem is a "2.5D" engine. It& #39;s really a 2D map being rendered in 3D, using a lot of trickery.
So how could the roof be above the street?
So how could the roof be above the street?
Now, the BUILD engine does have a neat trick where it can KINDA do "Room over Room", which is what this effect is called.
Basically if you get into the two overlapping rooms from different sectors, it can tell which one you& #39;re in, and not get confused.
Basically if you get into the two overlapping rooms from different sectors, it can tell which one you& #39;re in, and not get confused.
But that& #39;s not being used here.
so if you zoom out, it turns out the whole rooftop set looks like this. It& #39;s just a rectangle inside a bigger rectangle. There& #39;s no street here at all.
and if you zoom out, you& #39;ll see that the street is actually way over there, in a different part of the map.
and if you zoom in on that air vent, you& #39;ll see it& #39;s LOUSY with sprites, some of which are doing special things...
because it& #39;s a teleporter!
because yeah, the part you fall down is not on the roof. it& #39;s on the street.
As soon as you step into the air vent, it teleports you over here to that tube on the street, and you fall down that.
As soon as you step into the air vent, it teleports you over here to that tube on the street, and you fall down that.
You can sorta see what& #39;s happening if you watch the automap
or if you enable the coordinates overlay.
another fun thing about the effect: So, you see these canisters and the warning signs, so naturally you shoot them, and they blow up, and the air vent blows up too.
Is that just natural splash damage?
Is that just natural splash damage?
Nope! it turns out it& #39;s cheating. See the those little vertical lines?
it turns out those are more explosive-barrel sprites, just squished down real thin.
It turns out the Build engine was designed so that if you make sprites super thin, they just don& #39;t render.
It turns out the Build engine was designed so that if you make sprites super thin, they just don& #39;t render.
BTW you may have noticed something in the corner of that zoom-out. There& #39;s a set of sectors in the corner of the level that you can& #39;t get to... they say AHB
That& #39;s Allen H. Blum III, who has worked on every Duke Nukem Game. He wrote the level editor for Duke Nukem 1, and drew many of the graphics.
Here& #39;s another fun thing about how the Build engine works. So, episode 1 level 3, we& #39;ve got a submarine in a lake. You can go underwater, and see the bottom of the sub.
But wait, there& #39;s no room-over-rooms. How does this work?
But wait, there& #39;s no room-over-rooms. How does this work?
So check out the coordinates. I& #39;m just going up and down here, in and out of the water. Only the Z coordinate should be changing.
and if you go into 3D mode, you& #39;ll see that this is the underwater half
and yeah, it turns out the two halves are in completely separate parts of the map. It& #39;s a teleporter again! it& #39;s just teleporting you from the surface version to the underwater version
So yeah, that& #39;s how Duke 3D does underwater sections, like lakes and pools and such. Because the surface of the water is opaque, you can& #39;t tell that this is happening.
DUN DUN DUN there& #39;s actually THREE submarines!
Because once you have the ability to teleport the player when going up out of the water, there& #39;s no reason you have to make it always go to the same place.
so yeah, they put another level of water on the bottom of the sub (a moon pool) and let you go "inside" the submarine. In reality, you& #39;re not going UP into the submarine, you& #39;re going sideways into another room
They even ensure that the illusion isn& #39;t shattered by teleporting projectiles between the rooms. You can fire a rocket into a pool, and it& #39;ll hit the bottom of the pool
In that same level there& #39;s this bit. Look, there& #39;s an upper floor there! How do you have an upper floor walkway if there& #39;s no real Room-over-Room?
and if you pull it up in the BUILD editor you& #39;ll see... yep. It looks like a bunch of floors floating over other floors. WEIRD!
it turns out there& #39;s no sector effects happening here.
You can hover over a sprite in the editor, and make it a billboard (always facing the player), a wall-texture, or a floor-texture.
You can hover over a sprite in the editor, and make it a billboard (always facing the player), a wall-texture, or a floor-texture.
and yeah, that& #39;s all this is: sprites.
You can place sprites, make them flat, then set them to block the player and now the player can walk over them like they& #39;re a floor!
You can place sprites, make them flat, then set them to block the player and now the player can walk over them like they& #39;re a floor!
fun fact: we& #39;ve seen this before in this thread.
finally, what about the secret apartment in the first level? How& #39;s that work? Teleporters, weird portal effects, sector effectors?
it& #39;s actually none of those.
It& #39;s just using the fact that Build lets you set wall textures as single-sided, so that you can& #39;t see into the apartment from the outside. It& #39;s actually there where it appears to be.
It& #39;s just using the fact that Build lets you set wall textures as single-sided, so that you can& #39;t see into the apartment from the outside. It& #39;s actually there where it appears to be.
and if you turn that off, you& #39;d be able to see right into the room.