Plan for Gary Haussmann
by Gary Haussmann · 11/14/2004 (10:12 am) · 1 comments
I wanted to learn as much as possible about using torque with this GID, so I threw in as many different game elements as possible, even if those elements were not fully finished or fleshed out after 24 hours.
For content I wanted to at least know how to make and integrate custom art for: players, weapons, critters, terrain, and buildings. I got a lot of this importation info from Kenneth's Book "3D Game Programming All-in-One" (and in fact the player is my unfinished model from Chapter 14) although I had to spend a bit of time to figure out the Blender DTS exporter since Ken's book uses Milkshape.
For scripting I wanted to at least figure out where to look in the script files in order to change specific code or behaviors. Since I didn't know what or how much stuff I could change here, I wasn't sure how much scripting I should try to get done in 24 hours. I figured a good amount was to change the default enemy behavior of the starter.fps example so that enemies shoot back, instead of just running around. It turns out I got much further that that.
Here is a brief summary of my day-long experience. I basically got some sleep early on friday, woke up at midnight MST, and worked all saturday until about 10pm MST. If you just can't get enough cow dungeon madness, a full account with many updates and screenshots is here
The first six hours or so was me making a copy of the starter.fps example from the Torque SDK and using the mission editor to make a custom mission, pulling in new art from Blender and Quark along the way. I have custom art for the player with only an idle and run animaton; I will perhaps finish that up eventually. The primary art asset is the "dungeon" I had to make, which is basically a huge interior that is jammed into a hole carved from the terrain. Hoo boy, I tell ya, I learned a lot about Quark editing and lighting/portals/null textures over those 6 hours...

Unbelievably, the next four hours were spent tweaking the player mesh and creating a simple cow mesh for use the game. Evidently I had put together some wacked out objects links in blender and the exporter was getting angry/confused. When I went to view my player in-game his limbs would explode out in a frenzy of body parts reminiscent of a gross horror movie instead of swinging back and forth smoothly. I reset all the transforms between linked objects and repositioned the meshes and skeletons in Blender, and everything seemed to work much better. Thank goodness I didn't have to spend the rest of my day trying to generate and export a single cow model! I may try to figure out exactly what part of my Blender scene is confusing the DTS exporter.
Since I had all my required art at that point, the next step after lunch was to add in the various behaviors. After going over the tutorials at www.codesampler.com/ I felt fairly confident adding in code so that the cow would wander around at the bottom of the dungeon following a waypoint path. I basically added a "CowPlayer" class to aiplayer.cs and put in cow-specific functions for waypoint following.
The tricky part was that, when the player reached the room with the cow, she should see the player and start following them, so that the player can then lead her out of the dungeon. Normally, you should use onEnterLOS() for something like this, but since I'm not totally up on torquescript I settled for checking the distance from the cow to the player. When the player approaches within 25 torque units, the cow switches from its "following path" state to the "follow player" state.
That took considerably longer than I thought, since I haven't worked with AIPlayer at all and messed around a bit with various ways to look for the player. I also found that if the cow model didn't have an "eye" bone in its skeleton, the low-level AI code would sometimes wander around aimlessly. Meh.

So it's 4pm or so, I've been up 16 hours, and there are still no explosions. So I went and made a simple custom weapon, by making some minor modifications to the crossbow weapon. The gun model is a simple tube, since adding full animations would probably chew up the rest of my 24 hours. The functionality is similar to the crossbow except the particles, colors, and damage are tweaked to make it a slightly different weapon. Again, perhaps later I will make it more complete; for me, the point is to get a good idea of what is involved with making a new weapon, not make the best super-cool 3l33t weapon of all-time.
Finally, I had to hack up the AI again to add an enemy class. Unfortunately, my script-fu was not up to the task of making two cleanly delineated AI objects, one for the cow AI and one for the enemy AI. So I ended up using a single big of chunk of code for all AI, with a bunch of if statements to execute the cow-specific or enemy-specific parts. It all worked out reasonably well in the end, but to put in any more AI I would start over and figure out how to split up the AI code better for each type of creature.

So the last part of the game is the end. Once you kill the evil dungeon denizen 'Kork', find the cow and then lead her out of the dungeon, a simple trigger outside the dungeon detects the cow and displays a bit of celebratory text.
At this point (10pm saturday), I had a complete, if minimal game, finished. I figured that in my current fatigued state I couldn't get anything else done in the last two hours, so that was it for me. As a result of this GID, I've basically figured out how to get most the major art assets into torque, learned a bit about the overall script structure (mainly for the server) and figured out how to perform basic AI functionality.
I caught up on some sleep and am right now posting this plan. For future GIDs I hope to figure out making of vehicles, dorking with the environment (water/fog/sky) and also figure out some of the client-side scripting. Right now I'm going to go outside and enjoy the fresh air. Ahhh...
..edited to add click-through for the screenshot thumbnails and fix spelling ("Kennith"? what was I thinking?) and readability
For content I wanted to at least know how to make and integrate custom art for: players, weapons, critters, terrain, and buildings. I got a lot of this importation info from Kenneth's Book "3D Game Programming All-in-One" (and in fact the player is my unfinished model from Chapter 14) although I had to spend a bit of time to figure out the Blender DTS exporter since Ken's book uses Milkshape.
For scripting I wanted to at least figure out where to look in the script files in order to change specific code or behaviors. Since I didn't know what or how much stuff I could change here, I wasn't sure how much scripting I should try to get done in 24 hours. I figured a good amount was to change the default enemy behavior of the starter.fps example so that enemies shoot back, instead of just running around. It turns out I got much further that that.
Here is a brief summary of my day-long experience. I basically got some sleep early on friday, woke up at midnight MST, and worked all saturday until about 10pm MST. If you just can't get enough cow dungeon madness, a full account with many updates and screenshots is here
The first six hours or so was me making a copy of the starter.fps example from the Torque SDK and using the mission editor to make a custom mission, pulling in new art from Blender and Quark along the way. I have custom art for the player with only an idle and run animaton; I will perhaps finish that up eventually. The primary art asset is the "dungeon" I had to make, which is basically a huge interior that is jammed into a hole carved from the terrain. Hoo boy, I tell ya, I learned a lot about Quark editing and lighting/portals/null textures over those 6 hours...

Unbelievably, the next four hours were spent tweaking the player mesh and creating a simple cow mesh for use the game. Evidently I had put together some wacked out objects links in blender and the exporter was getting angry/confused. When I went to view my player in-game his limbs would explode out in a frenzy of body parts reminiscent of a gross horror movie instead of swinging back and forth smoothly. I reset all the transforms between linked objects and repositioned the meshes and skeletons in Blender, and everything seemed to work much better. Thank goodness I didn't have to spend the rest of my day trying to generate and export a single cow model! I may try to figure out exactly what part of my Blender scene is confusing the DTS exporter.
Since I had all my required art at that point, the next step after lunch was to add in the various behaviors. After going over the tutorials at www.codesampler.com/ I felt fairly confident adding in code so that the cow would wander around at the bottom of the dungeon following a waypoint path. I basically added a "CowPlayer" class to aiplayer.cs and put in cow-specific functions for waypoint following.
The tricky part was that, when the player reached the room with the cow, she should see the player and start following them, so that the player can then lead her out of the dungeon. Normally, you should use onEnterLOS() for something like this, but since I'm not totally up on torquescript I settled for checking the distance from the cow to the player. When the player approaches within 25 torque units, the cow switches from its "following path" state to the "follow player" state.
That took considerably longer than I thought, since I haven't worked with AIPlayer at all and messed around a bit with various ways to look for the player. I also found that if the cow model didn't have an "eye" bone in its skeleton, the low-level AI code would sometimes wander around aimlessly. Meh.

So it's 4pm or so, I've been up 16 hours, and there are still no explosions. So I went and made a simple custom weapon, by making some minor modifications to the crossbow weapon. The gun model is a simple tube, since adding full animations would probably chew up the rest of my 24 hours. The functionality is similar to the crossbow except the particles, colors, and damage are tweaked to make it a slightly different weapon. Again, perhaps later I will make it more complete; for me, the point is to get a good idea of what is involved with making a new weapon, not make the best super-cool 3l33t weapon of all-time.
Finally, I had to hack up the AI again to add an enemy class. Unfortunately, my script-fu was not up to the task of making two cleanly delineated AI objects, one for the cow AI and one for the enemy AI. So I ended up using a single big of chunk of code for all AI, with a bunch of if statements to execute the cow-specific or enemy-specific parts. It all worked out reasonably well in the end, but to put in any more AI I would start over and figure out how to split up the AI code better for each type of creature.

So the last part of the game is the end. Once you kill the evil dungeon denizen 'Kork', find the cow and then lead her out of the dungeon, a simple trigger outside the dungeon detects the cow and displays a bit of celebratory text.
At this point (10pm saturday), I had a complete, if minimal game, finished. I figured that in my current fatigued state I couldn't get anything else done in the last two hours, so that was it for me. As a result of this GID, I've basically figured out how to get most the major art assets into torque, learned a bit about the overall script structure (mainly for the server) and figured out how to perform basic AI functionality.
I caught up on some sleep and am right now posting this plan. For future GIDs I hope to figure out making of vehicles, dorking with the environment (water/fog/sky) and also figure out some of the client-side scripting. Right now I'm going to go outside and enjoy the fresh air. Ahhh...
..edited to add click-through for the screenshot thumbnails and fix spelling ("Kennith"? what was I thinking?) and readability
About the author

Torque 3D Owner Tom Bampton
Dont forget to email shortish description of the game, game name and link to this .plan to fos2k4 @ gmail.com so I can get it on the entries page on gameinaday.com :)