Jump to content
  • Advertisement

Archived

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

iNsAn1tY

The Quake II source code...

This topic is 5557 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

I got bored and decided to browse the Quake II source code. However, it's massive and I was wondering if anyone here had seen any articles explaining it? I'm only asking because to fully understand it I'm going to map it, but if someone else has done this, it's sort of pointless me doing it again. Also, I was looking through it and kept seeing "edict_t". I searched for it's definition, but could only find that of "edict_s". Does anyone know what this is? I'm gonna have to kidnap John Carmack and get him to explain it all to me

Coding Stuff ->  [ iNsAn1tY Games | DarkVertex | How To Do CSG | Direct3D Vs. OpenGL | Google ]
Fun Stuff    ->  [ Evil T-Shirts | Stick-Based Comedy | You're Already Here | The Best Film Reviews ]
[edited by - iNsAn1tY on March 31, 2003 2:32:09 PM]

Share this post


Link to post
Share on other sites
Advertisement
In C you have to(well you don't have to but carmack does most of the time) declare structs like this

typedef struct foo
{
int bar;
} foobar;

When you want to create a variable that uses that struct type you declare it like this

foobar thing;

instead of having to have

struct foo thing;

Most probably somewhere in the q2 code you will find something looking like this

typedef struct edict_s
{
...
} edict_t

So basically edict_t is an edict_s struct typedef.

Of course I could be wrong it's just in c carmack(dunno if other people do it) has a habbit of suffixing all his struct typedefs with _t

[edit]
If you are gonna try and understand all the q2 code I highly reccomend a c documenter such as doxygen(may have got name wrong). It creates a load of HTML documents of the source code with everything cross referenced. If you want to know where a function or type is declared click it and you can find out.

[edited by - Monder on March 31, 2003 2:50:27 PM]

Share this post


Link to post
Share on other sites
If your using the Q2 source then you might want to check out this site - it''s got tutorials on adding stuff and soem bug fixes for the engine - www.quakesrc.com

Share this post


Link to post
Share on other sites
Thanks for the replies. I''ve been looking a little more this morning, and stuff is starting to make sense. Another difficulty is that Carmack seems to be a veteran of the days when you could only use 8 characters for a variable name in C. I''ll look for Doxygen, it could be very helpful. Oh, the server must be down on www.quakesrc.com, because I couldn''t get to it...



Coding Stuff ->  [ iNsAn1tY Games | DarkVertex | How To Do CSG | Direct3D Vs. OpenGL | Google ]
Fun Stuff    ->  [ Evil T-Shirts | Stick-Based Comedy | You''re Already Here | The Best Film Reviews ]

Share this post


Link to post
Share on other sites
I think he meant quakesrc.org (not com)

[edited by - trub on April 1, 2003 6:35:27 PM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by Monder
Of course I could be wrong it''s just in c carmack(dunno if other people do it) has a habbit of suffixing all his struct typedefs with _t



Nope it''s not just a Carmack thing. Check MSDN for a list of <a href = "http://msdn.microsoft.com/library/en-us/vclib/html/_CRT_Standard_Types.asp?frame=true">standard types</a>.

Share this post


Link to post
Share on other sites
quote:
Original post by trub
I think he meant quakesrc.org (not com)
Thanks, trub, it was quakesrc.org.

I haven't seen that before, core. I usually define all my typedef structs like this:

typedef struct
{

char sBlah[64];
int iRoobarb;

} MYSTRUCT;
Then variable definitions look like this:
MYSTRUCT MyVariable;  
I might convert to that naming convention, though. I already use the "g_" prefix for global variables anyway...



Coding Stuff ->  [ iNsAn1tY Games | DarkVertex | How To Do CSG | Direct3D Vs. OpenGL | Google ]
Fun Stuff    ->  [ Evil T-Shirts | Stick-Based Comedy | You're Already Here | The Best Film Reviews ]


[edited by - iNsAn1tY on April 2, 2003 5:10:51 AM]

Share this post


Link to post
Share on other sites
iNsAn1tY , aren''t Shadow''s searching for you ? Don''t u see nightmares at night ? Isn''t ur conscience guilty for something you didn''t do ? Don''t u scream about it ? WHERE IS A DOWNLOAD TO YOUR EDITOR ???
Cmmon man , release it - whatever it''s like .

Share this post


Link to post
Share on other sites
OK, some explanation first. The version I'm working on now has had all it's code stripped out, and only two functions work (the arrow and the create object tool). I haven't been working on it much, as it's annoyed me and I have coursework for college. I'll resume it after my exams, and finish it. I need to, as I have to do demos for game company interviews. One of the other versions has some other functions working, but it's not in a workable condition right now.

Here is the new version (it's about 16KB): DarkVertex.zip



Coding Stuff ->  [ iNsAn1tY Games | DarkVertex | How To Do CSG | Direct3D Vs. OpenGL | Google ]
Fun Stuff    ->  [ Evil T-Shirts | Stick-Based Comedy | You're Already Here | The Best Film Reviews ]


[edited by - iNsAn1tY on April 2, 2003 4:44:11 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!