ToyBox wrote:I really want to get involved with helping out in developing SG, so any help on this would be greatly appreciated!
Good day ToyBox,
I don't know much about Q3 engine, so keep this in mind, while you'll be reading the following
I'll share with you some of simpliest knowledge that helped me to start understand SG code.
The game partsAt first, there are two separate things when you have the game installed:
1. The game engine. Which is Tech3 (or Q3 engine in short). And which consists of four components:
1.1. Game Exutable. The smokinguns.exe file under Windows OS. This one is entry point for the whole game. It sends requests to Quake Virtual Machines (QVMs) and handles responses. Since on non-Windows platforms there are no .exe files, Tequila will be call it the Engine (keep this in mind when you'll be talking with him).
1.2. Game QVM (qagame.qvm). The file is stored inside smokinguns\sg_pak0.pk3 file in vm directory. This one handles server behaviour of the game.
1.3. Client Game QVM (cgame.qvm). The file stored inside the same package as previous file. This one is about client behaviour of the game.
1.4. User Interface (UI) QVM (ui.vm). The file stored inside the same package as previous file. This one is about everything you see in user interface.
2. The game other files. Everything you may found in your installed SG game folder. All packages, configuration files, installation routine, etc.
What am I building?The source code under SVN is about first part (the game engine) only. You are able to build only the engine (1.*) of the game from SVN, but you won't start it without the second part.
With VC you may compile and build only the exutable (yeah, the 1.1. point).
So, after building the source code with VC you'll get the smokinguns.exe file.
The same source code is shared between QVMs.
To build QVM you'll need QVM compiler. Which is lcc. Latest version from original (vanilla) Quake3 source code is 3. The ioQuake team introduced the improved version which is 4.
SG 1.0 uses lcc version 3 to build QVMs. And SG 1.1 uses lcc version 4 to build QVMs.
lcc compiler is included into the game source code and could be rebuild (yeah, the source code of it is included into the game source code too).
lcc has few files to build the QVM:
lcc - the compiler (translates c code into assembler code speciefic for the compiler)
asm - linker for asm files. Will create QVM from asm files.
(yeah, it also have a few more files, but let not compilcate things).
To make the process of QVM compilation easier SG source code has bath file for such purpose: buildvm.bat (you may take a look inside it to understand how it compiles the QVMs).
After building with buildvm.bat (just by launching it) you'll get three VMs (1.1., 1.2, 1.3).
How am I testing my code?After you built the source code you'll have four files:
Exutable (smokinguns.exe)
Three VMs (qagame.qvm, cgame.qvm, ui.qvm).
To have game working you'll need both game parts - the engine and all other files (yes, the 1.* and 2.).
If you don't want to mess with your vanilla SG game - just make a copy of whole folder (that won't affect your current game then).
Now, you may replace current smokinguns.exe with your new one. Or just rename new to something and put it near the original (like smokinguns_test_fix.exe). Or you may rename original .exe to something like Vanillasmokinguns.exe. It will be playable anyway.
And QVMs should be placed into quake package file. Yeah, the pk3 file.
The first thing to know about package file that it is zero comression zip file. Yeah, you can open it with any archiver you like (winrar can do it well).
The original QVMs are stored in smokinguns\sg_pak0.pk3 file. Inside that package under vm directory.
So, to test your fix you may just replace the original ones.
You may also create completely separate package for your new QVMs. To make it read by the exutable name it as sg_pak1.pk3.
Inside the package create vm directory and place all your new QVMs there.
Now you are able to test your code in game.
Short questions and aswersQ. What are those DLLs for then?
A. For another way of holding/requesting functions. Windows already has dynamic linking - when what for those QVMs if we may just create a dynamic linking library and call it each time for required function?
MSVC solutions wich are stored inside SG source code have DLL projects. You may compile them and you'll get three dlls (with the same purpose as original QVMs). To use them - just place them to your SG folder and launch the game with some additional parameters (use the ones Tequila has written above).
Q. What is the pure and unpure server?
A. The pure server will allow to connect only the clients who have the same QVMs as the server has.
Q. What will happen if I'll connect to pure server and if I have unpure (modified) QVMs and exutable?
A. You may have any exutable. Current SG doesn't have any check for your exutables.
And in case of different QVMs the server won't allow you to do so.
Q. What will happen if I connect to unpure server and I have unpure (modified) QVMs?
A. You'll use the QVMs from the server. In other words, you'll download the servers QVMs and then game will use them instead of yours.
Q. How will I check my server behavior at home then?
A. Just by starting a local server. That it - just create a new multiplayer game.
Q. What differences do have 1.0 and 1.1 SG versions? Concerning source code/compilation/build.
A. Not many, but the are exist.
1.1 is about ioQuake backporting. So, you may apply almost every way to compile it like you'll do it with ioQuake. ioQuake has beuatiful guides about how to compile the code.
For example, check this (may be you'll need to register there first to be able to read it, but it is free, so do it - it worth it)
one. This is about VC game compilation. Hope one day SG will have more coders and someone will create manual for dummies like me here too.
Other major point is directories structure. But you'll get used to it soon.
And not concerning code, but the testing stage - 1.1 SG has different place to store its configuration files. It is in your documents and settings directory in Application data. Be aware of that.
Q. The linux users just do the make command and then they have whole engine built. Is there any way to do so under windows?
A. No. But you may use some tools which will help you to emulate linux environment. Like MinGW. The SG 1.1 could be build with one make command with MinGW. You may use the same instruction as ioQuake has (in the same ioQuake forum, just other topic).
I hope I've given you at least one way to build your modified version of SG and then to check it before post patch here. I think that is enough to start coding/testing.
Don't hesitate to ask simple questions! These ones are the best ones. The better your start the better results you may achieve during the process
I'm very glad to see a new coder here!
P.S. You may also read a topic somewhere around here wich is full of links to Quake3 engine coding guides.
But that is not so fun to do it alone.. and actually the community is about to help each other, isn't it?
"You should know that the lies won't hide your flaws/No sense in hiding all of yours/You gave up on your dreams along the way" (c) "Fake it" by Seether
P.S. English isn't my native language.