Wednesday, May 30, 2007

Unreliable XBox 360's

It looks like Micro$oft is doing an Apple, and completely denying that there's a serious problem of XBox 360's lasting approx 12-18 months before crashing and burning. No doubt it will only be when the mainstream media get hold of it that they will acknowledge that there's a problem. However, at the moment there's profit to be made from charging people ~£80 to repair something that shouldn't have broken in the first place.

Will I ever need to power-down my PC that quickly?

Who's idea was it to incorporate a power-off button onto keyboards? What is the point? And especially, why put it next to another commonly used key? On my Genuisnet.com keyboard it is just below the Delete key. I've lost count of how many times I've knocked it, and all my applications have suddenly closed right in the middle of programming. Aaarggh!! If I want to turn my PC off, I'll press the power button that sits on the case approximately two feet away! Why do I need it on the keyboard?!?!

Tuesday, May 22, 2007

Latest Releases

I thought I might as well mention the new releases of my games, in case anyone's interested!

Nuclear Graveyard - The biggest complaint about this game was all the keys. I've now added a new menu system, so all the functions can be accessed from this. You can now also click on a units stats to select them, and click on the map in the top-right corner to change the view mode.

Passenger - I changed this so that it now uses floats for the angle, rather than integers. This has led to much smoother turning. I still need some decent animated 3D models though!

DangerMan - I changed the targetting on this so that the mouse pointer is a crosshairs (just like Abuse). I think this improves the playability. I also changed it so that the sprite coords are floats rather than integers. I thought this might slow things down, but it seems okay. I need to work on the maps now.

HoloRacer - This now compiles some of the OpenGL shapes for improved performance, and I also widened the track. I also got it to remember which level the player reaches, so if they restart the game, then can jump straight to the latest level. I've managed to get to Level 5 - beat that!

Thursday, May 10, 2007

When to Check Collision Detection?

This post is not going to cover the actual detection of collisions between sprites; I think there's already more than enough of that on the net for a lifetimes reading. I'm talking about "when" we check for collisions...

I previously used to process all my game objects sequentially, and check for collisions against every other object. However, the problem with this is that the program will be checking for collisions between object A and object B, and then checking object B for collisions with object A. This is time wasted, as presumably if object A hasn't hit object B, then object B hasn't hit object A. (This assumes that all object movement has been carried out already)

What I now do is loop through each object, and only check for collisions against all the objects placed after the current object in the game's "list of objects". So object A is checked against object B and C, and object B now checks only against object C, whereas previously it would also have checked against object A as well.

So if my game had 100 objects, it was checking for collisions 9,900 times in each game loop (100 objects x 99 other objects). However it now only checks 4,950 (I think) times!

Watch Out for Eclipse and Subversion

If you're using Eclipse and Subversion at the same time, beware. When compiling, Eclipse copies the src directory over the bin directory. Presumably this is perfectly okay for most people. However, if you're using Subversion, this means that it will also copy the .svn directory that is inside src. The upshot is that Subversion now thinks that your bin directory is your src directory: it will think all the source files are missing, and try and update them.

And don't make the mistake that I did, before I discovered the above problem: I svn-deleted the source files from the bin directory, assuming they shouldn't be there (which technically they shouldn't). However, when I then update my src directory, it deleted all the source files from there as well! It did this because when I deleted them from the bin directory, Subversion thought it was the src directory!

I'm now trying Subclipse...