Page 1 of 1

Is quake 3 coded using C++?

Posted: Wed Jun 28, 2006 8:59 pm
by ajm113
I am not to fimilary if it is C++ or java but I want to get this book on how to make games to have massiv multiplayer in C++ but I am not sure if Quake 3 is being used on C++ I am still learning diffrent programing languages. Thank you.

Posted: Wed Jun 28, 2006 11:50 pm
by torhu
It's plain C89.

Posted: Thu Jun 29, 2006 12:21 am
by ajm113
where can I learn it more?

Posted: Tue Aug 29, 2006 7:24 pm
by eepberries
Get a book on C.

Posted: Tue Aug 29, 2006 8:58 pm
by ^misantropia^
torhu wrote:It's plain C89.
Almost. iD abundantly uses C++/C99-style comments (double slash).

Posted: Mon Oct 16, 2006 4:48 am
by mrd
Isn't it just called ANSI C? :paranoid:

Posted: Thu Jan 04, 2007 7:03 am
by Silicone_Milk
I wonder if somebody will get a wild hair up their ass and take the source code to Quake 3 and covert it to C++.

Sounds like something I might start and never finish.

Posted: Fri Jan 05, 2007 3:57 am
by torhu
I guess you could check the doom3/q4 mod source then. It's very much C++.

Posted: Sat Jan 06, 2007 8:57 am
by Silicone_Milk
me?

Why would I check that? Doom 3 is not Quake 3 silly :p

Posted: Sun Jan 07, 2007 10:38 pm
by TTK-Bandit
I started it once, and at least got to the point where all files where cpp files, was a lot of work to make it work..
anyway, qvm support was dropped through this, as it only supports c.
I didnt get to remove all old qvm parts though.
And its still old c, with alloc and stuff, no classes yet.
If you want to get my source, I can send it to you (keep in mind, I replaced most libraries with sdl)

btw, doom3 has some very interesting parts you should check before doing the real c++ conversion.

Posted: Sun Jan 07, 2007 10:58 pm
by AnthonyJ
I got further - I didnt touch the gamecode, but moved all the engine code over to .cpp, and had a number of bits rewritten actually using classes and inheritance, including a fair bit of the vector maths functions using operator overloading.

Theres a lovely bit in the rendering backend where it casts between an enum and a struct where the first field in the struct is a value of that enum... it was just crying out for polymorphism ;)

My sourcebase isnt really available for distribution tho as I abandoned it in a partially working state - my rewrite of the QVM backends to be derived classes seemed to break QVMs, and I remember some graphical glitch appearing just before the Q4 SDK was released.

Posted: Mon Jan 08, 2007 9:44 am
by Silicone_Milk
I would love to see what you have started and done so far TTK-Bandit.
(I use the SDL libraries for my image-handling needs in a 2D game engine I'm working on for fun)

Also, AnthonyJ, I would also like to see what you've done so far even if it isn't ready for distribution (that is, if you're willing to toss a copy my way heh =) )

Posted: Mon Jan 08, 2007 7:29 pm
by TTK-Bandit
just uploaded it..
http://mitglied.lycos.de/Q3Coderz/quake3sdl/
scroll down to the bottom..
note that qvm support is not excluded yet, and you need to set sv_pure 0 to make it run correctly.

Posted: Tue Jan 09, 2007 10:04 pm
by Silicone_Milk
sweet thanks man. I'll download it now and take a look.

On another note, I just bought Quake, Quake 2, and Quake 3 in a bundle (already had Q3 but I wanted the other two)

I forsee many sleepless nights and multi-engine-tinkering-fun.

:icon25: :icon25:

Posted: Wed Jan 10, 2007 5:18 am
by Silicone_Milk
I see support for development with VS2005.
I finally get to test out the free copy I sent away in the mail for :icon32:

EDIT: Oh jeeze. Lots of classes to be made. Woohoo! This'll be a ton of fun and give me something to do =D
I'm going to start by mapping out the engine from the top down in an HTML/Javascript type form and use it as a checklist to keep track of what Im editing.

Posted: Wed Jan 10, 2007 10:34 pm
by TTK-Bandit
hehe good luck, keep me up to date =)

Posted: Wed Jan 10, 2007 11:48 pm
by Silicone_Milk
hehe will do.
After documenting every function in the cl_cgame.cpp file and how they react with other files in the project (usage of structures, where the structures are located) and writing down what each variable is, how its made, and what it does, I gave up on a full documentation project that intense.

For now I'll be hunting down structures and documenting where they're found and how the game uses them (and maybe which functions use them if I'm feeling up to it) This should help get me started on converting them to classes.

I also have a temporary website I set up (kinda.. no, really, ugly) that I'm writing what Im doing and how I'm doing it. Ill keep things updated there I think. Ill send you a link once I get it fixed up so its readable and people can navigate through it.

Posted: Thu Jan 11, 2007 1:26 am
by TTK-Bandit

Posted: Thu Jan 11, 2007 1:54 am
by Silicone_Milk
First link is EXACTLY what I was doing. So far I've written down about 40% of the structure names and their file locations in the project directory

This is a huge help! :icon25:

Also, the second link is very interesting and I've bookmarked some pages from that site already. (Especially the page covering the QVM)

Posted: Thu Jan 11, 2007 2:33 am
by Silicone_Milk
Hrm.
I decided to compile the solution first to see that everything was in order.
Upon trying to run the newly compiled quake3.exe I get: "The application failed to initialize properly ( 0xc0000005 ). Click on OK to terminate the application."

Interesting.

I'm not worried about it myself but just thought you'd like to know.

As for me Im still planning out my moves. Plan first, fack with later ;)

Posted: Sat Jan 13, 2007 5:15 am
by Silicone_Milk
A fresh install of quake fixed the memory access error.
Was missing the default.cfg file and instead of telling me it just tossed that 0xc0000005 error.

Posted: Sat Jan 13, 2007 9:08 am
by torhu
Complete q3 doxygen here in case it can be of any help:

http://www.nanobit.net/quake3_doxy/

Posted: Sat Jan 13, 2007 9:16 am
by TTK-Bandit
Silicone_Milk wrote:A fresh install of quake fixed the memory access error.
Was missing the default.cfg file and instead of telling me it just tossed that 0xc0000005 error.
loool :olo:

Posted: Sat Jan 13, 2007 9:26 am
by Silicone_Milk
torhu wrote:Complete q3 doxygen here in case it can be of any help:

http://www.nanobit.net/quake3_doxy/

I love you :lub:

This takes a load off my mind worrying about overlooking stuff. Thanks a ton!!

Posted: Sat Jan 13, 2007 9:27 am
by Silicone_Milk
TTK-Bandit wrote:
Silicone_Milk wrote:A fresh install of quake fixed the memory access error.
Was missing the default.cfg file and instead of telling me it just tossed that 0xc0000005 error.
loool :olo:
I know I know lol. Such a stupid error.

BTW I'm getting a graphical glitch now that's probably just my videocard being my videocard. I've got a screenie somewhere I'll fish around for.