Combat Starter Kit code changes explained
by Duncan Gray · 09/03/2008 (7:02 pm) · 18 comments
I was not part of the CSK team from the beginning but I was lead developer on this kit for several weeks (full time - remote) amounting to about two hundred hours of C++ development before I departed from the team with all required coded changes completed . Several poorly informed people have made comments that this is just a bunch of resources thrown together to play nice etc. Well two hundred hours of C++ development time says otherwise.
Here follows a detailed explanation of what development I did for the kit. Hopefully it will help set the record straight..
About four years ago I made a cross country racing game using TGE and solved many of the inherent problems associated with TGE vehicles, including many collision improvements. All of those fixes and enhancements have been put into this kit. My own gearbox and engine rev changes are in here as well. Other people have since released resources to do similar but anyone who played my racing game will know that my version preceeds any of those resources by years. All these code changes amount to well over a hundred hours of debugging and development time which is above and beyond the 200 hours I mentioned before.
The tank was a huge headache to solve, The previous developers had tried to attach a mountable turret and have the driver control both the vehicle and the turret. But that led to huge lag problems and very jerky turret movement over the network, It took many hours of debugging to find what the source of the problem was and solve it permanently. It also required writing NEW turret movement code as part of the vehicle class. I chose to let the engine calculate the barrel and turret position rather than expect the artist to animate the movement over some rotational range. To use the tank you just mount a turret and a barrel, the source code will animate the movement for you. Likewise, the track animation can be a headache and traditional solutions require the artists to animate the track via UV animations. I dispensed with that by having the game engine animate the tank track texture for you based on vehicle ground speed. The artists just has to UV map a texture for the track and name it according to the naming convention. The game engine takes care of the rest. This makes it possible to make game content 'tanks' using 3D tools like Blender and Milkshape, neither of which could export UV animations at the time the kit was made.
I coded the commander map from scratch based on an initial idea I got from some terrain camera code written by Ben Garney. My commander map let's you pan and zoom across the map using your mouse (click and drag) or mouse wheel for zoom. Unfortunately most people are unaware of this feature because the map is initially zoomed out to maximum and people think that's all there is to it. It's very useful when you want to drop supplies to you troops in the field. You can pan across to their position, zoom in, then drop the supplies within a few meters of their location. The troops will see the supplies falling out the sky on parachutes. Really cool. The commander map also uses icons to display tanks, vehicles etc. This makes it possible for you to change them to suit your own game just by replacing the icon pictures. Another unknown feature is that the commander map lets the camera swoop down from the sky and attach to the player as he spawns, making a seamless transition from commander map to player control. This feature can be turned on via a setting in the commander map datablock.
The player climbing a ladder is also original code. There was a need for the player to climb a 90 degree ladder and it took many hours of delving through the player class to achieve a smooth, seamless transition from walking up to a ladder, climbing it and getting off at the top, ready for action.
I also developed code for parachutes which let players gently glide down to the ground with some slight forward thrust. There were many, many other fixes and enhancements to the player class, too numerous to remember. A new collision system was developed which uses the weapon tip as a collision point rather than have the weapon slide backwards when it encounters an obstacle. By default this is off but can be enabled by a setting in the player datablock.
Advanced camera work: This has nothing to do with the advanced camera resource. I had tried that resource back when I made my racing game and found it to be buggy and it even ceased to function when the camera left the initial terrain tile. So I developed my own camera code to do smoothing and neat 3rd person enhancements. A game camera is really important and should give you the view you want without intruding on the game. You don't want to draw attention to the camera, if you do then you have just taken attention away from the game. Test drive the 3rd person vehicle camera in starter.racing (default TGE camera) then test drive the vehicles in CSK in 3rd person and see the difference. I also modified the 1st person weapon camera to keep it upright even when the vehicle is bucking over bumpy terrain. Unfortunately most people don't notice the advanced camera work in CSK, because, you are not supposed to notice it.
The "capture the flag" code was initially a resource that someone had put in to CSK but it was very buggy and I was asked to take a look at it. Once I figured out what it was trying to do, I rewrote it from the ground up and handed it back to the scriptor (Kittle) who polished it to perfection. I also developed C++ code to efficiently send the flag position across the network to all clients. The artist now animates the flag with two frames, fully up and fully down. The script then sets the flag position between 0 and 1 and this value is networked to all clients so that they all see the flag at the same position on the pole.
When I took over development for CSK, the crawl,swim resource was already in place as was some helicopter code. The crawl, swim resource had a major bug in that it did not handle the player collision box correctly. TGE player code does not rotate the player collision box by default because keeping the box orientated per the game axis system allows for a less CPU intensive collision algorithm to be used. I spent many hows debugging the system to find where the changes need to be made to get the player collision box rotated in the direction the player is facing.
The helicopter code had very unrealistic physics and I was asked to polish that which I did and the result is much more believable and I also incorporated damage effects. The more damage the helicopter takes, the harder it is to fly.
There were may other small enhancements done, such as being able to mount an object with an offset. This is good news for artists because sometimes a mount node is in the wrong place and moving it can play havoc with animations. Being able to keep the node where it was but just specify and offset position for the mounted object saves the day.
TGE bug fixes. Many old time TGE bugs were fixed. The player weapon would sometimes vanish if you aimed it out side of the players bounds box. People used to "fix" this bug by making the players bounds box bigger, but this also makes the player collision box bigger. I spent many hours debugging this problem and got it fixed proper, at the source where the problem occurs. Also one of the C++ classes did not have the necessary network code for updating mounted object positions. Noticeable when you drove a vehicle away and parts of it remained where you had spawned it. Fixed in CSK but both these bugs still exist in stock TGE 1.52
I know there is much more that was developed for this kit but the above are the stand out features which come to mind.
I have only referred to the C++ changes but a ton of scripting work was also done, some by me but mostly by Kittle and I'm sure the scripting also adds up to over a hundred hours of work done.
I doubt there is any other TGE kit available that has so many man hours behind it.
Here follows a detailed explanation of what development I did for the kit. Hopefully it will help set the record straight..
About four years ago I made a cross country racing game using TGE and solved many of the inherent problems associated with TGE vehicles, including many collision improvements. All of those fixes and enhancements have been put into this kit. My own gearbox and engine rev changes are in here as well. Other people have since released resources to do similar but anyone who played my racing game will know that my version preceeds any of those resources by years. All these code changes amount to well over a hundred hours of debugging and development time which is above and beyond the 200 hours I mentioned before.
The tank was a huge headache to solve, The previous developers had tried to attach a mountable turret and have the driver control both the vehicle and the turret. But that led to huge lag problems and very jerky turret movement over the network, It took many hours of debugging to find what the source of the problem was and solve it permanently. It also required writing NEW turret movement code as part of the vehicle class. I chose to let the engine calculate the barrel and turret position rather than expect the artist to animate the movement over some rotational range. To use the tank you just mount a turret and a barrel, the source code will animate the movement for you. Likewise, the track animation can be a headache and traditional solutions require the artists to animate the track via UV animations. I dispensed with that by having the game engine animate the tank track texture for you based on vehicle ground speed. The artists just has to UV map a texture for the track and name it according to the naming convention. The game engine takes care of the rest. This makes it possible to make game content 'tanks' using 3D tools like Blender and Milkshape, neither of which could export UV animations at the time the kit was made.
I coded the commander map from scratch based on an initial idea I got from some terrain camera code written by Ben Garney. My commander map let's you pan and zoom across the map using your mouse (click and drag) or mouse wheel for zoom. Unfortunately most people are unaware of this feature because the map is initially zoomed out to maximum and people think that's all there is to it. It's very useful when you want to drop supplies to you troops in the field. You can pan across to their position, zoom in, then drop the supplies within a few meters of their location. The troops will see the supplies falling out the sky on parachutes. Really cool. The commander map also uses icons to display tanks, vehicles etc. This makes it possible for you to change them to suit your own game just by replacing the icon pictures. Another unknown feature is that the commander map lets the camera swoop down from the sky and attach to the player as he spawns, making a seamless transition from commander map to player control. This feature can be turned on via a setting in the commander map datablock.
The player climbing a ladder is also original code. There was a need for the player to climb a 90 degree ladder and it took many hours of delving through the player class to achieve a smooth, seamless transition from walking up to a ladder, climbing it and getting off at the top, ready for action.
I also developed code for parachutes which let players gently glide down to the ground with some slight forward thrust. There were many, many other fixes and enhancements to the player class, too numerous to remember. A new collision system was developed which uses the weapon tip as a collision point rather than have the weapon slide backwards when it encounters an obstacle. By default this is off but can be enabled by a setting in the player datablock.
Advanced camera work: This has nothing to do with the advanced camera resource. I had tried that resource back when I made my racing game and found it to be buggy and it even ceased to function when the camera left the initial terrain tile. So I developed my own camera code to do smoothing and neat 3rd person enhancements. A game camera is really important and should give you the view you want without intruding on the game. You don't want to draw attention to the camera, if you do then you have just taken attention away from the game. Test drive the 3rd person vehicle camera in starter.racing (default TGE camera) then test drive the vehicles in CSK in 3rd person and see the difference. I also modified the 1st person weapon camera to keep it upright even when the vehicle is bucking over bumpy terrain. Unfortunately most people don't notice the advanced camera work in CSK, because, you are not supposed to notice it.
The "capture the flag" code was initially a resource that someone had put in to CSK but it was very buggy and I was asked to take a look at it. Once I figured out what it was trying to do, I rewrote it from the ground up and handed it back to the scriptor (Kittle) who polished it to perfection. I also developed C++ code to efficiently send the flag position across the network to all clients. The artist now animates the flag with two frames, fully up and fully down. The script then sets the flag position between 0 and 1 and this value is networked to all clients so that they all see the flag at the same position on the pole.
When I took over development for CSK, the crawl,swim resource was already in place as was some helicopter code. The crawl, swim resource had a major bug in that it did not handle the player collision box correctly. TGE player code does not rotate the player collision box by default because keeping the box orientated per the game axis system allows for a less CPU intensive collision algorithm to be used. I spent many hows debugging the system to find where the changes need to be made to get the player collision box rotated in the direction the player is facing.
The helicopter code had very unrealistic physics and I was asked to polish that which I did and the result is much more believable and I also incorporated damage effects. The more damage the helicopter takes, the harder it is to fly.
There were may other small enhancements done, such as being able to mount an object with an offset. This is good news for artists because sometimes a mount node is in the wrong place and moving it can play havoc with animations. Being able to keep the node where it was but just specify and offset position for the mounted object saves the day.
TGE bug fixes. Many old time TGE bugs were fixed. The player weapon would sometimes vanish if you aimed it out side of the players bounds box. People used to "fix" this bug by making the players bounds box bigger, but this also makes the player collision box bigger. I spent many hours debugging this problem and got it fixed proper, at the source where the problem occurs. Also one of the C++ classes did not have the necessary network code for updating mounted object positions. Noticeable when you drove a vehicle away and parts of it remained where you had spawned it. Fixed in CSK but both these bugs still exist in stock TGE 1.52
I know there is much more that was developed for this kit but the above are the stand out features which come to mind.
I have only referred to the C++ changes but a ton of scripting work was also done, some by me but mostly by Kittle and I'm sure the scripting also adds up to over a hundred hours of work done.
I doubt there is any other TGE kit available that has so many man hours behind it.
About the author
#2
I've tried to fix some of these bugs myself (with varying degrees of success), and I can attest to the fact that Duncan is not exaggerating regarding the amount of developer time that it *really* takes to track down the cause of and come up with a fix for these issues.
Kudos to you Duncan and the rest of the CSK kit team.
09/03/2008 (10:39 pm)
Impressive work, and I think it totally shoots down the "it's just a collection of resources" argument that a couple of folks have made.I've tried to fix some of these bugs myself (with varying degrees of success), and I can attest to the fact that Duncan is not exaggerating regarding the amount of developer time that it *really* takes to track down the cause of and come up with a fix for these issues.
Kudos to you Duncan and the rest of the CSK kit team.
#3
OH. See what I did there?
09/04/2008 (11:33 am)
Then I am very sorry you looked at code and wrote it over, when you never had to!OH. See what I did there?
#4
From Google : "A troll is a user of a newsgroup, forum or message board that posts messages with the intent of inciting an argument or flame-war."
Yes, we see what you did there..
I have really enjoyed playing around with the CSK. I wish the code documentation was better. But there is so much code, engine and scripting wise, that I have still not made my way around all of it. The vehicles have the best control out of any TGE games I have ever played. A great resource for both programmers and artists to play around with.
09/04/2008 (1:09 pm)
Quote:Then I am very sorry you looked at code and wrote it over, when you never had to!
OH. See what I did there?
From Google : "A troll is a user of a newsgroup, forum or message board that posts messages with the intent of inciting an argument or flame-war."
Yes, we see what you did there..
I have really enjoyed playing around with the CSK. I wish the code documentation was better. But there is so much code, engine and scripting wise, that I have still not made my way around all of it. The vehicles have the best control out of any TGE games I have ever played. A great resource for both programmers and artists to play around with.
#5
Also, awesome blog and run down of just how much work went into making this product. Its a great resource for anyone looking to make a Battlefield esq game.
09/04/2008 (1:55 pm)
@Duncan - Sorry about not having you as a CSK owner. You are now the proud owner of the Combat Starter Kit that you helped create ;)Also, awesome blog and run down of just how much work went into making this product. Its a great resource for anyone looking to make a Battlefield esq game.
#6
09/05/2008 (2:43 pm)
CSK is a great kit to use for making combat games, just to learn from, or....to battle your grandson in the included example game. :-D I really like this kit. :-)
#7
09/06/2008 (1:14 pm)
@JP - Id be happy to supply more documentation in the CSK scripts. Which ones do you find confusing or non-understandable?
#8
09/08/2008 (2:27 pm)
I bought a copy of CSK. Thanks for all your hard work. I saw your name in the source code. I totally agree with you. the csk package saved me a lot of time to put so many features togather. and also thanks for those who contributed the recources to the community.
#9
09/17/2008 (3:59 pm)
I have a question about the sql use in the pack; does it have the out-of the box ability to persist stats or ranking or would that be some additional code requirements?
#10
09/17/2008 (6:16 pm)
Hi Ron. This is just a blog page. Please post code questions in the CSK forums
#11
09/17/2008 (10:43 pm)
Awsome kit. I wrote a review for it on http://www.garagegames.com/pg/product/reviews.php?id=281 This is not a bunch of recources people!
#12
10/22/2008 (6:13 pm)
Does the pack include support for TGEA or just TGE? I'm curious because I want to use the pack but I'm using TGEA
#13
10/23/2008 (10:01 am)
the forums do not exist, I am really thinking if getting this pack but first I would need to upgrade torque, which is not a problem, but without a diligence place of support I am kind of leary
#14
The pack is TGE only but can easily (but time consuming) be ported to TGEA because it does not contain any specific Opengl commands etc. If you shift the TGE changes to TGEA it should work fine and will give you an opportunity to see just how much work went into the kit.
Yuejun Zhang has personally ported the kit to TGEA and has shared his TGEA code with other kit owners. So yeah, it can be done, but it's not provided as part of the kit.
10/23/2008 (3:27 pm)
It seems the garagegames CSK forums can only be accessed once you have bought the kit. You can ask questions about CSK at the public CSK forums on http://www.mydreamrpg.com/The pack is TGE only but can easily (but time consuming) be ported to TGEA because it does not contain any specific Opengl commands etc. If you shift the TGE changes to TGEA it should work fine and will give you an opportunity to see just how much work went into the kit.
Yuejun Zhang has personally ported the kit to TGEA and has shared his TGEA code with other kit owners. So yeah, it can be done, but it's not provided as part of the kit.
#15
This reminds me of David Bowie and Vanilla Ice for some reason.
10/26/2008 (10:44 pm)
I knew that was my capture the flag code. I knew it as soon as I saw the battlefield mod thingy come out that they used that. My gut feelings never fail. I only care because you're selling my code that you reversed engineered or whatever and called it your own. I wrote that code for anyone to use, not to profit from in a kit, but rather to make a game and use the code. Can I buy your kit and then sell it after I change the code a little and call it my kit...I mean I'll pay someone to change the code then sell it is that cool? This reminds me of David Bowie and Vanilla Ice for some reason.
#16
Garagegames sells a game engine which has many bug fixes submitted by the community. Four of the bug fixes in TGE 1.52 were contributed by me in the bug forum. Should I be wailing in a public forum about how unfair it is that Garagegames is selling source code which contains my 4 bug fixes?
A big chunk of the TLK shadow code in TGE 1.52 bears a striking resemblance to my shadow code implementation for TGE 1.42 which I submitted as a resource. So what if it there is a strong resemblance? It does not mean John Kabas copied me. It just proves that my concept was good and the same good concept was applied as part of the greater lighting implementation. I gave the code, ideas, concepts and my rights to it away when I submitted it as a resource and anyone has a legal right to profit from it.
You did the same when you submitted your resource. You do not hold a patent to it. Legally, nobody here owes you anything. You have been stressing about your "hoist the flag" resource for over a year now. Don't you get it? Nobody cares and you are not going to become famous or win medals, garner respect, kudo's or anything else by behaving in this manner.
10/27/2008 (12:00 am)
I was tasked to implement a better flag solution because the original version had random bugs, was not very network efficient and did not suit the CSK requirements which is why I wrote a much more suitable combination of C++ and script code to replace it with. Garagegames sells a game engine which has many bug fixes submitted by the community. Four of the bug fixes in TGE 1.52 were contributed by me in the bug forum. Should I be wailing in a public forum about how unfair it is that Garagegames is selling source code which contains my 4 bug fixes?
A big chunk of the TLK shadow code in TGE 1.52 bears a striking resemblance to my shadow code implementation for TGE 1.42 which I submitted as a resource. So what if it there is a strong resemblance? It does not mean John Kabas copied me. It just proves that my concept was good and the same good concept was applied as part of the greater lighting implementation. I gave the code, ideas, concepts and my rights to it away when I submitted it as a resource and anyone has a legal right to profit from it.
You did the same when you submitted your resource. You do not hold a patent to it. Legally, nobody here owes you anything. You have been stressing about your "hoist the flag" resource for over a year now. Don't you get it? Nobody cares and you are not going to become famous or win medals, garner respect, kudo's or anything else by behaving in this manner.
#17
11/15/2008 (6:32 pm)
Here, here! I agree with Duncan!
#18
where this port can be downloaded?
12/03/2008 (6:44 am)
Quote:Yuejun Zhang has personally ported the kit to TGEA and has shared his TGEA code with other kit owners. So yeah, it can be done, but it's not provided as part of the kit.
where this port can be downloaded?

Torque Owner Chris Mooney
Texel Games
To say that its a bunch of resources put together is untrue.
The CSK is not a replacement for a programmer. Any project using it will require the license owner to get very familiar with the code in order to make changes or additions - and this in its self can be quite time consuming I've added a substantial amount of code myself in order to get the CSK to perform to my standards, but its still an exceptional product!
Most of the features of the CSK I will agree are quite remarkable, I will have to disagree on the ladders - in my experience, the first person view is seamless.. but another player watching will see the climbing player "lag" up the ladder, I also wish there was documentation relating to vehicle setup for programs other than just milkshape. The support of it through the CSK team's irc, has been very helpful.