New 3D file format - OpenCTM

June 10th, 2009

The Hover Extreme project has been idle for some time now. Instead I have been working on some other projects.

One of the projects is a new 3D file format for compressing triangle meshes: OpenCTM. It is very will suited for the kind of meshes that are used in Hover Extreme, so once the file format is finalized, it will very likely be supported in the game engine.



December 4th, 2008

I have prepared a simple preview of Hover Extreme that you can download and install on your Linux or Windows machine.

The download can be found here.

Windows users: Run the installer, and start the game from the Programs menu.

Linux users: Uncompress the archive in your /opt directory, and run /opt/hoverextreme/start-hoverextreme.

Some quick instructions:

  • In the menu screen, press Space to start the game, or Escape to exit.
  • In the game, use the W/A/S/D keys and the cursor Up/Down/Left/Right keys to control player 1 and player 2 respectively. Alternatively, use one or more joysticks.
  • The game ends when one player has fallen off the map ten times, or 10 minutes have passed (or if you press Escape).

Good luck (it can take some time to fully master the hover craft)!

PS. If you wish to have a look at the source, you can browse the Subversion repository.

Bullet physics library

July 1st, 2008

Since I have now transitioned from C to C++, there are a few more options for libraries that can be used. One of them is the Bullet physics library, which seems to be nicer than ODE (which I am still having some trouble getting along with).

Bullet seems to have a clean API, and it seems to be actively developed. Also, the support for various hardware seems interesting (e.g. the PS3 SPU support). Perhaps OpenCL will be supported too once it is released?

Level design and CG Textures

May 8th, 2008

I decided that since I’m not a graphics artist, I had better go look for some decent textures to use for my level designs. After some quick googling, I found CG textures, which is a great source of many, many high quality textures. And the best part is that the textures are free!

I selected a few textures, and started working on some simple models in Blender, and came up with the first decent map for Hover Extreme (see screenshot below):

Screenshot - 2008-05-07

Perhaps the map should be called “Dusk”?

Learning Blender

April 28th, 2008

Wow! Blender really is a powerful tool, if you just take some time to learn the rather odd user interface. So, I have managed to produce the first 3DS model of a hover craft, as you can see from the rendered image below:

Hover Craft 1 - Render

There is still alot of work to do on the model, but I’m satisfied for now just to have a proper model in the game.

Mastering the art of meshing and texturing takes some time, at least when you’re not an artist. If you plan to use Blender yourself, here are a few hints:

  • First of all, watch some Blender tutorials on YouTube - this is generally a good idea for any program that you are new to!
  • Learn & master the camera, and a few handy shortcuts: Add (Space), Translate/Grab (G), Rotate (R) and Scale (S). The latter three can be constrained to an axis by typing the axis too (e.g. G X to translate along the X axis).
  • Lasso select is a great tool! CTRL + left mouse button
  • When doing texturing, use seams (mark edges as seams), and you will find that the unwrap tool in the UV-selection/edit mode works much better!
  • Export the UV maps for the textrures as pictures using the UVs > Scripts > Save UV Face layout function. This way you can import the UV map into a layer in GIMP or Inkscape, or whatever tool you use for texture creation.

Apart from that, I have been working with the game infrastructure, introducing a title screen (with room for a menu in the future) and a level loader screen:

TItle screen

Loading screen

Did I mention that I love Inkscape? It’s a wonderful tool for producing 2D art, especially if you’re looking for a cartoon-like style (e.g. as in the title screen above).

Documenting the code in Doxygen

March 28th, 2008

So, the entire code base has been converted to C++. A quite enjoyable experience, actually.

Despite my fears, C++ can be quite nice when handled correctly. The language itself offers so many options, that you can easily be tempted to “code until it works”, which will get you quite far into dead ends very quickly. Settling for a coding standard early on helped me a lot, but there are still things to do (like establishing a consistent exception handling strategy).

Anyway, one of the initial reasons for moving to C++ (except for all the other obvious reasons) was to make it easier to document the code using Doxygen. And so, I have started doing that too.

So far it has worked very nicely. You basically only have to set up a decent configuration file (the default one gets you quite far, and doxywizard helped me with the rest), and a simple three-liner Makefile so that you can easily ‘make’ the code documentation at will with a few simple key presses.

If anyone ever hesitated about using doxygen (or any other similar tool, such as Javadoc), stop worrying and just use it - it’s extremely simple and gives you a great overview of your code!

Converting to C++

October 21st, 2007

After some on-and-off work on the engine, it has now matured to a state where graphics, physics and input “kind-of-work”. It is now actually possible to play a quite challenging one-on-one game in Hover Extreme, where the aim is to push each other over the edge of the playground.

What next? Since I have been quite lazy on the class documentation side, I started looking at doxygen. As it turned out, it was very difficult to make doxygen understand that my C structs and functions were actually classes and class methods (I guess people are not normally coding object oriented programs this way…).

This was the trigger that I needed to make the decision to convert the program from C to C++. So, I am currently in the process of converting the entire code base (11,000 lines of code at the time of writing) to C++. I am especially looking forward to gaining access to the following C++ technologies: exceptions, class inheritance and string handling. My only real concern right now is that the C++ classes might consume more memory than my current, fairly slim, C language counterparts (especially critical for my mesh and triangle classes).

Since the program is fully object oriented even in its C implementation, the conversion should be fairly simple. The nice thing about all of this is that I can make the conversion gradually. The old C code compiles fine with g++, along with the parts that have already been converted to C++.

Back to the drawing board…

August 25th, 2007

After some enthusiastic coding with the aim to integrate the ODE physics engine into my game engine, I ended up in a dead end with typical “who is using who” class problems (i.e. circular class usage). It all boiled down to a too flat class structure, so I realized that it was time to return to the drawing board - which meant Dia in my case.

After some work, I have now come up with a class structure that I think will hold. Basically, the “world object” class is now  the owner of three sub classes: GfxObject (the visual triangle object), PhysicsObject (the ODE object) and SoundObject (FMOD sound(s) for each world object, such as engine sounds etc).

The main point is that now the graphics engine, the physics engine and the sound engine are separated from each other, which will probably be a good thing once (if) network play  is implemented (i.e. a network server can easily be designed to run with graphics and sound disabled).

I am also currently looking into the art of collision detection. I believe I will have to write my own collision routines (i.e. mesh/mesh intersection) in order to best utilize the mesh instancing functionality of the game engine. It will probably save alot of memory too by avoiding duplicate representations of the triangle meshes (if you use ODE’s built in triangle mesh collision routines, ODE needs a copy of the mesh too).

Sound with FMOD

August 4th, 2007

I have now created a new Game class, which contains the main game loop, and a SoundCore class, which wraps the FMOD API, so now there is sound in the game engine too! So far, I have just included a background soundtrack, but 3D sound effects will also be added.

Currently, I am preparing the source code and directory structure for version control at Sourceforge.

Simple rendering engine

July 18th, 2007

Screenshot 2007-07-17
So I am making some progress with the game engine, and can proudly post the first screenshot (I am currently using borrowed models and textures, so the picture has no real connection to what the game will look like, unfortunately). The following things are currently implemented and working:

  • A basic scene graph, consisting of models (with materials), light sources, and players (each player has its own viewport, so multiple players will be able to run on the same computer).
  • 3DS, MD2 & STL importers.
  • Skin & environment map textures.
  • A sky box.
  • A simple Lua script system for describing maps.

Next up: Design the game loop and hook in a physics engine (ODE).