Is quake 3 coded using C++?

Locked
ajm113
Posts: 23
Joined: Tue Jun 27, 2006 7:45 pm

Is quake 3 coded using C++?

Post 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.
torhu
Posts: 76
Joined: Thu Jun 16, 2005 7:57 pm

Post by torhu »

It's plain C89.
[url=http://www.smokin-guns.org]Smokin' Guns[/url]
[url=https://sites.google.com/site/monsterbrowser//]Monster Browser[/url]
ajm113
Posts: 23
Joined: Tue Jun 27, 2006 7:45 pm

Post by ajm113 »

where can I learn it more?
eepberries
Posts: 1975
Joined: Mon Jan 24, 2005 10:14 pm

Post by eepberries »

Get a book on C.
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Post by ^misantropia^ »

torhu wrote:It's plain C89.
Almost. iD abundantly uses C++/C99-style comments (double slash).
User avatar
mrd
Posts: 4289
Joined: Sat Mar 25, 2000 8:00 am

Post by mrd »

Isn't it just called ANSI C? :paranoid:
Silicone_Milk
Posts: 2237
Joined: Sat Mar 12, 2005 10:49 pm

Post 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.
torhu
Posts: 76
Joined: Thu Jun 16, 2005 7:57 pm

Post by torhu »

I guess you could check the doom3/q4 mod source then. It's very much C++.
[url=http://www.smokin-guns.org]Smokin' Guns[/url]
[url=https://sites.google.com/site/monsterbrowser//]Monster Browser[/url]
Silicone_Milk
Posts: 2237
Joined: Sat Mar 12, 2005 10:49 pm

Post by Silicone_Milk »

me?

Why would I check that? Doom 3 is not Quake 3 silly :p
TTK-Bandit
Posts: 190
Joined: Sat Sep 07, 2002 7:00 am

Post 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.
AnthonyJ
Posts: 130
Joined: Wed Nov 15, 2006 7:51 pm

Post 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.
Silicone_Milk
Posts: 2237
Joined: Sat Mar 12, 2005 10:49 pm

Post 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 =) )
TTK-Bandit
Posts: 190
Joined: Sat Sep 07, 2002 7:00 am

Post 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.
Silicone_Milk
Posts: 2237
Joined: Sat Mar 12, 2005 10:49 pm

Post 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:
Silicone_Milk
Posts: 2237
Joined: Sat Mar 12, 2005 10:49 pm

Post 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.
TTK-Bandit
Posts: 190
Joined: Sat Sep 07, 2002 7:00 am

Post by TTK-Bandit »

hehe good luck, keep me up to date =)
Silicone_Milk
Posts: 2237
Joined: Sat Mar 12, 2005 10:49 pm

Post 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.
TTK-Bandit
Posts: 190
Joined: Sat Sep 07, 2002 7:00 am

Post by TTK-Bandit »

Silicone_Milk
Posts: 2237
Joined: Sat Mar 12, 2005 10:49 pm

Post 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)
Silicone_Milk
Posts: 2237
Joined: Sat Mar 12, 2005 10:49 pm

Post 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 ;)
Silicone_Milk
Posts: 2237
Joined: Sat Mar 12, 2005 10:49 pm

Post 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.
torhu
Posts: 76
Joined: Thu Jun 16, 2005 7:57 pm

Post by torhu »

Complete q3 doxygen here in case it can be of any help:

http://www.nanobit.net/quake3_doxy/
[url=http://www.smokin-guns.org]Smokin' Guns[/url]
[url=https://sites.google.com/site/monsterbrowser//]Monster Browser[/url]
TTK-Bandit
Posts: 190
Joined: Sat Sep 07, 2002 7:00 am

Post 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:
Silicone_Milk
Posts: 2237
Joined: Sat Mar 12, 2005 10:49 pm

Post 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!!
Silicone_Milk
Posts: 2237
Joined: Sat Mar 12, 2005 10:49 pm

Post 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.
Locked