Duke Nukem 3D Code Review 128
alancronin writes "Similar to Fabien Sanglard's previous code reviews of other games such as the Quake and Doom line of games comes a review of the code base of Duke Nukem 3D (split out over 4 pages). This will be a very good read for anyone interested in understanding the mechanics of a highly addictive game or anyone that wants to learn more about game design."
duke nuken (Score:5, Funny)
duke nuken
Re: (Score:1)
Always bet on Duke. Dunbass!
Re: (Score:1)
Hey, he's just quoting the title to the summary (did they fix that typo?). As to the actual topic which nobody is yet on, personally I found 3D to be not nearly as fun as the previous two Nukem side scrollers. It might have been because I was too eager for it and my hopes were too high, it might have been because I'd already been playing Quake 2 and even Quake 1 was technically better than Duke Nukem; DN3d was barely above Wolfenstein.
It may have been because the actions of the people I was playing Quake ag
Re:duke nuken (Score:4, Informative)
http://fabiensanglard.net/quakeSource/index.php [fabiensanglard.net] and http://fabiensanglard.net/quake2/index.php [fabiensanglard.net] as hinted by the summary.
Re:duke nuken (Score:5, Interesting)
Re: (Score:2, Interesting)
Re: (Score:2)
Re: (Score:1)
Re:duke nuken (Score:5, Informative)
Duke Nukem 3D was the first FPS to inject a healthy dose of humor into the game. That is what stands out in my mind over actual gameplay mechanics.
DN3D also had a wide variety of weapons, some of which were... standard FPS weapons, some which weren't.
Some of these were pioneered by DN3D, such as:
I should note that I'm focusing mainly on multiplayer things here.
Comment removed (Score:5, Informative)
Re:duke nuken (Score:5, Informative)
You couldn't run either Quake or Blood without a graphics card, there wasn't onboard video support back then. Presuming you mean a 3D card, neither Quake nor Blood originally supported 3D cards, and so both ran fine without it.
Quake did later get a 3d-accelerated version (glquake), but it was by no means required, and was sort of unofficial (Id Software released it, but it was unsupported).
Re: duke nuken (Score:2)
They most certainly had onboard graphics by the time these games came out. My Packard Bell POS 9000 with a 75mhz pentium had one. The onboard Cirrus Logic card took away 1mb out of my 8mb of system memory. Quake was the reason behind my first computer upgrade - - it needed at least 8mb to run.
Re: (Score:2)
Even farther back, I had a 286-12MHz motherboard with onboard Western Digital Paradise EGA and an IDE controller too.
Re: (Score:2)
Re: (Score:2)
There were no consumer 3D cards on the market when Quake originally shipped, and certainly not when Duke3D shipped... It predates those things. They came later. So of course, despite your claims, you most certainly COULD play Quake with cards that didn't exist at the time. In fact, because 3D cards were so rare even after they did come out, most people played Quake without 3D cards.
3D cards were not required to play Quake games until Quake 3 came out. I certainly didn't have one when I played Quake 2. Those
Re: (Score:2)
Considering that there were no consumer 3D cards on the market when Quake came out, let alone Duke3D, your assumption is faulty. Not only did Quake not require a 3D card, it did not even support 3D cards until the very end of 1996. That was when vQuake was released, which added support for Verite chips, and then later glQuake came out to support OpenGL. But those came later, and since very few people had 3D cards, they were not the norm at the time.
Quake games did not require a 3D card to play until Quake 3
Re: (Score:2)
Considering that there were no consumer 3D cards on the market when Quake came out, let alone Duke3D, your assumption is faulty. Not only did Quake not require a 3D card, it did not even support 3D cards until the very end of 1996. That was when vQuake was released, which added support for Verite chips, and then later glQuake came out to support OpenGL. But those came later, and since very few people had 3D cards, they were not the norm at the time.
Quake games did not require a 3D card to play until Quake 3
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Re: (Score:1)
And did you ever try running Quake on a 486 with no 3D chip?
Back at uni I ran Quake 1 and Quake 2 on Windows NT4 machines without 3D hardware acceleration, for many, many hours as part of a Quake clan. There was nothing wrong with Quake's performance on standard machines without 3D cards in those days.
I ran D3D an awful lot too, because it was great fun in multiplayer.
Re: (Score:2)
Re: (Score:2)
Yeah Blood took what was good about DN3D and multiplied it times ten. For a long time that was my favorite FPS, probably until Half-Life came out and I got my first Voodoo 3DFX graphics card.
My sentiments exactly; Blood was my favourite until Half-Life.
I used to love the voxel sprites in the Build engine. Ken Silverman was my hero.
Re: (Score:2)
Re:duke nuken (Score:5, Informative)
Duke 3D was waaay more sophisticated than Wolfenstein. While it did employ similar dated rendering techniques and the need for sprites, it did offer full range of motion along all three dimensions, actual floors and ceilings, interactive environments, the ability to look around using a mouse, and the ability to have passages that could overlap one another. Doom couldn't even do that.
The Quakes were technologically superior, by far. Three dimensional rendering in the truest sense, greater lighting effects, antialiasing (I think that came about with Quake 2, but correct me if I'm wrong). Network play out the wazoo. Even the audio capabilities were incredible. (I used to love putting different CD's in the drive to change up the soundtrack. Megadeth's "Rust in Peace" goes very well with Quake.)
But despite all that, I always had more fun with Duke 3D than I did with Quake. It just had a more colorful personality and it had more creative levels. Quake was always so... brown and gray.
Re:duke nuken (Score:4, Funny)
Duke 3D was waaay more sophisticated than Wolfenstein. While it did employ similar dated rendering techniques and the need for sprites, it did offer full range of motion along all three dimensions, actual floors and ceilings, interactive environments, the ability to look around using a mouse, and the ability to have passages that could overlap one another. Doom couldn't even do that.
The Quakes were technologically superior, by far. Three dimensional rendering in the truest sense, greater lighting effects, antialiasing (I think that came about with Quake 2, but correct me if I'm wrong). Network play out the wazoo. Even the audio capabilities were incredible. (I used to love putting different CD's in the drive to change up the soundtrack. Megadeth's "Rust in Peace" goes very well with Quake.)
But despite all that, I always had more fun with Duke 3D than I did with Quake. It just had a more colorful personality and it had more creative levels. Quake was always so... brown and gray.
The amount of weekends I spent with a friend, 2 computers, and a null modem cable, so much fun. We even built a map of our school with build. And we showed it off during open evenings. Probably get arrested nowadays.
Laser trip mines.Oh yes.
Re: (Score:2)
And the pipe bombs. Oh man, I loved those.
Re: (Score:2)
Re:duke nuken (Score:5, Funny)
"I'm here to use my bubble-gun and kick some asps. And I'm all out of bubbles."
Re: (Score:3)
"Dam toes, ale in bass 'tards argon happy forts 'ooting up my right. "
Re: (Score:1)
I'd like the follow up to be Mew Super Nario Bros. for the Wii-V
Re: (Score:2)
Re: (Score:1)
Re:Nuken... Really? (Score:5, Funny)
For shane.
Duke Nuken (Score:5, Funny)
Cone get sone!
Fuck, it's a 5 word title (Score:3)
And you can't get it right. Find a job more suited to your lack of ability already (though I admit it's going to be hard to find a job that requires less).
Re:Fuck, it's a 5 word title (Score:5, Funny)
Re: (Score:1)
Firmly mediocre. Yep, that describes Slashdot to a T.
Re: (Score:2)
Yeah well, Tirnothy tends to miss things like this.
Re:Fuck, it's a 5 word title (Score:5, Funny)
Find a job more suited to your lack of ability already (though I admit it's going to be hard to find a job that requires less).
Timothy has been with slashdot for so long that he is no longer qualified to do anything else.
Re: (Score:2)
Find a job more suited to your lack of ability already (though I admit it's going to be hard to find a job that requires less).
Timothy has been with slashdot for so long that he is no longer qualified to do anything else.
He never had any abilities, how do you think he got the job in the first place?
Re: (Score:2)
Find a job more suited to your lack of ability already (though I admit it's going to be hard to find a job that requires less).
Timothy has been with slashdot for so long that he is no longer qualified to do anything else.
I don't think anyone would hire him, the example of his work is on the internet for everyone to see, and he fails way too often.
Re: (Score:1)
Men's room attendant?
Oh, you're going to get an F on that one for sure! (Score:5, Informative)
Most methods have "void" parameters and return "void". Everything goes via global variables.
Methods naming does not use camelCase or NAMESPACE prefix.
Somewhere, my CS professor just had a simultaneous heart attack/stroke.
Re:Oh, you're going to get an F on that one for su (Score:4, Insightful)
Re: (Score:2)
Here in the real world using global variables gets you fired. Even worse are the PHP dunderheads who think that turning on register globals is a good idea.
Re: (Score:2)
Re:Oh, you're going to get an F on that one for su (Score:5, Informative)
Which is not what 99% of code does.
I was speaking generally, and generally globals are a bad idea.
Re: (Score:2, Troll)
Desktop code roughly teaches:
Global's are evil.
Goto is the most evil and hated statement ever.
Loops shouldn't run forever.
Pointers in general are evil.
Function pointers are to hard to understand because people are morons.
etc...
Re: (Score:2)
Ha, yeah right. We don't even have secure embedded devices. We have plenty of buggy, crashy, insecure ones though.
I am not sure what metric you are using, but most programmers are not employed writing embedded systems.
Re: (Score:2)
Re: (Score:2)
I actually miss goto and I'll admit it. It doesn't NECESSARILY produce spaghetti code, people! [ducking for cover]
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
I always love when people post this sort of nonsense. Good luck getting a job teaching if you can't do it first, sure it does happen, but portraying that as the status quo is just ignorance.
Teachers not only have to be able to do whatever it is, but they also have to be able to teach other people how to do it. The references I see in this thread are pretty much indicative of, we don't actually want to do it correctly, so we'll disparage the folks trying to make our lives easier by forcing the development of
Re:Oh, you're going to get an F on that one for su (Score:5, Insightful)
The engine was written by an 18 year old. You've got to forgive the lack of college CS education and work experience, and marvel at the talent to actually make the best featured and performing 3D game engine of it's day.
Re: (Score:3)
Well it wasn't true 3D; the Build engine was basically 2.5D -- the levels were still 2D, with an added height component -- using a lot of clever hacks to enable Z-axis levels and targeting. It worked well enough, and was a lot faster than the true-3D Quake on machines of the day. Quake needed a Pentium; if memory serves, Duke could run well on a 486.
I'd disagree that it was the best-featured engine of the day though. Bungie's Marathon engine was 2.5D with free-look and z-axis targeting, but also allowed for
Re: (Score:1)
Thanks for the pointer. Back then I was still on PCs, so I wasn't aware of Marathon. I see it's been ported to the iPad, so I'm downloading it for a look.
I imagine Macs of the day were better featured than the PCs. So that might account for some of it? Perhaps.
Did Marathon have angled floors? I remember being impressed with that in DN3D, having been used to Doom's limitations.
Re: (Score:2)
The Marathon series has also been open-sourced by Bungie [bungie.org], and builds are available for Mac, Windows, and Linux. Probably a better experience than the iPad version (haven't played it), but YMMV. They're actually pretty good single-player games.
With regards to your questions, Macs of the day did have an edge on graphics as compared to PCs, so that could account for the higher resolutions and higher bit-depth textures. But most of it is just smart people making cool stuff. As for destructible stuff, you know,
Re: (Score:2)
Bungie has open-sourced the Marathon series [bungie.org], with builds available for Windows, Mac, and Linux, so that may be a better experience than the iPad version.
You're right -- Macs of the day did have better graphics capabilities than equivalent PCs, so that may account for the higher resolutions and texture bit-depths. But I think most of the innovation just comes from smart people making cool stuff.
Yes, Marathon did have angled floors. Destructible stuff, I'm not sure -- the last time I played through the series
Re: (Score:2)
Bungie has open-sourced the Marathon series [bungie.org], with builds available for Windows, Mac, and Linux, so that may be a better experience than the iPad version.
You're right -- Macs of the day did have better graphics capabilities than equivalent PCs, so that may account for the higher resolutions and texture bit-depths. But I think most of the innovation just comes from smart people making cool stuff.
Yes, Marathon did have angled floors. Destructible stuff, I'm not sure -- the last time I played through the series
Re: (Score:1)
Oh yeah, destroyable walls, transparent windows and reflecting mirrors were also impressive aspects of DN3D, did Marathon have those?
Re: (Score:2)
Re:Oh, you're going to get an F on that one for su (Score:5, Funny)
Re:Oh, you're going to get an F on that one for su (Score:5, Funny)
Had a similar problem; couldn't figure out why I kept getting surprising compiler errors in some of my perfectly legal loops. Even more surprisingly, I got similar errors in some basic expressions, despite identical expressions using different variables compiling just fine.
Surprise was no longer adequate, and I had to resort to astonishment when I found a colleague had #defined the letter "r" to a constant.
Re: (Score:2)
Really, part of the fault lies with javascript, though. I generally like javascript, but implicit globals - bad idea.
Re: (Score:1)
Most methods have "void" parameters and return "void". Everything goes via global variables. Methods naming does not use camelCase or NAMESPACE prefix.
Somewhere, my CS professor just had a simultaneous heart attack/stroke.
Yeah, C doesn't have methods, it has functions. Argh!
Duke Nukem Forever (Score:5, Interesting)
I'm more interested in a Duke Nukem Forever code review. Imagine how horrible it must be.
Re:Duke Nukem Forever (Score:5, Interesting)
It'd be interesting to date various components of the code by technological improvements or software development trends.
"Here we see a portion from the early 2000s, by which point the developers had discovered primitive particle effects. It is built upon the ruins of an older epoch developed in the Quake II engine."
Re: (Score:2)
Re:Duke Nukem Forever (Score:5, Funny)
When it's done!
Re: (Score:2)
Re: (Score:2, Interesting)
What I love about DNF is that you can spot the bits where, over the years, they looked at the hot FPS du jour and thought 'shit we better put that in'. Like the eerily empty Half-Life 2 bits.
Re: (Score:2)
Yeah (Score:1)
Re:Yeah (Score:4, Funny)
Piece of cake!
That's a lie!
The appeal of DN3D (Score:5, Interesting)
DN3D came out when I was in my late teens, about 18 months before I went off to university and got a net connection good enough for online gaming. At the time, it was DN3D, rather than Quake, that was the LAN multiplayer game of choice for my friends and I.
Partly that was because of the actual gameplay. While Quake was a better twitch-shooter, DN3D had a real, nasty, sneaky dimension to its multiplayer. You could use the pipebombs and holoduke in particular to make traps for opponents that were just like something out of Spy vs Spy. Much more potential for hilarity than a simple rocket to the face.
But it was also the ease of level creation. Once we were bored of the levels that came with the game, it was trivially easy to fire up the bundled level editor and make new maps. We'd been doing that before with Doom and, if anything, despite having "2.5d" levels (as opposed to Doom's straightforward "2d" levels), DN3D level creation was even easier due to the quality of the tool. By contrast, creating "3d" Quake levels was massively more difficult and time consuming.
Once I went to University, of course, it became much easier to download new maps from the internet and the superior network infrastructure underpinning Quakeworld, Quake 2 and eventually Half-Life multiplayer moved my gaming in that direction instead.
Tricks and traps (Score:1)
My personal favourite was:
laser-tripmine just outside of a door beside a pile of pipebombs...
Door opens, breaks laser, explodes tripmine, explodes pipebombs. Bonus if you can leave a little breadcrumb trail of pipebombs.
Also fun to stick at the bottom of mineshafts, steps, etc.
Penny Arcade talked about it... (Score:2)
Sequel (Score:5, Funny)
Re: (Score:2)
Slashdot User #101 thought it was going into his room
Re: (Score:3)
Re: (Score:3)
Nominated for Best of Slashdot 2013.
That's two so far this year. A banner year in cleverness.
Portals (Score:2)
When I used to look at Doom and Duke3D and try to imagine how the engine worked, portals was the concept I imagined. I was surprised and initially rather confused when I found out that Doom actually worked using Binary Space Partitioning.
I'm rather pleased to see that I was at least right in my theory with regards to DN33. Possibly I came up with the portals theory after seeing DN3D's windows and mirrors, and then imagined that Doom worked the same way.
Anyhow, the article was a great read.
Re: (Score:2)
... Mind you I'd only ever imagined portals as complete rooms. But in actuality the borders of portals are everywhere the floor or ceiling height changes. So each chair for example consisted of two portals, one for the seat area, and one for the back.
Settings file (Score:2)
a.c (Score:2)
I noticed in the article that he was working with a decompiled version of the a.c file.
A version of it reimplemented in C was released as detailed here [advsys.net].
MUCH easier to read.
That should help with his project updating the engine as well as anyone else wanting to study th