2006-08-25

Manifesto Games

The Manifesto Games website has unofficially launched. The site is currently considered to be in BETA. Please visit the site and support the efforts of independent developers.

2006-08-22

Doing a little bit of everything lately

Where to begin? I guess chronological order is the easiest, so here goes.

I finished the initial version of the animation engine not too long after my last post. So the next logical step was to create a path from Blender to a binary file recognized by my engine. Minimally I need files with skeleton data and animation data, and eventually skinned mesh data.

As a small break from coding I first sketched out the skeleton ("rig") for the main character in my game. I tried to get the proportions as close to a real person as I could so I used an 'Anatomy for Artists' book for reference. It wasn't a quick sketch in an hour or so. It took a day or two and what I've learned so far will help when I start doing my first real animations.

Once the layout for the skeleton was drawn up on paper I then proceeded to learn how to build it in Blender. I was familiar with how "rigging" works in general and how it should be built, but I wasn't familiar with the specifics of how to do it, in any modeling package. I'd played around with Blender a little bit in the past but not much. To familiarize myself with it again I went through the "Gingerbread Man" tutorial for my second time. Once I was reacquainted with Blenders interface I built the skeleton I had sketched out. Which turned out not to be too difficult. I also created a very simple animation.

Next was to export the skeleton and animation data. My intention was always to use the DirectX text file as my export format and then write a Ruby program to convert it into my own data format. I'd already created a similar program for extracting mesh data from a DirectX file when I was writing my 3D demo for Stardock. But I quickly learned that the DirectX exporters that are supplied with Blender leave something to be desired. Thus begins my first distraction from working on my game (not entirely a bad thing, but not expected.)

I tried exporting the skeleton and animation, and the output didn't look correct. First the exporter's output isn't as clean looking as I'd prefer, and all the keyframes only contained the matrix for one frame repeated for all frames. Not sure what to do, I began by looking at the export script.

All scripting in Blender is written in Python so I hoped I could at least understand it in general. Turns out that Python and Ruby are syntactically very similar so I felt right at home almost immediately. That's when I decided I would try to fix the script and possibly improve it.

Long story short(er), I started learning some Python and the Blender Python API. I eventually got the data I wanted to export properly, and in the process I cleaned up the exporter a bit and rewrote some code. I may finish the cleanup and release a new version of the exporter to the public (no offense to the original author of the script, but the code was pretty ugly. The community might appreciate a cleaner, working version).

The next step was to write a Ruby program to translate a DirectX file into the binary format expected by the engine (eventually I plan to generate an intermediate text format of my own, but I haven't begun the specification yet so I'm skipping that step for now.) This is more or less the phase I'm in now. I'm writing the code and in the process learning new things about Ruby and getting more comfortable with it.

My latest tangent started after I began parsing (technically I was doing lexical analysis ("scanning") and syntactic analysis ("parsing") but at the time I hadn't yet learned the difference) the DirectX file. I began to wonder how a compiler manages the parsing (and scanning) of text files. I visited the University library and checked out a few books. I'm now reading up on compiler construction (very interesting, I might take a class on it) and trying to use this knowledge to better scan and parse the DirectX file. Also learning about how Lex (Flex) and Yacc (Bison) work. Right now I'm investigating the Ruby versions called Rex and Racc in hopes of possibly using them to do my scanning and parsing. Depending on how difficult or practical it is I may just write my own less elegant solution in Ruby that just gets the job done, but I like the idea of using these programs to scan and parse the data.


School starts two weeks from today. I'm looking forward to getting back to class but I also know that I'm going to miss being able to code as much as I have been lately. I'm going to try and get as much out of the next two weeks as I can.

2006-08-01

Code cleanup, repository migration, an animation system and Ruby.

So I've been busy coding a lot lately. And as school approaches, my desire to get as much done as I can increases because I know that when school starts my time will be very limited.

I recently migrated my Subverion repositories from my Windows machine to my Linux machine. I got a dynamic DNS account from DynDNS so I can access my machine from anywhere. This will come in very handy when school starts. I plan to have a repository for all school related code that I write and to maintain that repository on this machine. With my DynDNS domain name I can access it from school and checkout a working copy to my webspace there and work on it when I need to.

As for my engine, I've started work on an animation system. The plan is to implement the whole system using matrices and if desired I can store the data in quaternion form later. I'll upload a new testbed application with an animation testbed when I finish.

I also spent some time fixing a bug in my sorted list class and moving some classes into a new engine namespace. I've decided that the whole engine would be enclosed in it's own namespace and am in the process of slowly migrating existing classes into the namespace.

And lastly I've been playing with Ruby some more. I rewrote the only non-ruby tool that I had, texcon, in Ruby. It converts textures into my engines texture format. I'm using RMagick which is a Ruby binding to ImageMagick or GraphicsMagick. I'm using the ImageMagick library installed on cygwin. My previous tool only supported the BMP format because that was the only format that I wrote code for. Now using ImageMagick I can use any format that it supports. Also on the Ruby front I recently installed RubyGems. If your using Ruby I recommend installing this. It makes finding and installing additional packages much nicer. It's similar to apt-get for Linux. Make sure your aware of this little tidbit though [LINK] otherwise things won't work the way you might expect. I chose to use the environment variable RUBYOPT and put the following line in my .bash_profile file:
export RUBYOPT=rubygems