Author Topic: Getting started with the Quake 2 source  (Read 29314 times)

Offline peewee_RotA

  • Brobdingnagian Member
  • ***
  • Posts: 4152
  • Hi, I'm from the gov'ment and I'm here to help you
    • View Profile
  • Rated:
Getting started with the Quake 2 source
« on: March 10, 2010, 12:37:35 PM »
Thought that I'd start a thread for beginners who want to get started with the quake 2 source. For right now I'm going to link to the original source and then include the clean code base later. I'm not as familiar with compiling clean code so once I get time to take a look I'll revise this.


First of all you need the quake 2 source:
http://www.zeliepa.com/dna/files/q2_321_src.zip

Next you'll need a compiler. Any version of Microsoft Visual Studio should work, even the express editions. I'll recommend Visual C++ 2008 Express Edition since it is what I have installed right now.
http://www.microsoft.com/express/Downloads/#2008-Visual-CPP

Lastly you need to start learning the basics of c/c++. The following tutorial seems to be very thorough. You'll not be as worried about the background of the language or all of the introductory concepts right now but it always helps to read up on it later. What you're worried about right now is learning the syntax of the c language.
http://www.iu.hio.no/~mark/CTutorial/CTutorial.html


So right now we are focusing only on mods, which means that you'll be compiling the server side gamex86.dll. Extract the q2_321_src.zip and navigate to the quake2-3.21\game path. There you will see a game.dsp. This is just a project file and once you open it, you will be asked to make a workspace and a solution as well as convert this project. Just press yes, next, and or finish until the dialog boxes are gone. From now on you will be opening the .sln file that you have created when converting the project instead of the .dsp.

On the top you will see a drop down that selects the current configuration. You should see "Debug Alpha" selected by default. Click the drop down and select Release. Now click on the project menu and click the "game properties..." option. From here you want to remove one dependency that is left in by mistake. Make sure that "Release" is selected on the top Configuration drop down (NOTE: it may be listed as "Active(Release)"). On the left of the "Property Pages" pane you will see a tree like view.  Expand the Configuartion Properties entry then expand the Linker entry. Then select Input under the Linker entry. You will see "winmm.lib" under additional dependencies. Remove this from additional dependencies and press OK.

Now you can click on the Build menu and then Build Solution. This should compile error free and create a folder named Release containing a brand new gamex86.dll. This will be in the parent folder so here is an example folder structure to help you find the newly compiled file.
Where you extracted to:
c:\quake2\mymod\
The .dsp file is located at:
c:\quake2\mymod\quake2-3.21\game\game.dsp
The solution file that you should have created:
c:\quake2\mymod\quake2-3.21\game\game.sln
The compiled gamex86.dll will be placed at
c:\quake2\mymod\quake2-3.21\release\gamex86.dll
In order to play the new mod that you are creating, copy the new gamex86.dll to your mode directory, start quake 2, type game followed by your modname and then start a new game.

Example of starting a new game with your mod
c:\quake2\mymod\gamex86.dll
open quake 2 and type:
game mymod
map q2dm1

After you your gamex86 compiles without errors, you copy it, and are able to load it in a game of quake 2 then you can go back to your visual studio and start making changes like mad. Change anything you want. Don't worry about making errors or breaking things. This is a learning experience and starting again from scratch is part of that process. All of the game's source code are held in .c and .h files. Things like p_weapon.c and g_weapon.c control weapons and things like p_client.c control health and placing a client into a server. Start with changing numbers, like how much damage a weapon does, and then move on to more advanced changes.

For more good help, start following tutorials at:
http://webadvisor.aupr.edu/noc/CodingTutorials.htm

I also have lots more information at my forum. I'll probably repeat this same forum post there as well.
http://zeliepa.com/smf/index.php?board=19.0


Feel free to respond with questions, corrections, or general input.  :bananaw00t:
« Last Edit: March 10, 2010, 12:45:03 PM by peewee_RotA »
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
GOTO ROTAMODS (rocketgib)
GOTO ROTAMAPS (fireworks)
HappyFriar- q2server.fuzzylogicinc.com
 Tune in to the Tastycast!!!!  http://dna.zeliepa.net

Offline V!RaL

  • Swanky Member
  • *****
  • Posts: 804
    • View Profile
  • Rated:
Re: Getting started with the Quake 2 source
« Reply #1 on: March 10, 2010, 12:43:19 PM »
Didn't expect you to post this so quickly. My god, You wrote all of that in such a short time, Very clear and to the point, Very nice job. Thanks again  :ilysign:
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
ToRc}{[ReBorN]: i think cress is on some weird voodoo shit
[RB]FuckinSheep: this rape is beyond my expectations

Offline [BTF]Jehar

  • Swanky Member
  • *****
  • Posts: 776
  • Gee Gee or Whatnot.
    • View Profile
    • Tastyspleen.tv
  • Rated:
Re: Getting started with the Quake 2 source
« Reply #2 on: March 10, 2010, 02:22:04 PM »
Looks great man, big kudos.  :thumbsup:
Requesting a similar deal for CC. :)
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
Tastyspleen ==Tastyspleen.tv==! All Quake, All the Time

Offline QwazyWabbit

  • Carpal Tunnel Member
  • ******
  • Posts: 1357
    • View Profile
  • Rated:
Re: Getting started with the Quake 2 source
« Reply #3 on: March 10, 2010, 03:49:54 PM »
Looks like a good start. Just a note, Debug Alpha is for cross-compiling to the DEC Alpha processor and since DEC is out of business and the Alphas are very old you can forget all about using that target unless you actually own one. The Express Edition compilers won't target the Alpha (21164) CPU anyway. Just a bit of ancient history as to why that reference is there.

Also, the VS 2008 EE compiler is free but I believe there is a simple (free) registration process to access the help system.

The compiler WILL complain a lot about usage of older (deprecated) unsafe C Runtime (CRT) library functions like strcpy and _vsnprintf so don't be discouraged if you don't get a clean build the first time.
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline [BnC]MissingNo.

  • Full Member
  • ***
  • Posts: 116
  • Modder/Developer
    • View Profile
  • Rated:
Re: Getting started with the Quake 2 source
« Reply #4 on: July 15, 2010, 03:18:51 PM »
When I double click on the game.dsp file, it will load Microsoft Visual Studio 2010 Express and ask if it can convert it. Whether I say yes or no, it doesn't display anything. Just a blank screen.
It shows the toolbars and the like, but not the actual file.
It doesn't even show the Configuration drop-down bar that you're talking about.

After I install Microsoft Visual C++ 2008 Express I'll uninstall the other.
« Last Edit: July 15, 2010, 03:25:56 PM by MissingNo. »
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline QwazyWabbit

  • Carpal Tunnel Member
  • ******
  • Posts: 1357
    • View Profile
  • Rated:
Re: Getting started with the Quake 2 source
« Reply #5 on: July 15, 2010, 06:04:24 PM »
If you are on VS 2010, stay there, I see no reason to fall back to 2008.

Use the quake2.dsw file in the source root folder, not the game.dsp. The master dsw will open and convert the other projects. You should see all of them in the solution explorer pane on the left. Expand the tree view to get at the source files. IIRC, the as-shipped project from R1ch has the quake2 project as the default project, but it's been a while and that may be a change I made on my copy. My copy of the project has no source files open.

Depending on whether you properly installed zlib, libjpeg and libc you may or may not get a good build on the first try. These are separate libraries you have to install and then configure VS to use.
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline [BnC]MissingNo.

  • Full Member
  • ***
  • Posts: 116
  • Modder/Developer
    • View Profile
  • Rated:
Re: Getting started with the Quake 2 source
« Reply #6 on: July 15, 2010, 07:59:01 PM »
If you are on VS 2010, stay there, I see no reason to fall back to 2008.

Use the quake2.dsw file in the source root folder, not the game.dsp. The master dsw will open and convert the other projects. You should see all of them in the solution explorer pane on the left. Expand the tree view to get at the source files. IIRC, the as-shipped project from R1ch has the quake2 project as the default project, but it's been a while and that may be a change I made on my copy. My copy of the project has no source files open.

Depending on whether you properly installed zlib, libjpeg and libc you may or may not get a good build on the first try. These are separate libraries you have to install and then configure VS to use.

...I'll just use 2008.
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline peewee_RotA

  • Brobdingnagian Member
  • ***
  • Posts: 4152
  • Hi, I'm from the gov'ment and I'm here to help you
    • View Profile
  • Rated:
Re: Getting started with the Quake 2 source
« Reply #7 on: July 15, 2010, 09:09:49 PM »
Use the quake2.dsw file in the source root folder, not the game.dsp. The master dsw will open and convert the other projects. You should see all of them in the solution explorer pane on the left. Expand the tree view to get at the source files. IIRC, the as-shipped project from R1ch has the quake2 project as the default project, but it's been a while and that may be a change I made on my copy. My copy of the project has no source files open.

I suggest converting from the .dsp in game because it simplifies the process from getting the whole project to compile. The ref_soft won't compile in certain situations due to the assembly code in the project, and I'm pretty certain that the quake2 client requires direct sound and windows SDK libraries. It also simplifies making changes for newer coders. Almost everything in the game project is duplicated in the ctf project, which can get frustrating if you're not familiar with the IDE.

Missing No.
After you open the project, you should just see a blank parent window in the text editing pane. You'll have to use the file->open or the project explorer to open up the actual source files when making changes.
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
GOTO ROTAMODS (rocketgib)
GOTO ROTAMAPS (fireworks)
HappyFriar- q2server.fuzzylogicinc.com
 Tune in to the Tastycast!!!!  http://dna.zeliepa.net

Offline VaeVictis

  • i was -1 because you fucking suck
  • Brobdingnagian Member
  • *
  • Posts: 4498
    • View Profile
  • Rated:
Re: Getting started with the Quake 2 source
« Reply #8 on: December 02, 2010, 01:59:42 AM »
this thread needs to be found by google easier, would be pretty awesome...

SO i will include the word pussy in this post :P
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline [BTF]adam

  • Brobdingnagian Member
  • ***
  • Posts: 4047
    • View Profile
    • adam.tastyspleen.net
  • Rated:
Re: Getting started with the Quake 2 source
« Reply #9 on: December 03, 2010, 01:05:08 AM »
I will be giving this a good go at some point, thanks peewee.
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline VaeVictis

  • i was -1 because you fucking suck
  • Brobdingnagian Member
  • *
  • Posts: 4498
    • View Profile
  • Rated:
Re: Getting started with the Quake 2 source
« Reply #10 on: December 03, 2010, 03:22:36 PM »
ill have to try fucking around with this a bit when i start my c++ classes early next year :) probably go with cleancode though

EDIT: because of my previous post i had to search "site:tastyspleen.net pussy" on google lol... it returned 28 pages of results XD
« Last Edit: December 03, 2010, 03:24:44 PM by VaeVictis »
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline no_life

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
  • Rated:
Re: Getting started with the Quake 2 source
« Reply #11 on: December 05, 2010, 11:13:15 AM »
I still use visual studio c++ 6.0 enterprise edition. Works great for compiling q2 src.

Good to see others interested in the source.

Anyone doing any work with the code currently?
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
gg's

Offline no_life

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
  • Rated:
Re: Getting started with the Quake 2 source
« Reply #12 on: December 05, 2010, 11:24:43 AM »
The other day, I felt like toying around with demo recording / playback possibilities.

I created an auto recording feature that allows me to select a demo folder (in the main q2 folder instead of the baseq2 or mod folder) and automatically start recording a demo at the start of the map to whatever folder I have set in my "demodir" cvar.
It uses the same system as screenshots. It will start with "quake00.dm2", "quake01.dm2", and so on. It automatically stops the demo at the end of the map, and starts a new one on a new map.
The feature can be turned on or off by a "autorecord" cvar (variable console command).

The autoplayback feature will start playing "quake##.dm2" from whatever folder I have chosen - where the ## represents the "demonum" console cvar. It will start at quake00.dm2 by default and when the demo ends, will automatically load the next one in line. I can kick back and just let them play on order. Or I can hit the killserver bind (end the demo manually) and it will automatically play the next one. I can also, for example: type "set demonum 56" and it will start from quake56.dm2, then play quake57.dm2 next.

Some of the code involved:

//===================
//Auto demo playback
//===================
//I want to make this go by the numbers in the autodemo folder.
//The # being 2 digit #s in "quake##.dm2"
void SetDemo(void)
{
   float oldvalue;
   oldvalue = Cvar_VariableValue("demonum")+1;
Cvar_SetValue("demonum", oldvalue);
}
void AutoPlay(void)
{
   char      dm2name[80];
   int  demo;

   demo = Cvar_VariableValue("demonum");

   if(demo<10)
   strcpy(dm2name, va("demomap ../../%s/quake0%i.dm2\n", demodir->string, demo));
   if(demo>9)
   strcpy(dm2name, va("demomap ../../%s/quake%i.dm2\n", demodir->string, demo));

   if(Cvar_VariableValue("autoplay")==1)
Cbuf_AddText(dm2name);
   

}

==================

Cmd_AddCommand("autodemo", AutoPlay);

===============

/*
===============
SV_KillServer_f

Kick everyone off, possibly in preparation for a new game

===============
*/
void SV_KillServer_f (void)
{
   if (!svs.initialized)
      return;
   SV_Shutdown ("Server was killed.\n", false);
   NET_Config ( false );   // close network sockets
if(Cvar_VariableValue("autoplay")==1)
{
Cbuf_AddText("setdemo\n");
Cbuf_AddText("autodemo\n");
}
}

/*
==================
SV_BeginDemoServer
==================
*/
void SV_BeginDemoserver (void)
{
   char      name[MAX_OSPATH];

   Com_sprintf (name, sizeof(name), "demos/%s", sv.name);
   FS_FOpenFile (name, &sv.demofile);
//added to prevent loop at end of demo list. if demos are not all in numerical order,
//or there is a gap, it will end the autoplay loop.
//this code just stops the loop at the end of playing the list of demos which are in order.

if (!sv.demofile && Cvar_VariableValue("autorecord")==1)
   {
      Cvar_SetValue("autoplay", 0);
      Com_Printf("Autodemo: reached end of demos (if there is a gap in numbers, change demonum cvar manually).\n");
         return;
   }
//end corey
   if (!sv.demofile)
      Com_Error (ERR_DROP, "Couldn't open %s\n", name);
   
}

   // getting a valid frame message ends the connection process
      if (cls.state != ca_active)
      {
         cls.state = ca_active;
         cl.force_refdef = true;
         cl.predicted_origin[0] = cl.frame.playerstate.pmove.origin[0]*0.125;
         cl.predicted_origin[1] = cl.frame.playerstate.pmove.origin[1]*0.125;
         cl.predicted_origin[2] = cl.frame.playerstate.pmove.origin[2]*0.125;
         VectorCopy (cl.frame.playerstate.viewangles, cl.predicted_angles);
         if (cls.disable_servercount != cl.servercount
            && cl.refresh_prepped)
            SCR_EndLoadingPlaque ();   // get rid of loading plaque
//****************
// CODE FOR ENTERING NEW LEVEL TO BE CALLED ONCE, GOES HERE!@
//***************
            if(Cvar_VariableValue("autorecord")==1)
         Cbuf_AddText("record\n");
************************

   if (Cmd_Argc() != 2 && Cvar_VariableValue("autorecord") !=1)//added second statement here
   {
      Com_Printf ("record <demoname>\n");
      return;
   }

   if(Cvar_VariableValue("autorecord") !=1)//added to change dir/name when autorecording
   Com_sprintf (name, sizeof(name), "%s/demos/%s.dm2", FS_Gamedir(), Cmd_Argv(1));

//begin autorecord file name/saving
if(Cvar_VariableValue("autorecord")==1)
{
   // create the scrnshots directory if it doesn't exist
   //Com_sprintf (name, sizeof(name), "demos/");

   strcpy(dm2name,"quake00.dm2");
      
   for (i=0 ; i<=99 ; i++)
   {
      dm2name[5] = i/10 + '0';
      dm2name[6] = i%10 + '0';
      Com_sprintf (name, sizeof(name), "%s/%s", demodir->string, dm2name);
      //original line: Com_sprintf (name, sizeof(name), "autodemos/%s", dm2name);
      f = fopen (name, "r");
      if (!f)
         break;   // file doesn't exist
      fclose (f);
   }
   if (i==100)
   {
      Com_Printf ("Demo files exceeded 99, aborting autorecord\n");
      Cvar_SetValue("autorecord", 0);
      return;
   }
Com_Printf ("Autorecording to %s.\n", name);

}
   
      if(Cvar_VariableValue("autorecord") !=1)
   Com_Printf ("recording to %s.\n", name);
//end corey
   FS_CreatePath (name);
   cls.demofile = fopen (name, "wb");
   if (!cls.demofile)
   {
      Com_Printf ("ERROR: couldn't open.\n");
      return;
   }

/*
=================
CL_Changing_f

Just sent as a hint to the client that they should
drop to full console
=================
*/
void CL_Changing_f (void)
{
   //ZOID
   //if we are downloading, we don't change!  This so we don't suddenly stop downloading a map
   if (cls.download)
      return;

   SCR_BeginLoadingPlaque ();
   cls.state = ca_connected;   // not active anymore, but not disconnected
   Com_Printf ("\nChanging map...\n");

   if(Cvar_VariableValue("autorecord")==1)
      Cbuf_AddText("stop\n");
}
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
gg's

Offline no_life

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
  • Rated:
Re: Getting started with the Quake 2 source
« Reply #13 on: December 05, 2010, 11:28:07 AM »
I can break it down more as to what goes where, etc. If needed
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
gg's

Offline peewee_RotA

  • Brobdingnagian Member
  • ***
  • Posts: 4152
  • Hi, I'm from the gov'ment and I'm here to help you
    • View Profile
  • Rated:
Re: Getting started with the Quake 2 source
« Reply #14 on: June 26, 2011, 07:19:41 AM »
Just started trying to compile the gamex86.dll from the quake 2 3.21 source in msvc++ 2010 express and found some differences from previous versions. The biggest thing is that for some reason the old msvc5.0 project and workspace files won't convert for me.

In order to get the game to compile, you need to start a new DLL project and include all of the source files.

What you need to do to get the native C to compile in the 2010 c++ compiler is first turn off the /CLR switch. This is done in project properties->general menu. Go to the "Common Language Runtime Support" property and switch the drop down to "No Common Language Runtime Support".

The next thing to do is go to the project properties->C/C++->Precompiled Headers. Change the "Precompiled Header" setting to "Not Using Precompiled Header".

Next remove the original files that are added to the project by efault. This includes resources (.rc) and default precompiled header files from the project (usually stdafx.h).

Lastly, in order to expose the dll functions you have to use the c++ way to export a dll function. So in g_main.c find the definition for GetGameAPI and change it to

Code: [Select]
__declspec ( dllexport ) game_export_t *GetGameAPI (game_import_t *import)
{
...
Code: [Select]

Once again, these steps are for dealing with the q2 3.21 in it's original form
in msvc++2010 express. The proper way to do this would be to convert all
of the source files to .cpp, add some extern's where needed, and modify all
of the headers to take advantage of the precompied header. I'm just being
lazy.

A copy of my project is attached.

« Last Edit: June 26, 2011, 01:05:57 PM by Admin »
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
GOTO ROTAMODS (rocketgib)
GOTO ROTAMAPS (fireworks)
HappyFriar- q2server.fuzzylogicinc.com
 Tune in to the Tastycast!!!!  http://dna.zeliepa.net

 

El Box de Shoutamente

Last 10 Shouts:

 

|iR|Focalor

April 24, 2024, 10:55:53 AM
omlette du fromage?
 

Admin

April 24, 2024, 07:08:22 AM
fin.
 

|iR|Focalor

April 22, 2024, 04:27:07 PM
Now it's over. Because I say it's over.
 

|iR|Focalor

April 22, 2024, 12:39:29 PM
It's over when I say it's over.

 

|iR|Focalor

April 22, 2024, 11:34:16 AM
Costigan needs a tampon.
 

Costigan_Q2

April 22, 2024, 02:53:12 AM
This interaction is over.
 

Costigan_Q2

April 22, 2024, 02:51:20 AM
Will someone please muzzle and leash that barking dog? it's projections and delusions and now endless babbling are comically pitiable, just treat it like you would Beaver - that's what it deserves.
 

Costigan_Q2

April 22, 2024, 02:50:50 AM
Quake 2 needs a public square.

This is not a debate.
 

|iR|Focalor

April 21, 2024, 05:36:24 PM
If you were attached to reality, you'd realize that.

Quake 2 needs a private bathroom.
 

|iR|Focalor

April 21, 2024, 05:34:35 PM
I've never doxed anyone like he did or sent them 1000's of annoying whiny angry messages in all caps like you.

Show 50 latest
Welcome, Guest. Please login or register.
April 25, 2024, 07:22:19 AM

Login with username, password and session length