25/04/2011 – 02/05/2011
——————————–
Well I’ve had plenty free time this week as I’ve been off work. I managed to get everything I set out to do finished, and a lot more besides!
First order of business was to complete the new AI and get it into the game. I finished off the behaviour patterns of the NPC’s pretty quickly as most of the groundwork was already in place. Once the NPC’s were working how I wanted them to I started to restructure the code to make it usable in the game.
What I ended up with is basically a long and complicated chain of types (classes) that all tie into the NPC types. I’ll admit it was a ballache to code it this way, following the chain was very confusing at times and trying to find which adjustments to make and in what type could be a nightmare.
I have a good reason for writing it like this though (or so I believe). You see the thing is, I’m more interested in the actual game than the code. I think it’s important to do all the complicated work on the engine so that I can focus purely on the creative side when I’m actually making the game. This is just a part of that and now that the hard work is done all I have to do to make a new NPC is is give it some stats (health, speed, damage etc) and a brain (the AI).
The bonus to this is that I can assign different “brains” to the same type of NPC independently. This means that in the game you will never be 100% certain how an enemy is going to react just by looking at it. Adds a nice aspect of uncertainty to the gameplay, even if there are only a few different behaviours to choose from.
I had to fiddle and tweak the code no end to get it to co-operate with the existing engine, but to be honest it wasn’t half as bad as I was expecting it to be. With the AI in and working, as far as I’m concerned the engine is complete and I can start looking towards making the rest of the game!
I sent a copy of the new version over to Shane to let him pick it apart and give me some feedback. I’m in a pretty good position to have Shane available and willing to test for me. You could fit what Shane doesn’t know about games and gaming on the back of a postage stamp (I’m convinced you can take that literally). So when someone like that gives you advice you’d do well to listen to it.
Biggest change that came from this is that you no longer have to aim directly at an enemy to shoot it. The player now fires real bullets, as it were. This was a very good move in my opinion. The combat just feels so much better now, more intuitive. The guns all still have different stats for range, accuracy and damage, and the accuracy and damage of the player is still increased by the adrenaline system, it just plays a lot differently now. Good call Shane!
I also added a run/walk button and automatic reloading of weapons (if you have ammo in your inventory). After that it was just a case of fixing a few minor bugs here and there and the game is now looking and playing much better than it was at the start of the week.
I’ve only got to redo the first cut-scene and a new demo version will be available on the site! Happy Days.