Making and Applying TGE Patches
by Britton LaRoche · 08/17/2004 (10:08 am) · 32 comments
Q. What is a patch?
A. A patch is a cvs diff file.
Q. What is cvs?
A. CVS is an opensource version control software. It stands for "Concurrent Version System." You have to use it to get the TGE source code.
Instructions on using cvs to get the TGE source
CVS FAQ
Q. What is a diff file?
A. A diff file is what cvs generates to determine the differences between your local modifications and what is in the CVS version control.
Q. So what is a patch again?
A. A patch is:
1. the ability to take the differences between what is in CVS and the modified files, ... and...
2. to apply those differences to a clean copy of the CVS head.
Making a patch ...
We used the torque/engine directory as the root dir... but you are supposed to use the torque dir when making a patch. So all you do is cd to the Torque directory and type:
And thats it. Each of those flags has a different meaning. You can look up the meaning of each one by reading the cvs documentation.
Applying patches:
Applying patches usually means running the patch.exe file with the paramater of the diff file name. The patch.exe will make the changes listed in the diff to the local source files. For example if you wanted to apply the beaver patrol patrol patch you would go to the root directory and do something like:
The root directory is the top directory in the cvs structure. The standard is make and apply patches here. For the TGE that directory is torque.
Practice Example:
Want some practice? Get the Beaver Patrol 1.3 Alpha application. Everything you need including patch.exe is under the
Beaver Patrol/TGEPatch directory
Beaver Patrol 1.3 Alpha
The comments below show in detail how to apply the patch, copy the necessary files, modify a MSVC project and link the external libraries.
A. A patch is a cvs diff file.
Q. What is cvs?
A. CVS is an opensource version control software. It stands for "Concurrent Version System." You have to use it to get the TGE source code.
Instructions on using cvs to get the TGE source
CVS FAQ
Q. What is a diff file?
A. A diff file is what cvs generates to determine the differences between your local modifications and what is in the CVS version control.
Q. So what is a patch again?
A. A patch is:
1. the ability to take the differences between what is in CVS and the modified files, ... and...
2. to apply those differences to a clean copy of the CVS head.
Making a patch ...
We used the torque/engine directory as the root dir... but you are supposed to use the torque dir when making a patch. So all you do is cd to the Torque directory and type:
cvs -f diff -u -F^f -N > beavers1_3.diff
And thats it. Each of those flags has a different meaning. You can look up the meaning of each one by reading the cvs documentation.
Applying patches:
Applying patches usually means running the patch.exe file with the paramater of the diff file name. The patch.exe will make the changes listed in the diff to the local source files. For example if you wanted to apply the beaver patrol patrol patch you would go to the root directory and do something like:
patch.exe -p1 < beaver_engine_patch_1_3.diff
The root directory is the top directory in the cvs structure. The standard is make and apply patches here. For the TGE that directory is torque.
Practice Example:
Want some practice? Get the Beaver Patrol 1.3 Alpha application. Everything you need including patch.exe is under the
Beaver Patrol/TGEPatch directory
Beaver Patrol 1.3 Alpha
The comments below show in detail how to apply the patch, copy the necessary files, modify a MSVC project and link the external libraries.
#2
c:/torque/engine
where the standard is
c:/torque
We should have used the tagged 1.2.2 release we used the August 9th version of the head instead.
Should get you what we were working against.
To patch with the beaver patrol patch.
1. Get a clean copy of the TGE 1.2.2 Head.
2. copy the patch.exe, and beaver_engine_patch_1_3.diff file to
c:\toque\engine
3. open a command prompt and cd to
c:\torque\engine
and run
patch.exe -p1 < beaver_engine_patch_1_3.diff
08/17/2004 (10:20 am)
Just an FYI, the beaver TGE patch uses c:/torque/engine
where the standard is
c:/torque
We should have used the tagged 1.2.2 release we used the August 9th version of the head instead.
cvs -z3 update -d -P -D "09 Aug 2004" engine CVSROOT=:pserver:userid@cvs.garagegames.com:/cvs/torque
Should get you what we were working against.
To patch with the beaver patrol patch.
1. Get a clean copy of the TGE 1.2.2 Head.
2. copy the patch.exe, and beaver_engine_patch_1_3.diff file to
c:\toque\engine
3. open a command prompt and cd to
c:\torque\engine
and run
patch.exe -p1 < beaver_engine_patch_1_3.diff
#3
{first edit]
Ok the first thing that would be unclear is the
"open a command prompt and cd to
c:\torque\engine
" part.
That should say open a command prompt and cd to
c:\torque\engine ,,,, and type cd c:/torque/engine. that make the new line "C:\torque\engine>" that tells me im in the torque/engine root, right?
[second edit]
i copy the line "patch.exe -p1 < beaver_engine_patch_1_3.diff"
right after the arrow of the new line C:\torque\engine>, hit enter and the dos box prints so many lines so fast you cant read them, so i should be patched now right? now recompile?
Im answering my self in case you are wondering but correctme if im rong
08/17/2004 (11:08 am)
ok, im going to go get the torque head, and try to patch beaver patrol again, i really need to know how they work.{first edit]
Ok the first thing that would be unclear is the
"open a command prompt and cd to
c:\torque\engine
" part.
That should say open a command prompt and cd to
c:\torque\engine ,,,, and type cd c:/torque/engine. that make the new line "C:\torque\engine>" that tells me im in the torque/engine root, right?
[second edit]
i copy the line "patch.exe -p1 < beaver_engine_patch_1_3.diff"
right after the arrow of the new line C:\torque\engine>, hit enter and the dos box prints so many lines so fast you cant read them, so i should be patched now right? now recompile?
Im answering my self in case you are wondering but correctme if im rong
#4
There is also a readme with the full instructions... you need to copy some source files too:
The add beaver.bat file simply calls the patch.exe with the diff file name
08/17/2004 (12:21 pm)
Very cool, yes for the beaver patch you cd to Torque/engine...There is also a readme with the full instructions... you need to copy some source files too:
NOTE: The patch was made using the engine directory as the root dir for the patch. These instructions assume you have checked out a clean copy of the lastest TGE Source Release_1_2_2 http://www.garagegames.com/docs/torque/general/ch02.php 1. copy the contents of the BeaverPatrol/TGEPatch directory to the torque/engine source directory 2. cd to the torque/engine directory 3. Unzip the bp013_SourceFiles.zip to the torque source directory... it contains the engine directory structure in the zip 4. double click the addBeaver.bat file... this should apply the patch. 5. Add the files in the bp013_SourceFiles.zip to your project or make file. 6. Compile.
The add beaver.bat file simply calls the patch.exe with the diff file name
#5
08/17/2004 (12:28 pm)
But, yes what you did above should have applied the patch
#6
08/17/2004 (12:39 pm)
right, i did move your new skd file to my engine just as the are in the download, but i get some errors i dont understand on a compile:Compiling... aiClient.cc beam.cc C:\torque\engine\game\beam.cc(62) : error C2065: 'TypeBeamDataPtr' : undeclared identifier ODEItem.cc ../engine\game/ODEWorld.h(8) : fatal error C1083: Cannot open include file: 'ode/ode.h': No such file or directory ODEWorld.cc C:\torque\engine\game\ODEWorld.h(8) : fatal error C1083: Cannot open include file: 'ode/ode.h': No such file or directory turret.cc C:\torque\engine\game\turrets\turret.cc(18) : error C2065: 'TurretObjectType' : undeclared identifier spaceVehicle.cc C:\torque\engine\game\vehicles\spaceVehicle.cc(300) : error C2039: 'getServerTargetSet' : is not a member of 'Sim' C:\torque\engine\game\vehicles\spaceVehicle.cc(300) : error C2065: 'getServerTargetSet' : undeclared identifier C:\torque\engine\game\vehicles\spaceVehicle.cc(300) : error C2227: left of '->addObject' must point to class/struct/union C:\torque\engine\game\vehicles\spaceVehicle.cc(301) : error C2039: 'getClientTargetSet' : is not a member of 'Sim' C:\torque\engine\game\vehicles\spaceVehicle.cc(301) : error C2065: 'getClientTargetSet' : undeclared identifier C:\torque\engine\game\vehicles\spaceVehicle.cc(301) : error C2227: left of '->addObject' must point to class/struct/union Error executing cl.exe.
#7
edit]
i didnt see any include files , does the ode* files go in the game folder, they are there.
{edit again]
does it matter that the ode files in the download look like ODE?
(it shouldnt)
Im running win xp and vc 6.0
08/17/2004 (12:40 pm)
any ideas where i went rong?edit]
i didnt see any include files , does the ode* files go in the game folder, they are there.
{edit again]
does it matter that the ode files in the download look like ODE?
(it shouldnt)
Im running win xp and vc 6.0
#8
Thanks
08/17/2004 (12:55 pm)
heh i should of known, im to damn dumb to do things the easy way, youve got some good examples in bp, i want to get in my single player examples build, ill just doit the hard way, keep up the good work.Thanks
#9
../engine\game/ODEWorld.h(8) : fatal error C1083: Cannot open include file:
08/17/2004 (1:07 pm)
[quote]../engine\game/ODEWorld.h(8) : fatal error C1083: Cannot open include file:
#10
cleverace.home.comcast.net/project.jpg
double checked. thats why im confuzed. i think
[edit you have to expand the jpg to largest to read it /edit]
08/17/2004 (1:28 pm)
yes all of the new sdk files were added to the projectcleverace.home.comcast.net/project.jpg
double checked. thats why im confuzed. i think
[edit you have to expand the jpg to largest to read it /edit]
#11
08/17/2004 (1:40 pm)
Ahhh yes!! Silly me. I think I forgot to inlcude the base ode files!! Doh! Let me check!
#12
08/17/2004 (1:45 pm)
Yep... you need the ode lib files.... btw you have to find a version for mac and linux if (anyone else) is using that. Uploading the files and posting a link... adding in to the Beaver Patrol zip file too.
#13
08/17/2004 (2:00 pm)
heh, cool, and very understandable, its a big project.
#14
Get the ode libraries here
Then extract the ODE.zip file to
c:\torque\lib\ode
Next you need to link the ode libraries...
right click torquedemo -> project/properties...
08/17/2004 (2:02 pm)
You need to make a new ode directory. \torque\lib\odeGet the ode libraries here
Then extract the ODE.zip file to
c:\torque\lib\ode
Next you need to link the ode libraries...
right click torquedemo -> project/properties...
#15
08/17/2004 (2:02 pm)
Seems to me the make file for linking libraries is easier ;)
#16
you lost me on the linker stuff, or now im to tired , ill continue tomarrow
thanks
08/17/2004 (8:53 pm)
Lost my cable connection for a while there,you lost me on the linker stuff, or now im to tired , ill continue tomarrow
thanks
#17
../lib/ode/ode.lib
and that should do it. They had to link in the external libraries for Ogg / Vorbis and we are basically doing the same thing when we link in ode.lib
08/17/2004 (9:44 pm)
Ace, yeah its a bit confusing. Not sure what IDE or version you are running, but find where ever they added the "../lib/vorbis... lib" stuff and add../lib/ode/ode.lib
and that should do it. They had to link in the external libraries for Ogg / Vorbis and we are basically doing the same thing when we link in ode.lib
#18
I wonder if this should be done in the project lib setting instead?
thats where i ended up getting vorbis to work.
Ill check it out after work. I got off work at 10am yesturday, may not be so lucky to day.
Just reading my morning paper. (the torque forums)
08/18/2004 (5:13 am)
oh yea ive done that before too (and found the thread) www.garagegames.com/mg/forums/result.thread.php?qt=8204I wonder if this should be done in the project lib setting instead?
thats where i ended up getting vorbis to work.
Ill check it out after work. I got off work at 10am yesturday, may not be so lucky to day.
Just reading my morning paper. (the torque forums)
#19
08/21/2004 (7:44 pm)
Ace, let me know if it worked for you or if you have any more issues. I'm glad you posyed or I would not have realized I didn't inlcude the ode.lib file
#20
From a mechanic to an officeboy,.
i was still at figgureing out the linker stuff, and now have to varify the "head" was actually patched.
i still get the same errors

08/22/2004 (4:16 am)
ok, i havent got back to this yet, i just left a job friday and starting a new one monday.From a mechanic to an officeboy,.
i was still at figgureing out the linker stuff, and now have to varify the "head" was actually patched.
i still get the same errors

|RCS file: /cvs/torque/torque/engine/game/shapeBase.cc,v |retrieving revision 2.2 |diff -u -Ff -r2.2 shapeBase.cc |--- game/shapeBase.cc 2004/07/14 22:28:50 2.2 |+++ game/shapeBase.cc 2004/08/08 21:34:47 -------------------------- File to patch: Skip this patch? [y] Skipping patch. 37 out of 37 hunks ignored can't find file to patch at input line 7023 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |Index: game/shapeBase.h |=================================================================== |RCS file: /cvs/torque/torque/engine/game/shapeBase.h,v |retrieving revision 2.1 |diff -u -Ff -r2.1 shapeBase.h |--- game/shapeBase.h 2004/04/21 04:27:31 2.1 |+++ game/shapeBase.h 2004/08/08 21:34:48 -------------------------- File to patch: Skip this patch? [y] Skipping patch. 28 out of 28 hunks ignored can't find file to patch at input line 7505 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |Index: game/shapeImage.cc |=================================================================== |RCS file: /cvs/torque/torque/engine/game/shapeImage.cc,v |retrieving revision 2.1 |diff -u -Ff -r2.1 shapeImage.cc |--- game/shapeImage.cc 2004/04/21 04:27:31 2.1 |+++ game/shapeImage.cc 2004/08/08 21:34:50 -------------------------- File to patch: Skip this patch? [y] Skipping patch. 18 out of 18 hunks ignored can't find file to patch at input line 7908 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |Index: game/trigger.cc |=================================================================== |RCS file: /cvs/torque/torque/engine/game/trigger.cc,v |retrieving revision 2.1 |diff -u -Ff -r2.1 trigger.cc |--- game/trigger.cc 2004/04/21 04:27:31 2.1 |+++ game/trigger.cc 2004/08/08 21:34:52 -------------------------- File to patch: Skip this patch? [y] Skipping patch. 4 out of 4 hunks ignored can't find file to patch at input line 7976 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |Index: game/trigger.h |=================================================================== |RCS file: /cvs/torque/torque/engine/game/trigger.h,v |retrieving revision 2.1 |diff -u -Ff -r2.1 trigger.h |--- game/trigger.h 2004/04/21 04:27:31 2.1 |+++ game/trigger.h 2004/08/08 21:34:52 -------------------------- File to patch: Skip this patch? [y] Skipping patch. 2 out of 2 hunks ignored can't find file to patch at input line 8005 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |Index: game/fps/guiShapeNameHud.cc |=================================================================== |RCS file: /cvs/torque/torque/engine/game/fps/guiShapeNameHud.cc,v |retrieving revision 2.2 |diff -u -Ff -r2.2 guiShapeNameHud.cc |--- game/fps/guiShapeNameHud.cc 2004/07/06 17:07:14 2.2 |+++ game/fps/guiShapeNameHud.cc 2004/08/08 21:34:52 -------------------------- File to patch: Skip this patch? [y] Skipping patch. 4 out of 4 hunks ignored can't find file to patch at input line 8098 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |Index: game/vehicles/flyingVehicle.cc |=================================================================== |RCS file: /cvs/torque/torque/engine/game/vehicles/flyingVehicle.cc,v |retrieving revision 2.1 |diff -u -Ff -r2.1 flyingVehicle.cc |--- game/vehicles/flyingVehicle.cc 2004/04/21 04:27:31 2.1 |+++ game/vehicles/flyingVehicle.cc 2004/08/08 21:35:03 -------------------------- File to patch: Skip this patch? [y] Skipping patch. 1 out of 1 hunk ignored can't find file to patch at input line 8115 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |Index: game/vehicles/hoverVehicle.cc |=================================================================== |RCS file: /cvs/torque/torque/engine/game/vehicles/hoverVehicle.cc,v |retrieving revision 2.1 |diff -u -Ff -r2.1 hoverVehicle.cc |--- game/vehicles/hoverVehicle.cc 2004/04/21 04:27:31 2.1 |+++ game/vehicles/hoverVehicle.cc 2004/08/08 21:35:03 -------------------------- File to patch: Skip this patch? [y] Skipping patch. 1 out of 1 hunk ignored can't find file to patch at input line 8132 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |Index: game/vehicles/wheeledVehicle.cc |=================================================================== |RCS file: /cvs/torque/torque/engine/game/vehicles/wheeledVehicle.cc,v |retrieving revision 2.1 |diff -u -Ff -r2.1 wheeledVehicle.cc |--- game/vehicles/wheeledVehicle.cc 2004/04/21 04:27:31 2.1 |+++ game/vehicles/wheeledVehicle.cc 2004/08/08 21:35:05 -------------------------- File to patch: Skip this patch? [y] Skipping patch. 2 out of 2 hunks ignored can't find file to patch at input line 8167 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |Index: gui/guiCanvas.cc |=================================================================== |RCS file: /cvs/torque/torque/engine/gui/guiCanvas.cc,v |retrieving revision 2.1 |diff -u -Ff -r2.1 guiCanvas.cc |--- gui/guiCanvas.cc 2004/04/21 04:27:32 2.1 |+++ gui/guiCanvas.cc 2004/08/08 21:35:07 -------------------------- File to patch: Skip this patch? [y] Skipping patch. 3 out of 3 hunks ignored can't find file to patch at input line 8206 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |Index: gui/guiTypes.cc |=================================================================== |RCS file: /cvs/torque/torque/engine/gui/guiTypes.cc,v |retrieving revision 2.1 |diff -u -Ff -r2.1 guiTypes.cc |--- gui/guiTypes.cc 2004/04/21 04:27:32 2.1 |+++ gui/guiTypes.cc 2004/08/08 21:35:16 -------------------------- File to patch: Skip this patch? [y] Skipping patch. 4 out of 4 hunks ignored can't find file to patch at input line 8299 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |Index: gui/guiTypes.h |=================================================================== |RCS file: /cvs/torque/torque/engine/gui/guiTypes.h,v |retrieving revision 2.1 |diff -u -Ff -r2.1 guiTypes.h |--- gui/guiTypes.h 2004/04/21 04:27:32 2.1 |+++ gui/guiTypes.h 2004/08/08 21:35:16 -------------------------- File to patch: Skip this patch? [y] Skipping patch. 2 out of 2 hunks ignored can't find file to patch at input line 8332 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |Index: interior/interiorInstance.h |=================================================================== |RCS file: /cvs/torque/torque/engine/interior/interiorInstance.h,v |retrieving revision 2.1 |diff -u -Ff -r2.1 interiorInstance.h |--- interior/interiorInstance.h 2004/04/21 04:27:32 2.1 |+++ interior/interiorInstance.h 2004/08/08 21:35:22 -------------------------- File to patch: Skip this patch? [y] Skipping patch. 1 out of 1 hunk ignored can't find file to patch at input line 8348 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |Index: interior/interiorRender.cc |=================================================================== |RCS file: /cvs/torque/torque/engine/interior/interiorRender.cc,v |retrieving revision 2.1 |diff -u -Ff -r2.1 interiorRender.cc |--- interior/interiorRender.cc 2004/04/21 04:27:32 2.1 |+++ interior/interiorRender.cc 2004/08/08 21:35:24 -------------------------- File to patch: Skip this patch? [y] Skipping patch. 17 out of 17 hunks ignored can't find file to patch at input line 8642 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |Index: sceneGraph/sceneGraph.h |=================================================================== |RCS file: /cvs/torque/torque/engine/sceneGraph/sceneGraph.h,v |retrieving revision 2.1 |diff -u -Ff -r2.1 sceneGraph.h |--- sceneGraph/sceneGraph.h 2004/04/21 04:27:33 2.1 |+++ sceneGraph/sceneGraph.h 2004/08/08 21:35:58 -------------------------- File to patch: Skip this patch? [y] Skipping patch. 3 out of 3 hunks ignored can't find file to patch at input line 8674 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |Index: sceneGraph/sceneTraversal.cc |=================================================================== |RCS file: /cvs/torque/torque/engine/sceneGraph/sceneTraversal.cc,v |retrieving revision 2.1 |diff -u -Ff -r2.1 sceneTraversal.cc |--- sceneGraph/sceneTraversal.cc 2004/04/21 04:27:33 2.1 |+++ sceneGraph/sceneTraversal.cc 2004/08/08 21:36:01 -------------------------- File to patch: Skip this patch? [y] Skipping patch. 3 out of 3 hunks ignored can't find file to patch at input line 8859 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |Index: sceneGraph/shadowVolumeBSP.h |=================================================================== |RCS file: /cvs/torque/torque/engine/sceneGraph/shadowVolumeBSP.h,v |retrieving revision 2.1 |diff -u -Ff -r2.1 shadowVolumeBSP.h |--- sceneGraph/shadowVolumeBSP.h 2004/04/21 04:27:33 2.1 |+++ sceneGraph/shadowVolumeBSP.h 2004/08/08 21:36:01 -------------------------- File to patch: Skip this patch? [y] Skipping patch. 1 out of 1 hunk ignored can't find file to patch at input line 8875 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |Index: sim/sceneObject.cc |=================================================================== |RCS file: /cvs/torque/torque/engine/sim/sceneObject.cc,v |retrieving revision 2.1 |diff -u -Ff -r2.1 sceneObject.cc |--- sim/sceneObject.cc 2004/04/21 04:27:33 2.1 |+++ sim/sceneObject.cc 2004/08/08 21:36:07 -------------------------- File to patch: Skip this patch? [y] Skipping patch. 3 out of 3 hunks ignored can't find file to patch at input line 8910 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |Index: sim/sceneObject.h |=================================================================== |RCS file: /cvs/torque/torque/engine/sim/sceneObject.h,v |retrieving revision 2.1 |diff -u -Ff -r2.1 sceneObject.h |--- sim/sceneObject.h 2004/04/21 04:27:33 2.1 |+++ sim/sceneObject.h 2004/08/08 21:36:08 -------------------------- File to patch: Skip this patch? [y] Skipping patch. 2 out of 2 hunks ignored C:\torque\engine>
Torque Owner Britton LaRoche