Jump to content

April 2017 »

23 242526272829

Recent Entries

Recent Comments

* * * * * 1 votes

XNA Game Complete

4: Adsense

The primary goals of my tank game project were: to learn about the XNA framework, and create a feature complete game. I feel that I have accomplished both. Though I used the term "feature complete game" instead of "complete game" because all the code is there and working for the game, but content is lacking. There is 1 model for an enemy turret, 1 model for both the player and enemy tanks, textures for all models are their UV maps, and only 1 level currently (tested level changes by having the same level be the next level). As for what's in:
  • Support for multiple players in split screen
  • Main Menu for starting a campaign, selecting a level, or changing options
  • Basic particle systems for weapon impacts and object destruction
  • Location based triggers
  • Checkpoint respawn system, complete with fallback if there are too many deaths at the current checkpoint too quickly
  • State machine-based AI where the state machine is specified for each enemy in the level instead of enemy type
  • Navmesh and A* for pathfinding and smoothing
  • Ability for subsequent levels. Due to detecting when to switch to the next level as a trigger, the campaign actually doesn't have to be linear since each next level trigger can go to a different level and there can be multiple triggers in a given level.
Some key things that I've learned from this are:
  • XNA is great at creating quick test programs
  • XNA's Ray struct needs to have its Direction field be unit length or intersection methods don't give correct results
  • Blender 2.56 is significantly easier to use than the last version I tried
  • When creating a model, be careful with the object matrices if you plan to do anything beyond just drawing the model. Having an object matrix not be the identity matrix means the vertices aren't actually being updated in the modeling software and can produce unexpected results in a custom model processor
  • Using "SharedResource = true" means that what is supposed to be the same instance will in fact be different instances at run-time
  • Pathsmoothing is easy on a navmesh when all regions in a navmesh share a complete edge
Here's some screen shots of the game:
Posted Image
The main menu (as with the rest of the game, nothing fancy)

Posted Image
Level start (player's tank in foreground, enemy tank a bit further back and to the side, wall on the left)

Posted Image
Weapon particle system

Posted Image
Particle system for killing an enemy tank

[heading]What's next[/heading]
There's a few things I have planned for my next few projects. I want to spend some time playing with different graphics algorithms, as well as create a more complex particle system and better looking particle system. While I'm working on those, I'm also going to be reading a book on D3D11. Once all that is done, I plan to start on working on my next game. I already have a few ideas to flesh out and will probably start the design doc before I actually finish any of the other projects :-)

Dec 30 2011 01:34 PM
Cool, I'm also working on a tank game. Right now it's in Unity, but I've been thinking of doing a version for the XNA game studio. ..see if I can get it on xbox.

If you'd ever consider teaming up pm me. I do content creation.

Jan 01 2012 05:42 AM
Great work! It's nice to some some projects completed!

Note: GameDev.net moderates comments.