Friday, July 31, 2009

I've been Freegamer'd!

Fame and fortune comes with its downside, as I can now testify (well, for fame anyway - fortune may have provided a solution). I, up until a few hours ago, hosted most of my web pages and all my download files on my home server, which suited me well since I had direct access to it and don't need to faff around to make files available.

Unfortunately, the only option my crappy ISP (aren't they all?) has for unlimited upload/download allowance is countered by a maximum speed of 0.5mbps. This never used to be a major issue, until I got Freegamer'd. The interview on Freegamer, with it's myriad of links to all my games (most stored on my server) has caused a bit of a bottleneck, much to some people's (and my own) understandable annoyance.

However, I've now fixed it. I'm hosting the larger files on HyperFileShare, which seems pretty good. I've not fixed all the links across all my pages, but in the meantime here are the best download links:-

Xenogeddon | Laser Tactics | HoloRacer

Thursday, July 30, 2009

Revisiting My Old Projects

Going back to an old unfinished game project can usually end up one of two ways - you're quite impressed with the way the game is, or you're imagination has been playing tricks on you and you wonder what on earth you were doing when programming it, since you weren't concentrating on the game. I had both these feelings the other day:

I went back to a couple of my old games, in order to remind me of them for my Freegamer Interview. The first was DangerMan, a platformer with weapons. And I was (IMHO) quite impressed - the gameplay was solid, there were no glaring bugs, and it moved at a reasonable speed.

Then I took a look at Metal Glove Solid, my Gauntlet remake (which will have additional features later). Oh dear, it wasn't very good. It was dog-slow and the collision detection left a lot to be desired. How come I don't remember it being like that? It's time for some emergency programming!

The problem seemed to be my method for storing sprites. Gauntlet is famous for having a lot of sprites on the screen at once, and I needed an efficient way of keeping track of them for processing and collision detection. Usually in my games I just store them in a long list, but this can be quite slow.



My method was to have two two-dimensional arrays - one for storing each sprite at it's mapsquare co-ordinate (so drawing would be efficient as I could easily identify which sprites needed to be drawn, based on the area of map that was being shown on-screen), and one storing each sprite at each mapsquare co-ordinate that the sprite was covering - this would improve collision detection since I could easily identify all the sprites that shared the same mapsquare with the sprite I was testing for collisions.

Both of these methods seem sound, but the drawback is that every time a sprite moves, it needs removing and re-adding it to both arrays. This is what takes a long time. My not-so-difficult solution was to get rid of the first array and simply store the sprites in a tried-and-tested list. Performance is much improved, and the latest version (1.1) can be downloaded here.

Tuesday, July 28, 2009

New Forums

Thanks to Charles at Freegamer, I now have my own Forum at FreeGameDev. Please feel free to use them (or the comments section of this blog) to inform me of how my games could be improved.

Thursday, July 23, 2009

IC: Tweaking the AI and Game Mechanics

As well as improving the graphics of Island Commander, most of my time has been spent tweaking the AI. This involves playing the game and employing one of 3 basic tactics: build mines and wait for the AI to attack me; rushing the AI; and thirdly something between the two (build quite a few mines and then attack).

After playing it a few times, you begin to notice pitfalls that the AI falls into. For example, it doesn't keep any "reserve" cash, so when it gets attacked, it takes it longer to raise enough money for a defence. This has now been implemented. Also, it never builds any defences before it is actually attacked. I've still yet to add this.

There's also a few tricks that it can use that a human player would; for example, units are far more effective in pairs (or more) since they can get twice as much firepower out, destroying targets much faster. I've now implemented this.

I've also tweaked the balance a bit by adjusting various unit's stats; in particular, mines were a bit weak, meaning that the first player to attack usually managed to decimate the opponents buildings (causing the slippery slope effect). I've also reduced the amount of money that mines give, meaning that if a side does have less mines, they're not necessarily losing out on much more money than their opponent.

Thanks to all who have contacted me with problems and suggestions. It has made my job a lot easier!

Monday, July 20, 2009

Island Commander: New Graphics!

Yeah so I'm like "woah!", and everyone else is like "yeah, whatever", and I'm like "okay, I'll redo the graphics then." Praise the lord for GPL and other great licences that let people like me have decent graphics in their game with no legal hang-ups. Here's a screenshot of Island Commander with its new look:-


At a distance it's quite blurry and doesn't look that different; you'll probably have to click on the picture to see the new graphics (or even just [Ultimate] play the game). For those who are curious, the new units are taken from Bos Wars and FreeOrion, which both have great graphics and permissive licences.

I've also taken the opportunity to tweak the AI. However, this change in graphics is just the first stage of a new aspect of "IC": factions. The player will be able to choose from various armies, each of which will have special unique skills and abilities. This will increase the AI complicatedness factor to about a million percent and also undo all the good work in balancing that I have done, but I think it's necessary to keep the game interesting. Suggestions for funky faction names are more than welcome - and full credit will of course be given!

Tuesday, July 14, 2009

Island Commander AI

I've received a total of zero emails asking me about how I implemented the AI in Island Commander, but screw you lot, I'm going to talk about it anyway.

This is all probably exceedingly simple to anyone's who written any kind of strategy game AI, but the enemy works in this way: every so often, it scans the map for the players units. It then gives each square a threat point value, based on the unit type (the meaner the unit, the higher the points) and how far away the square is. It then totals up all the points for each square, and then finally takes the square with the highest points of which the AI owns. This square is where the AI will build its next attacking unit (if there is actually any threat to that square).

Of course, this may not be the case. There may be no threat whatsoever, and in fact there may be some juicy enemy mines to destroy. If this is the case, the AI does the same thing as above, except instead of looking for threats, it looks for targets. If there are within range, it will launch an attack on them.

Incidentally, you can see this in action by pressing T (to see the "threat map") or Y (to see the "target map") when playing the game. There are a few other nuances, like the fact then if the AI is attacking, it will sometimes build 2 or more units since they have more chance of surviving. It will also choose certain units for certain roles, like defending or attacking. But in a nutshell, that's it.

The next step is to implement different "personalities" of AI, one of which is chosen at random at the start - a defensive one, an aggressive one, and maybe a mad one that does random things. I may even get them to shout sarcastic remarks at the player via the console.

Friday, July 10, 2009

Island Commander Released!





How I imagined the game in my head



This is NOT what the game looks like,
but may do if I have enough time

One thing I remember reading on Joel Spolsky's blog something about "don't alienate your audience by releasing buggy software too early" (or something along those lines). I've always been curious how this works with the open-source mantra of "release early, release often", but I'll save that discussion for another day.

Anyway, with that in mind, I'm using the Google trick of making it beta, so if there are any bugs I can easily explain them away. I haven't actually found any, and the last fews days has been spent balancing the game and improving the AI, which plays a mean game.

Talking about the AI, I'd appreciate if someone else could give me feedback. I think it's getting easier to beat, but that might be because I am so awesome (and have had lots of practise since I've played it about a gazillion times).

So anyway, the Island Commander can be played! Point your browser to http://onlinegameplanner.no-ip.org/games/islandcommander.cls and strap yourself down. All feedback welcome, of course.

Wednesday, July 08, 2009

RTS Theory?

I've reached that stage in my new RTS game where all the main programming is done (apart from all the boring bits like a start and end, and changing the UI so someone other than myself knows what to do) and it's now down to tweaking the mechanics.

I used to look forward to this bit, but with something like my (albeit very simple) RTS, there are so many variables that I feel like a need some read some kind of book on RTS theory. There are (only!) 4 different kinds of unit. Each one has a cost, movement speed, a view range (how far they can spot enemy units), a shot range, a shot power, a "health" rating (how much damage they can widthstand), and finally a threat rating (for the AI). And I'm sure this is very simple compared to most RTS's. Then there are other factors, like how much to increment the players cash based on how many mines they have.

Most people hold up Starcraft as a prefectly balanced games, and I want to know how they did it. With all these hundreds of variables, did they just play the game several trillion times, each time tweaking it like "that unit is a but powerful, let's reduce its firepower". Or do you increase the other unit's firepower to compensate?

Questions questions questions. The main problem at the moment is that Island Commander is an "arms race" game, except instead of arms, it's mines. If you don't build as many mines as possible as quickly as possible, the enemy will soon overrun you. How does Starcraft (or any other RTS) avoid this problem?

Tuesday, July 07, 2009

New Project: Island Commander

I always like to give my projects a name that reminds me what the hell my original idea was that I started with, since it's easy for them to transmogrify into something else, I lose the initial inspiration, get bored and go onto something else. This happens a lot. My new game is called "Island Commander" for this reason, and should serve to remind me what my original vision was.

I was browsing t'interweb and came across a page for Carrier Command, a game I haven't played for years, and is long due for one of my legendary "remakes". It also reminded me of another Amiga game called Archipelago, which I've never played but always admired the screenshots for their simple 3D graphics.

I can't remember the exact thought processes I went through to get to where I am today, but I always wanted to write a strategy/wargame thingie that involved units being controlled by AI, so you were more of a commander rather than directly controlling every unit. The result is this simple RTS, where you simply choose where to start the units (whether it's a mine for the obligatory resource gathering or a jet fighter) and then the unit goes of and does what it thinks is best.



No prizes for guessing where the sprites came from. And you'll notice it's not 3D, but that will come, maybe. And I've not implemeted "islands" yet. I'm still tweaking the opponents AI, but rest assured, if I manage to finish it, this will be the new Starcraft! Most importantly, I actually enjoy playing it so this one could run...