Saturday, April 9, 2016

X-Fire (2003)

I was recently encouraged to go back and look at a game I made with some uni friends in 2003.
Here I show it off and talk a bit about it.



You can try it out for your self here...


Back in the early 2000’s I was playing around with OpenGL and even managed to make a little racing game with uni mates called IdleTime. It just used light maps for the environments, and the cars had dynamic cube mapped reflections and stencil buffer shadows.


In 2001 I saw the first public showing of Doom 3 at Mac world.
https://youtu.be/Qj3dPyk7hPI
My mind was blown. I wanted to know how it was done. I remember thinking I may as well stop trying to be a graphics programmer because I'll never be able to do something like that.


Anyway, after much reading on every graphics forum I could find, I started to understand how it was done. I saved up my money and bought a GeForce-3 video card and started to play around with it.


Now, of course, the Doom 3 rendering pipeline is well documented. http://bfy.tw/5BfB
In fact you can even download the source code, so I won't go into how it works here. But once I had a little test bed running someone (I can’t remember who) had the idea to make a top down shooter where all the levels are made out of repeated tiles. So we got to work making it.


About a year later we had a demo of X-Fire.

Because all lights were dynamic we really wanted to show it off. We had swinging and flickering lights all around the levels, and a spot light attached to the end of the gun. Even the muzzle flash was a full light that cast shadows.


Every surface had a diffuse map, normal map and a monochrome specular mask. But the specular response was fixed. Looking back I wish I had a colour specular mask and a variable specular response. 

Also when I rendered the ambient pass I just used the diffuse texture. It would have been simple to use the normal map to look up into a cube map or something to stop it looking so flat in shadow. We got around this by having almost no ambient light, it helped with the ambiance anyway.

I should have had fill lights, cheaper lights that had no shadow or specular, so we could have filled in the darker spots in the level.



Game play wise, we only had one enemy type and two different weapons. Of course to turn this into a real game we would've had to expand on that. We had lots of ideas but we ran out of time to implement them.
Because of where the camera was you would potentially see enemy's in rooms that your character should not be able to see. But because there was almost no ambient light, most of the time to find an enemy you had to walk into a room and shine your light in there.


People kept asking us to add a first person mode. So we did, it was actually handy for debugging, allowing you to be able to get up close to problems. however, the game play and art was never designed for this and doesn't really hold up.

We did have two player co-op working over TCP-IP. It was a lot of fun. That's why there is another player character standing at the start of each level. If someone connects to your game, they control that player.


Because the levels were all tile based and Travis made us a nice tile set, we could make levels really quickly. Each level was just rearranging level pieces, so level load times where almost zero. I’m sure if we ever made a real game out of this we would have made more level sets of different environments. It would have been interesting to try and make an auto level generator, but we never had time. Plus it was a lot of fun making levels.

Because all the lighting was real time, you didn’t have to sit around waiting for levels to bake. You could edit levels live in the game. We didn’t hide this and encouraged people to snap pieces together and see what they could come up with.


Because all our lighting was dynamic all our geometry could be dynamic also. However, we never really exploited this. I always wanted to add physics objects to the game. It would have been cool to see objects get flung around the place as you unload your gun.

I would publish the source code, but its too embarrassing. The only thing anyone would learn is what NOT to do ;) But I'm happy to answer any questions about it.