Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

dopeflow

duke nukem 3d source

This topic is 5562 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Was just checking the source code of duke nukem 3d that got out today, I have to say this is some of the most awful code I have ever seen. Theres a function with 2000 line of codes in it. No comments at all. Maybe that was how it was done at the time but sheesh...no sense of modularity at all.

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
quote:
Original post by JuNC
Hmm, I wonder what the Q3A engine source looks like...


Well, id is quite keen on commenting. But they also like it messy

Share this post


Link to post
Share on other sites
The guy that wrote the BUILD engine has a website at http://www.advsys.net/ken/. He wasn''t very old when he did it (unless my math is all wrong, he started working on it before he was 18, with Duke3D releasing when he was 21). What that says about the final stuff you get today, I don''t know, but it could explain why the code comes off a bit... messy.

Share this post


Link to post
Share on other sites
The source is on 3drealms webpage, just after the duke nukem forever joke.

And yes it was quite the shit back then :D

Share this post


Link to post
Share on other sites
Yes the code is not very readable, but you have to realize it was written in the early 90's, so about a decade ago. The game itself (shareware) was released on January 1996, but it had been in development for a couple years and some of the code must have come from earlier 3DR games, so the code you're reading was quite a bit older than 1996 for sure.

From browsing the code, it's obvious that Replogle had NO IDEA it would ever be released to the public. So obviously it was not a priority at all to make it user-friendly. The code has a very "personalized" feel, with very specialized #define's and few comments. I imagine that Replogle was extremely comfortable with the code and didn't need any comments to understand it. He was coding for the present, to get the game shipped, not to help readability for someone 10 years later. Bad software engineering, yes, but at least the code itself is solid (after it's compiled).

C++ was crap for games back then, so games were written in C. Procedural was in. And, from the looks of it, the priority at 3DR was to simply "get it done" and have it be efficient, because it had to run on crappy hardware. Whether you like it or not, big functions, inline assembly (#pragma aux) and globals are fast ...

The only thing that would worry me is if Todd Replogle still codes like that today. If he still codes at all, that is. I heard he burned out and went back to university not long after Duke3D shipped...

All in all a dream come true, to dive into my favorite PC game's source code! I thought the day would never come. I feel like a kid in a candy store

[edited by - foofightr on April 1, 2003 10:16:04 PM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!