More progress as of late on the xna based shmup concept. All of the gameplay mentioned in the previous post has been implemented. Some of it is not quite ‘fun’ yet. The attack pod makes things entirely too one-sided and most of the weapons need to be tweaked.

Before ragging on the game any more I’ve gotten a bunch of neat things working. There’s a few big things that currently don’t exist in the XNA beta that will bite you as soon as you start to scratch the surface of the framework:

  • No support for model loading or animation
  • No support for fonts or UI

So I was pretty much okay with both of these not being there in the beta and just waiting for them to show up in a final version. Well the first thing I stumbled upon was the ZiggyWare XNA font generator and associated rendering code. This was super easy to throw into the code, it took me less than an hour to get the fonts support into the scene graph.

I then spent another hour and wrote a very small but usable UI/menuing system. When the debug camera is not enabled the left trigger brings up the menu. You use the DPAD to navigate the menu (A button also opens submenus). Certain items can have ‘tweakables’ attached to them which can be either a float, vector3 or vector4 value type. The tweakable fields (3 or 4 for vectors) can be selected using the shoulder buttons. The right analog stick adjusts the value in the field and an update event is sent to an attach IEventTarget object. I use eventing all over the engine already for animations, game logic etc. The one tweakable I have now for example is the LightDir tweakable which is wired to an UpdateLightDirection event on the scene. In the first picture you can see the specular highlights on the water (please excuse cheazy really bad shader code). You can tweak the lighting with the controller to get the desired effect.

So then that brings me to the issue of the model loading, which I was also content to let be and just use the standard cubes. I remembered that I had some old 3DS loader code laying around and porting C++ to C# is pretty darn easy IMO so I spent a few hours and ported the 3ds code. There were a few wierd things to work out in the translation but the C++ code was written with some nice abstractions so it went very smootly.

So now I’ve got some free 3ds models from the web running around in the engine with some more interesting lighting and it’s actually looking a little bit more decent at this point. The next two shots are just of a free 3ds model I found that is composed of about 16 mesh chunks and has custom basic materials (no textures). To handle the materials I created a MeshMaterialGroup object that accepts the material with face indexes from the loader and resolves the faces into prim indexes. When you call Mesh.SubmitPrimitives() it looks to see if it has any material groups and if so it submits them in order instead of sumbitting the entire prim batch for the whole mesh.

Close ups of 3ds model: