CSK to TGE 1.5.2 Code Conversions...
by CSMP · in Combat Starter Kit · 03/14/2009 (5:22 pm) · 13 replies
Since there has been little to no support from DGInc. with this "kit" I am officially not using the CSK project anymore to create my game, however I am trying to remove needed code sections and reimplement into TGE1.5.2.
1. Vehicle Engine Transmission, I've tried many times to get this converted, but it seems the code is so intertwined within the Movement code and MP_updateForces1.
DGI: why was there a second UpdateForces created and what is the reason for it?
I encourage everyone to post up there own Conversion problems as I know I am not the only person that would like the CSK code in base "supported" TGE1.5.2.
F.Y.I. if converting from CSK to TGE remember to take the optionsDlg changes with you, as they are some of the best (optimization) features in the kit.
1. Vehicle Engine Transmission, I've tried many times to get this converted, but it seems the code is so intertwined within the Movement code and MP_updateForces1.
DGI: why was there a second UpdateForces created and what is the reason for it?
I encourage everyone to post up there own Conversion problems as I know I am not the only person that would like the CSK code in base "supported" TGE1.5.2.
F.Y.I. if converting from CSK to TGE remember to take the optionsDlg changes with you, as they are some of the best (optimization) features in the kit.
#2
The reason why i cant get the transmission code is because of the changes applied in the ProcessTick and UpdateForces functions, I'm just not sure whats going on in there and why it was modified.
I've gotten it in before, but when i tried to move the vehicle it did not respond, this would make sense because of the engine on/off code added, but even knowing that the changes are a little overwhelming.
btw: Trying to get all of the Vehicle Trans, Engine, GUI, Explosions and Sounds code converted, but Trans and Engine are my problems.
03/15/2009 (2:02 am)
I have done a Diff on every file in the csk, I even have a thread that notes every file changed (even if it was just an extra space).The reason why i cant get the transmission code is because of the changes applied in the ProcessTick and UpdateForces functions, I'm just not sure whats going on in there and why it was modified.
I've gotten it in before, but when i tried to move the vehicle it did not respond, this would make sense because of the engine on/off code added, but even knowing that the changes are a little overwhelming.
btw: Trying to get all of the Vehicle Trans, Engine, GUI, Explosions and Sounds code converted, but Trans and Engine are my problems.
#3
/** Duncan - This section has been split off from the main physics section so that (in the future)
it can be parallel processed with openMP (see openmp.org) or similar methods.
Also the method can now easily be overidden in derived classes which may want different
wheel behaviour
*/
So I imagine that explains it! I'll see if I can help decode the changes made in processtick and advanceforces in a sec.
03/24/2009 (6:53 am)
The comment right above the MP1 version says this:/** Duncan - This section has been split off from the main physics section so that (in the future)
it can be parallel processed with openMP (see openmp.org) or similar methods.
Also the method can now easily be overidden in derived classes which may want different
wheel behaviour
*/
So I imagine that explains it! I'll see if I can help decode the changes made in processtick and advanceforces in a sec.
#4
line 720:
setEngineState((bool)getMountNodeObject(0));
This sets the engine on if something is mounted to node 0, off if not.
line 730-737
Lines 750-760
These lines are optimizations to only look for collisions or update our position if we are moving or the engine is on, otherwise we check to see if maybe someone is just in the turret and is moving it around, in which case we flag the positionmask so the change gets networked.
03/24/2009 (7:14 am)
Looking at the processTick function in vehicle.cc:line 720:
setEngineState((bool)getMountNodeObject(0));
This sets the engine on if something is mounted to node 0, off if not.
line 730-737
Point3F curPos;
getTransform().getColumn(3, &curPos);
F32 motion = mFabs((curPos - lastTickPosition).len());
if((motion > 0.05)|| inAir || allowImpulse)
vehicleInMotion = true;
else
vehicleInMotion = false;
lastTickPosition = curPos;
[\code]
These lines figure out if the vehicle has gone far enough since the last tick to declare it as being 'in motion'
Lines 740-746
[code]
if(allowImpulse)
tickCounter++;
if(tickCounter >50)
{
tickCounter = 0;
allowImpulse = false;
}These lines shut off the allowImpulse boolean after 50 ticks to prevent the impulse state from going on too long.Lines 750-760
if (IsEngineOn() || vehicleInMotion)
{
setMaskBits(PositionMask);
updateWorkingCollisionSet(getCollisionMask());
S32 count = mDataBlock->integration;
for (U32 i = 0; i < count; i++)
updatePos(TickSec / count);
}
else
if(turretHasMoved)
setMaskBits(PositionMask);These lines are optimizations to only look for collisions or update our position if we are moving or the engine is on, otherwise we check to see if maybe someone is just in the turret and is moving it around, in which case we flag the positionmask so the change gets networked.
#5
The other changes I see are to calculate average engine speed (used for the transmission sound etc)
Also for steering return to center and dampen steering based on speed.
The sections for wheel speed/transmission are already clearly labelled in the code, all in all this code is very well commented and clear!
I wasn't involved in this implementation at all, but I can follow it clearly. It's broken up so yes you would need to either reassemble the two functions into one function or keep the two functions. It's not a winmergable change.
03/24/2009 (7:24 am)
As for updateForces, it looks like it was just broken up into two sections. Specifically, the spring and wheel forces were broken out into MP_updateForces1.The other changes I see are to calculate average engine speed (used for the transmission sound etc)
Also for steering return to center and dampen steering based on speed.
The sections for wheel speed/transmission are already clearly labelled in the code, all in all this code is very well commented and clear!
I wasn't involved in this implementation at all, but I can follow it clearly. It's broken up so yes you would need to either reassemble the two functions into one function or keep the two functions. It's not a winmergable change.
#6
I'll give it another look soon as I still would like the engine/transmission/veh. sounds from the CSK back into TGE1.5.2.
03/27/2009 (5:26 pm)
Ok, thats the main thing i was having a problem with was trying to get WinMerge to make it work, but for the reason stated and inexperience in c++ it was just running me into a circle of bugs.I'll give it another look soon as I still would like the engine/transmission/veh. sounds from the CSK back into TGE1.5.2.
#7
03/27/2009 (7:18 pm)
Ok, hate to sound idiotic here, but what exactly is this accomplishing ? Was'nt the CSK done in TGE 1.52 ?
#8
03/28/2009 (12:05 am)
Yes it was. I think I mentioned that somewhere.
#9
03/28/2009 (1:54 am)
I do not plan on using the CSK for my finished product and Dave is helping me with a couple problems I've been having converting back into TGE1.5.2.
#10
03/28/2009 (11:53 pm)
I think the goal is to get specific features from the CSK into 1.5.2, but remove some of the undesirable ones. Otherwise, you could just reinstall 1.5.2.
#11
03/29/2009 (7:45 am)
Please present any problems and solutions in the forum; so it can be of help to everyone. There are alot of unanswers questions.
#12
@Fred, thats the plan as i think some of us may have a better time just using the certain features.
BTW: simply add in ZipCryptStream.h,ZipCryptStream.cc and crctab.h into your (engine\core\) of a Stock/Custom TGE1.5.2 project and WinMerge/Replace (engine\core\resManager.cc) and recompile for the CSK Zip Password Encryption in TGE1.5.2.
@Dave: Still havnt gotten back to the vehicles code yet as im trying to get as much out of the way as possible before returning to the vehicles, hopefully I will be back in that area pretty soon.
03/31/2009 (12:34 pm)
@Daniel, worded a little better but yup.@Fred, thats the plan as i think some of us may have a better time just using the certain features.
BTW: simply add in ZipCryptStream.h,ZipCryptStream.cc and crctab.h into your (engine\core\) of a Stock/Custom TGE1.5.2 project and WinMerge/Replace (engine\core\resManager.cc) and recompile for the CSK Zip Password Encryption in TGE1.5.2.
@Dave: Still havnt gotten back to the vehicles code yet as im trying to get as much out of the way as possible before returning to the vehicles, hopefully I will be back in that area pretty soon.
#13
04/01/2009 (6:38 pm)
I would like just like the vehicle code, teams, and the C&H style stuff
Torque Owner Brad Kelley
Did you try doing a dif between the stock vehicle code and the CK version? That should be a good place to start.
I don't know off hand why there is a second UpdateForces. I will look into it asap.