Sunday, February 08, 2009

XNA Game Project


I've been working on a demo project in XNA. This completes my content process for games. I first use my own model editor (going into beta this year) to create the geometry and animations and export a .x file. The level is built in a custom level editor tool we've written for this XNA project, and everything is pulled together in an XNA game engine.


My first goal for this phase of the project was to animate a .X model in XNA. I searched around on the web and found samples and found one that was close. I started with the skinning sample that is available for download from the XNA Creators Club. It animates a bald soldier ("dude") .FBX file. The issue with this code is that it rendered FBX files AND .X format, but it didn't do any blending between the key frames. This wasn't a problem for the sample model "dude" because it had a ton of frames, but for my animation that was only 10 or so key frames, it posed a real problem. So, I rewrote the code, preprocessor, and HLSL .fx files to properly load and animate .x files. After that, I had used some level editing code to create a height map and load my own model and have him walk around on the height map.


Here is a video of my western character running around on a test height map. It demonstrates character animation and basic height collision.


video

My next goal will be to add some objects with collision such as buildings, towers, and other objects the character can jump on. I'll also be animating a frog for an elementary school project coming up here real quick. I would love to here from anyone on ways to handle objects and areas such as a multi-floored building that the character can go into.


Happy Coding!
Jason

3 comments:

  1. Why "Dude"? Surely he looks more like a "Mr. Clean" or "Bruno" or "Hanz". I'm looking forward to seeing the Frog program. I think our boy will have a lot of fun with it. Your program is coming along nicely too! It's too bad it's so pixelated in the video. I saw it in person, and looks a lot like WOW to me!

    ReplyDelete
  2. Anonymous11/11/2009

    Is there a code sample available ?

    ReplyDelete
  3. You can find sample code at the creator's club website for XNA Development.

    http://creators.xna.com/en-US/

    and another good one is Riemers. As the post explains, I modified the sample from Creator's Club to load my .x files properly. The sample doesn't interpolate between the poses correctly so I had to write that code.

    ReplyDelete