Forum Archive

Go Back   3D Realms Forums > 3D Realms Topics > Other Apogee/3D Realms Games > Rise of the Triad (1995) Source Code
Blogs FAQ Community Calendar

Notices

 
 
Thread Tools
Old 12-24-2002, 09:27 AM   #1
AlteDrecksau
ROTT alpha?
I just had a look on the ROTT source code and I was really surprised by the bad programming style. There are functions which are used before they are declared, brace style is very inconsistent and there were even files misspelled (like _rt_buil.h). I'm wondering if this code really stems from a workable build.
AlteDrecksau is offline  
Old 12-24-2002, 10:33 AM   #2
Joe Siegler
3D Realms Staff

Joe Siegler's Avatar
Re: ROTT alpha?
Quote:
I'm wondering if this code really stems from a workable build.
<font size="2" face="Verdana, Arial">Yes, it's the final v1.3 version of the game.

What's this have to do with "ROTT Alpha"? That subject doesn't seem to make any sense to me.
__________________
Apogee / 3D Realms Employee: Dec 14, 1992 - May 22, 2009, Oct 23, 2014 - current

"Lifting up the Cross to the waiting lost" - Petra | John 3:16
Joe Siegler is offline  
Old 12-24-2002, 10:50 AM   #3
Lon Matero
Re: ROTT alpha?
I'd just have to say, cut them some slack, this code is eight years old. Watcom isn't as strict as newer compilers, so that's why it didn't require function prototypes, for example.

The reason for inconsistent coding style is because of multiple programmers worked on the game. I guess there was no company style guidelines back then, as ROTT was Apogee's first large scale inhouse game.
Lon Matero is offline  
Old 12-25-2002, 02:40 AM   #4
theoddone33
Re: ROTT alpha?
Quote:
Originally posted by AlteDrecksau:
I just had a look on the ROTT source code and I was really surprised by the bad programming style.
<font size="2" face="Verdana, Arial">Schedule is what drives products. If code cleanliness doesn't get the game out faster, it is not necessary. This is the way it works in the real world.

Quote:

I'm wondering if this code really stems from a workable build.
<font size="2" face="Verdana, Arial">Of course. Whether or not you keep your indentation style consistent has no bearing whatsoever on the functionality of the game.
theoddone33 is offline  
Old 12-25-2002, 05:56 AM   #5
AlteDrecksau
Re: ROTT alpha?
Quote:
Originally posted by theoddone33:
Schedule is what drives products. If code cleanliness doesn't get the game out faster, it is not necessary. This is the way it works in the real world.
<font size="2" face="Verdana, Arial">John Carmack also had his schedule when he was developing Doom, but his code is much cleaner than R.O.T.T.'s.

Quote:

Of course. Whether or not you keep your indentation style consistent has no bearing whatsoever on the functionality of the game.
<font size="2" face="Verdana, Arial">I'm not only talking about bad style, there are errors in the source code which should make in incompilable like the misspelled include of _rt_buil.h.
AlteDrecksau is offline  
Old 12-25-2002, 07:10 AM   #6
ADM

ADM's Avatar
Re: ROTT alpha?
oh boo ****ing hoo.. who cares?

The code DOES work, proof is in the Linux and MacOS ports that are available now.

I myself have my own coding style, which others might find messy but if it works then great, if it's confusing for others then they can clean it up themselves.
ADM is offline  
Old 12-25-2002, 07:14 AM   #7
AlteDrecksau
Re: ROTT alpha?
Quote:
Originally posted by ADoomedMarine:

The code DOES work, proof is in the Linux and MacOS ports that are available now.
<font size="2" face="Verdana, Arial">It works since they have corrected the errors.
AlteDrecksau is offline  
Old 12-25-2002, 07:19 AM   #8
ADM

ADM's Avatar
Re: ROTT alpha?
Quote:
Originally posted by AlteDrecksau:
</font><blockquote><font size="1" face="Verdana, Arial">quote:</font><hr /><font size="2" face="Verdana, Arial">Originally posted by ADoomedMarine:

The code DOES work, proof is in the Linux and MacOS ports that are available now.
<font size="2" face="Verdana, Arial">It works since they have corrected the errors. </font><hr /></blockquote><font size="2" face="Verdana, Arial">do you know that? do you have proof they did alter the code to get it to work?
ADM is offline  
Old 12-25-2002, 07:34 AM   #9
The Stinger
Guest
Re: ROTT alpha?
It's he 1.3 source code... I patched my game to 1.3 and it works perfectly. So whats the problem?
 
Old 12-25-2002, 07:47 AM   #10
AlteDrecksau
Re: ROTT alpha?
Quote:
Originally posted by ADoomedMarine:
do you know that? do you have proof they did alter the code to get it to work?
<font size="2" face="Verdana, Arial">Look at icculus's cvs tree.
AlteDrecksau is offline  
Old 12-25-2002, 07:53 AM   #11
The Stinger
Guest
Re: ROTT alpha?
Quote:
Originally posted by AlteDrecksau:
</font><blockquote><font size="1" face="Verdana, Arial">quote:</font><hr /><font size="2" face="Verdana, Arial">Originally posted by ADoomedMarine:
do you know that? do you have proof they did alter the code to get it to work?
<font size="2" face="Verdana, Arial">Look at icculus's cvs tree. </font><hr /></blockquote><font size="2" face="Verdana, Arial">I think he means to get it to compile with watcom. AS in just compile the thing to test if that works
 
Old 12-25-2002, 08:30 AM   #12
AlteDrecksau
Re: ROTT alpha?
It may compile under a compiler which is so lazy to just give a warning when there are files to be included which do not even exist and so intelligent that it can compensate missing structure definitions, so it may compile under watcom if it fulfills this prerequisities; but, for example, not under MSVC.
AlteDrecksau is offline  
Old 12-25-2002, 11:31 AM   #13
Crosma

Crosma's Avatar
Re: ROTT alpha?
Quote:
Originally posted by AlteDrecksau:
not under MSVC.
<font size="2" face="Verdana, Arial">ROTT won't compile as-is under MSVC, is contains a lot of Watcom specific code.
__________________
(define love (lambda () (map conquer all)))
Crosma is offline  
Old 12-25-2002, 05:30 PM   #14
Night Hacker

Night Hacker's Avatar
Re: ROTT alpha?
Quote:
John Carmack also had his schedule when he was developing Doom, but his code is much cleaner than R.O.T.T.'s.
<font size="2" face="Verdana, Arial">So? Who cares? Nobody was ever meant to see the source code in the first place so who cares what it looks like, the only thing they were worried about was if the code worked or not. When you have multiple programmers working on different problems you're going to get different coding styles as well, so long as you can understand what the code is doing and it works, nothing else matters. I think you'll find alot of commercial games this way.
__________________
"My general feeling is that computers are doing more harm than good." - Jay Miner ("father" of the Amiga)
Night Hacker is offline  
Old 12-25-2002, 06:05 PM   #15
IceColdDuke
Re: ROTT alpha?
The wolfenstien 3d code was worse.....NO comments [img]images/icons/frown.gif[/img]
IceColdDuke is offline  
Old 12-26-2002, 12:06 AM   #16
IceColdDuke
Re: ROTT alpha?
To be more correct...the first time I compiled ROTT under MSVC I got 200ish compiler errors.

But in the long run, I had fix over 450ish errors [img]images/icons/smile.gif[/img]
IceColdDuke is offline  
Old 12-28-2002, 02:23 AM   #17
George Broussard

George Broussard's Avatar
Re: ROTT alpha?
AlteDrecksau,

So what? It's free [img]images/icons/smile.gif[/img]

Just shows how bad of code you can write and still make a game that sold 250k copies in 1995.

Go forth and do better [img]images/icons/smile.gif[/img]
George Broussard is offline  
Old 12-28-2002, 04:54 AM   #18
rg3
Re: ROTT alpha?
Plus there is an "indent" tool you can use to get uniform style and improve readability. At least for Linux...
rg3 is offline  
Old 12-28-2002, 04:17 PM   #19
dejay

dejay's Avatar
Re: ROTT alpha?
Quote:
Originally posted by George Broussard:

Go forth and do better [img]images/icons/smile.gif[/img]
<font size="2" face="Verdana, Arial">[img]images/icons/grin.gif[/img]
__________________
ill just have the Anus please - Marty
dejay is offline  
Old 12-28-2002, 05:23 PM   #20
MrEricSir
Re: ROTT alpha?
Only a computer science major who hasn't seen or worked with real-world code would whine about ROTT's source code.
__________________
Big Brother is watching. Dress accordingly.
MrEricSir is offline  
Old 12-28-2002, 07:41 PM   #21
andystob
Re: ROTT alpha?
But there is a lot to be said for using standard templates and a house agreed convention for coding and a commenting. Makes things a lot easier in the long run.... team code reviews, I find, are so much easier when neatly laid out and pleasing to the eye...

But I don't work in the game industry so I'm not sure if that applies.....
andystob is offline  
Old 12-29-2002, 03:49 AM   #22
Night Hacker

Night Hacker's Avatar
Re: ROTT alpha?
Quote:
Originally posted by andystob:
But there is a lot to be said for using standard templates and a house agreed convention for coding and a commenting. Makes things a lot easier in the long run.... team code reviews, I find, are so much easier when neatly laid out and pleasing to the eye...

But I don't work in the game industry so I'm not sure if that applies.....
<font size="2" face="Verdana, Arial">I agree. When I'm working on my game I like to TRY and keep my code as neat as possible and well commented, mainly for my own purposes so I don't forget why I did something, but it will benefit anyone who sees my code in the future too.

I have known teams of programmers that have agreed on a certain way of coding, like 3 spaces in, /* */ style comments to describe what a function does just before a function etc... it has definately helped me learn from thier code and I have adopted alot of thier coding styles. Of course, I am a neatness nut, I HAVE to have all my indentations just right or it bugs me, but it really helps you see what code is within certain loops really fast. Sometimes when you get carried away coding you can start getting messy and I can only imagine what it is like if you have several people working on something, all with different styles and possibly a deadline etc.. how it can be.
__________________
"My general feeling is that computers are doing more harm than good." - Jay Miner ("father" of the Amiga)
Night Hacker is offline  
Old 12-30-2002, 08:13 AM   #23
Flaose

Flaose's Avatar
Re: ROTT alpha?
ROTT alpha [img]images/icons/grin.gif[/img]
Flaose is offline  
Old 12-31-2002, 11:39 AM   #24
AlteDrecksau
Re: ROTT alpha?
Quote:
Originally posted by MrEricSir:
Only a computer science major who hasn't seen or worked with real-world code would whine about ROTT's source code.
<font size="2" face="Verdana, Arial">Bah Humbug!

[ 12-31-2002, 11:44 AM: Message edited by: AlteDrecksau ]
AlteDrecksau is offline  
Old 12-31-2002, 04:08 PM   #25
theoddone33
Re: ROTT alpha?
In answer to the ROTT alpha question... the code is from a workable build, yes. However it is not the same as the release build. There were some apparently minor changes made between the release build and the source release. Most of them seem to involve dopefish.

The include mistake mentioned is not a mistake at all, since either watcom or dos truncates the filename to 8.3 format.
theoddone33 is offline  
Old 12-31-2002, 07:53 PM   #26
AlteDrecksau
Re: ROTT alpha?
Quote:
Originally posted by theoddone33:

The include mistake mentioned is not a mistake at all, since either watcom or dos truncates the filename to 8.3 format.
<font size="2" face="Verdana, Arial">Truncate "_rt_build.h" to "_rt_buil.h" ? Doubt it.
AlteDrecksau is offline  
Old 12-31-2002, 08:16 PM   #27
The Stinger
Guest
Re: ROTT alpha?
Quote:
Originally posted by AlteDrecksau:
</font><blockquote><font size="1" face="Verdana, Arial">quote:</font><hr /><font size="2" face="Verdana, Arial">Originally posted by theoddone33:

The include mistake mentioned is not a mistake at all, since either watcom or dos truncates the filename to 8.3 format.
<font size="2" face="Verdana, Arial">Truncate "_rt_build.h" to "_rt_buil.h" ? Doubt it. </font><hr /></blockquote><font size="2" face="Verdana, Arial">let me explain.Dos file name have a max of 10 characters, 11 if you include the "."Infront of the "." can only be 1 to 8 characters long. After the "." can only contain 1 to 3 characters.

_rt_buil.h : _rt_buil = 8 characters and h = 1.a perfect dos name structure
_rt_build.h: _rt_build 9 and h = 1. 1 character too many infront of the "."

Now the next question is why not rename it to rt_build.h. I think they didnt because _ will put the file in alphabetical order in the top.
the 2nd _ is just to seperate rt and buil for better view of file names.
 
Old 12-31-2002, 08:19 PM   #28
relnev
Re: ROTT alpha?
Quote:
Originally posted by AlteDrecksau:
Truncate "_rt_build.h" to "_rt_buil.h" ? Doubt it. [/QB]
<font size="2" face="Verdana, Arial">"_rt_buil" is 8 characters long. The DOS compilers would actually allow you to include "_rt_builasdfjkl.h" and it would load _rt_buil.h.

Most of the changes we made for the Linux version were not to fix errors, but to add support for OSes other than DOS [img]images/icons/smile.gif[/img] (We still have yet to fix the file serialization issues, though.)
relnev is offline  
 

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 07:20 PM.

Page generated in 0.18177891 seconds (100.00% PHP - 0% MySQL) with 16 queries

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.

Website is ©1987-2014 Apogee Software, Ltd.
Ideas and messages posted here become property of Apogee Software Ltd.