Tuesday, December 15, 2009

Making Money from Open Source

After discussing the above on the Freegamer forums, I thought I'd start a brief list of ways to make money from Open Source, if only for my own reference:-

  • Put adverts onto your website
  • Ask for donations
  • Offer to implement features
  • Create virtual merchandise
  • Sell "acheivements" and "player upgrades"
  • Unlock features
  • Sell merchandise
  • Sell your community
  • Provide an offline version of the game (for free) but require a small payment for anything other than token access (e.g. unrated friendlies) on a PvP server.

Some of these are similar and are along the lines of "allow players to pay for more features".

The main obstacle to all of these is having a game popular enough so that people will actually pay money. Suggestions for solving this problem on a postcard please...

Friday, November 27, 2009

New Stellar Forces Client and new Forums

A new version of the Stellar Forces client has been uploaded (0.35), and I can also announce that we have some new forums, linked into the Stellar Forces website (so users don't need to log into a seperate website to be able to chat).

See the Stellar Forces blog for more details.

Monday, November 16, 2009

New Stellar Forces Blog

Since I'm hoping that Stellar Forces is going to become my raison d'etre, I've created a whole new seperate blog for it. I've got loads of ideas and thoughts to discuss about it, and people who may be interested in it may not want to have to wade through all the other random blog entries that I produce.

Thursday, November 12, 2009

Stellar Forces Released

I've just released the first alpha version of Stellar Forces, my 3D squad-level multi-player turn-based strategy game. You control units in the traditional turn-based way, and take turns with your opponent. There is also a website that acts as the control panel for games.

It is alpha, so although I've tested it there are bound to be bugs and the game balance may not be perfect. I would just like a few playtesters to start using it and provide me with constructive feedback about what can be changed and improved.

In "hallway testing" style, I'm keeping my details brief so that if there are any confusing or unexplained aspects to the game, people will let me know and I'll add more details to the instructions.


Anyway, let me know what you think!

Tuesday, November 10, 2009

Stellar Forces: Almost ready!

I've been a bit busy lately, what with having a new baby son, but have somehow still found time between bottle feeds to write the final bits of code to Stellar Forces.

I've just got a bit more testing to make sure it's robust, and then I'll announce it formally and let people loose on it. I'm hoping that these beta-testers will be able to help me tweak the balance of the game. With a game as complex as this (it's like multiplayer stand-alone missions from X-Com) there are so many variables (unit stats, weapon stats, mission objectives, map layouts) that it will take several games to get it right.

The game also has it's own website which stores a history of everyone's games, so there will be league tables, stats pages, and I'll maybe even do proper competitions sometime. The options are endless.

Monday, November 09, 2009

Java: Forgetting to override .equals()

This one always catches me out. I have a bunch of icons in my program, all extending the Rectangle class (seems like common sense to me). However, I don't actually fill in the dimensions until I've got the full list of icons (stored in an ArrayList()) so they are all zero-sized rectangles.

Before I add each icon to this list, I check whether it's already there:-

public void addIcon(Icon icon) {
if (iconlist.contains(icon) == false) {

Have you spotted the problem? Since the dimensions for the icons are all zero, and the contains() function uses the equals() method of the icon class, then once one icon is added to the list no others will be. This is because the Icon/Rectangle class' equals() method compares the dimensions, and thus all my icons are actually equal, so it thinks that the icon list already contains the said icon. (That all seems very verbose for what is quite a simple problem).

Note to self: Always override the equals() method.

Thursday, October 22, 2009

Links About Game Design That I Fully Intend To Read But Don't Currently Have The Time




Monday, October 19, 2009

The Spectrum Got There First!

Did it? Well yes actually, it did. You name the genre and you're pretty much guaranteed that the first game of that genre was available on the Spectrum (or maybe ZX81). And here's a few examples to prove my point.

Let's start with the biggy, probably the greatest breakthrough in gaming this century (or maybe the end of the last one). I'm talking about GTA3 of course, what everyone thought was revolutionary.

That is, apart from me. I thought I was having a bout of terminal deja-vu when I saw it, and was nostalghically transported back to the mid 80's, when I was playing the classic Turbo Esprit:-

Next, Wolfenstein is held up as the start of the FPS genre. Frankly, I was hoping it was the end as I was already bored of FPS'ing.

The start for me was 3D Monster Maze, almost 15 years (count'em!) earlier:-

Detractors will say "It didn't have any shooting in it!". I reply "Well, that's pretty revolutionary in itself!".

Just like Wolfenstein, Dune II is held up as the first of the RTS genres. (I've no idea what happened to Dune I).

But RTS's had been around for years already - if you owned a Spectrum (and probably most of the other popular 8-bit machines). However, Stonkers came out on the Spectrum first, and for that reason we can gloat.

And before you ask, yes, it does have resource collecting!

Last but not least is genre that never quite goes away, it's the top-down dungeon crawling game. I could have included a picture of Diablo here, but let's be fair and show Gauntlet, what many people claim to be the first (apart from those who claim it was The Dandy).

Of course, both of those people are wrong. The first game was Maziacs, and it came out on the Spectrum first (as if you needed to ask).

So if you're a games programmer working for a large megacorporation with a massive marketing budget but precious few original ideas, why not plunder a few from the Speccy back-catologue and claim them as your own?

If you can think of any more, please let me know and I'll do a "part 2" or something.

Tuesday, October 06, 2009

Pushing the bounds of technology

Like all people, I wonder what will happen when I die. And being a programmer, I came to the obvious conclusion: store my consciousness in a program that will live on in cyberspace in perpetuity!

So, after literally minutes of messing about, may I present the "Me" applet:-

Now you will able to communicate with me forever through the power of Java. Now if I can just hook it up to Blogger, I can keep writing blog entries long after they stop being funny!

Monday, October 05, 2009

Tips on maintaining your own interest in your own project (#1 in a series)

If you are sure that the game will be a good, entertaining game, then try to complete as much of the programming as possible before actually playing the game*.

(* This entirely contradicts my previous advice of "get the game up and running as soon as possible so you have something to play". I've decided that once you have something to play, the remaining programming tasks consist of the boring tidying-up programming, which has very little reward since you already have a game to play. My new advice is to keep programming all the little bits and pieces first. In addition, doing it this way will mean your original vision will remain in your head, and not be replaced by interest-sapping the catastrophe with temporary-and-crap graphics that you have programmed**.)

(** I hope this makes sense.)

Thursday, October 01, 2009

3D is hard!

During moments of niavity (sp?), I sometimes think that 3D should be easy and I'm just going about it the wrong way. Surely it's just like 2D, except you have to adjust for depth as well?

Unfortunately, it's nothing like as easy. For a start, with 2D, all your co-ordinates have a common origin, usually the bottom left, and you can tell whereabouts a sprite is in relation to the origin. With 3D, the origin could be anywhere, and usually each model seems to have it's own. In addition, working out where the origin is can be difficult, since it depends on where your camera is and what direction it is looking in.

You might have two 3D models, each facing zero degress (or radians, assuming you haven't got them mixed up again). But one is facing one way and one another. And their direction might change depending on the frame of animation they are in.

And why can't I see anything? Is the camera outside the scene looking outwards again? Or is it looking directly down, which seems to cause problems and make everything disappear? Or are the objects slightly too far away to see? Or maybe I need to add lighting to the scene. And why is one model approximatly 3 million times bigger than the other? Time to scale the models down a bit and then wteak their height so they are standing on the floor and not in it.

And why does my model move whenever I move the camera? Oh, I've forgotten that when I have a unit with a position of Vector vec, and I then do camera.setLocation(vec), it is using the same actual object (vec) for both the unit's location and the camera's location, so when one changes, so does the other. Grrr!

Monday, September 28, 2009

Potentially Useful Functions (#1 in a series)

The original aim of this blog was for me to impart my knowledge of programming, or for people to point out bugs and problems with my code. Either way, it was supposed to be about programming rather than subliminal advertising for my games.

This post aims to correct that, so to get things started here's two nice small graphics function that someone somewhere may find useful:-

This one rotates an image:-

public static Image rotateImage(Image inputImage, float ang_deg, ImageObserver ob) {
BufferedImage sourceBI = new BufferedImage(inputImage.getWidth(ob), inputImage.getHeight(ob), BufferedImage.TYPE_INT_ARGB);

Graphics2D g = (Graphics2D) sourceBI.getGraphics();
g.drawImage(inputImage, 0, 0, null);

AffineTransform at = new AffineTransform();

// rotate 45 degrees around image center
at.rotate(ang_deg * Math.PI / 180.0, sourceBI.getWidth()/2, sourceBI.getHeight()/2);

// instantiate and apply affine transformation filter
BufferedImageOp bio;
bio = new AffineTransformOp(at, AffineTransformOp.TYPE_BILINEAR);

BufferedImage destinationBI = bio.filter(sourceBI, null);

return destinationBI;

And this one scales an image

public static Image scaleImage(Image inputImage, int w, int h, ImageObserver ob) {
BufferedImage sourceBI = new BufferedImage(inputImage.getWidth(ob), inputImage.getHeight(ob), BufferedImage.TYPE_INT_ARGB);

Graphics2D g = (Graphics2D) sourceBI.getGraphics();
g.drawImage(inputImage, 0, 0, null);

AffineTransform at = new AffineTransform();

// scale image
float sx = (float)w / (float)inputImage.getWidth(ob);
float sy = (float)h / (float)inputImage.getHeight(ob);
//at.scale(w / inputImage.getWidth(ob), h / inputImage.getHeight(ob));
at.scale(sx, sy);

//at.rotate(45 * Math.PI / 180.0, sourceBI.getWidth()/2, sourceBI.getHeight()/2);

// instantiate and apply affine transformation filter
BufferedImageOp bio;
bio = new AffineTransformOp(at, AffineTransformOp.TYPE_BILINEAR);

BufferedImage destinationBI = bio.filter(sourceBI, null);

return destinationBI;

Needless to say, if anyone knows a better way to do this, or just tweaks to the above code, please let me know.

Thursday, September 24, 2009

A great idea, or maybe not

"Woah!", I hear you say. "Slow down young Steve. With all this blogging, you're going to burst one of the tubes!". However, I thought I'd mention a great idea I thought I had. See if you can spot the flaw.

I didn't watch Derren Brown pretend to predict the lottery, but his suggestion of using the Wisdom of the Crowds gave me an idea - why not create a website where people can enter their prediction for the numbers. The website will then show the average of everyone's numbers, and people can use those numbers for their actual choices!

Any mathematicians out there may spot the flaw sooner that the rest of us. So let's save me lots of time and programming and all just choose the numbers 24, 24, 24, 24, 24 and 24.

Changed my mind

Instead of Interstellar Forces, I'm going to call it Stellar Forces. Don't you go registering the domain you rascals!

Here's a picture of the website to celebrate the change of name:

Wednesday, September 23, 2009

Announcing: Interstellar Forces

I've finally though of a title! "Interstellar Forces" - mark its name my friend as you will (hopefully) hear a lot more about it in the future.

I've now nailed down the HUD, with its Terminator (as in Schwarzenegger) style text, and the Terminators (as in WH40k) for the models. I might replace these from some of those in UFO:AI though, as I think the licence allows this.

One thing that crossed my mind now that I've got to the stage of a 3D applet is all the other possibilities that have opened up for this code; I could turn it into a 3D RTS like Starcraft III, or write a Diablo clone, or anything my evil mind might think up.

Monday, September 21, 2009

I'm getting that fimbly feeling

There comes a time in a project (especially the more ambitious kinds) where it suddenly seems like you've managed to overcome all the major hurdles, and it actually will be possible to complete the game. This is also usually combined with the stage at which the project starts to take shape and you have something nice to look at. It's a great feeling, and it occurred to me when I produced the screenshot you see here, for my still un-named game.

The only drawback is that it's usually soon after this point that there are no challenges left, and the rest of the programming is boring donkeywork with no payoff until the project is completed. This is usually the stage where I lose interest and move to something else. Not in this case though.

Maybe it's because it's my favourite genre (squad-level turn-based strategy game) and I've got the inspiration of Laser Squad and LSN to look at, and it's going to be multi-player, but I feel like I'm going to see this one through to the end. Then the challenge will be the hardest one yet - getting people to play it!

Wednesday, September 16, 2009

My Magnum Opus

I've been a bit quiet on the blogging front lately, but there's a good reason: I've been working on my latest project, and I'm pretty excited about it.

In a nutshell, it's Laser Squad Nemesis with Laser Squad Mechanics (i.e. properly turn-based rather than We-Go). I hope no-one groans at that, wondering why I'm just copying another game. In my defence, AFAIK there is no open-source equivalent (or even closed-source). The main reason I'm doing it is because my most enjoyable gaming session was playing Laser Squad all day against one of my friends. It's a brilliant game, and never gets boring against a human opponent.

It should be noted that I've never actually played LSN; the only aspect I am copying is the fact that you can request games and play them against other people, while a server keeps track of it all. In addition, it's going to be a 3D applet (as the pre-alpha screenshot with the slightly broken z-order will testify) allowing the player to move their camera anywhere around the map.

So, it will come with it's own web front-end which will allow people to request/join games, take their turn, post messages, update halls of fame etc... Once a game has been accepted, players can equip and deploy their units and then take turns trying to fulfill their mission objectives. Needless to say, there will be several different kinds of missions, each with it's own special units like robots, aliens or plain old space marines (obtaining good 3D models notwithstanding).

This is a pretty ambitious project, incorporating a web server, 3D applets and networking, but if it will produce a game which allows me to play turn-based squad-level strategy games, then it's a task I'm looking forward to. And suggestions for a name for this game are more than welcome!

Wednesday, September 09, 2009

In praise of Google Code

I'm probably blogging a bit early about this as I've only been using it a few days and have yet to come across the world-destroying problem with it that everyone else except me knows about. However, in those few days it's been great to me; all I wanted was somewhere to store my source code and large downloadable zips, and for that it's perfect.

I used to use Sourceforge, but their website seems far too bloated and long-winded to do anything. If you want to create a project, you have to go through approx 7 pages worth of options before finally submitting it, and waiting several days before they "approve it", like they should decide what software is allowed or not. (Again, bear in mind that I've not even logged onto my Sourceforge account for several years now so it may have changed since). If you want to upload a large file, you have to ftp it to their web server, and then select it (from a long list containging everyone else's files) and then fill in some dropdown boxes about it's version or package name or whatever. Jeez, just accept the file with the name I've given it [already]!

Compare this to Google Code - to create a project you give it a name, a short description, a long description and blam - it's there ready for you to use. Want to upload a file? Just select it and upload it and it's there.

At least Sourceforge Smorshforge have taken steps to ease the downloading of files. You used to have to go to the download page, choose the package, choose the file, then choose the mirror, and then wonder if it's doing anything for 5 minutes.

I just wish there was a way to remove my projects from Sourceforge. And don't get me started on the number of projects at "Status: Planning"!

Tuesday, September 08, 2009

Concept Art

Concept art!? Pah, who needs it. It doesn't contribute anything directly to a project and just wastes the artists time.

Or so I used to think. However, I'm now coming round to the idea that it's a great way to engender interest and life into your programming project.

It's very hard to empathise with pages of code or small sprites, but concept art creates the world in which your game exists - in a way that you can actually see, rather than the original vision in your head which slowly fades away or gets distorted as the project fleshes out. The milieu is something that inspires people to continue working on a project long after the initial excitement has faded, and is a constant reminder of your projects original aim.

Thursday, August 27, 2009

To Applet or not to Applet?

Some free games require you to download the source code and compile it yourself. Some require you to just download and install. Others are just download, unzip and run. However, by far the easiest are flash/applet web games, where you just point your browser at them and that's it - once the game has loaded you can play it straight away.

However, maybe due to this simplicity, or maybe due to the fact that a lot of web games are simple in themselves, they are not treat with the same level of respect as games that require more work to start up. It seems that the more effort you are prepared to expend to get a game working, the more time you are prepared to spend on it.

(Taking this to the extreme, I find that when I play a lot of old Speccy games, of which I have many fond memories, I give them approximately 10 seconds of my time (since that's pretty much how long it takes to load it up nowadays) whereas in the past, when it took minutes, I'd play them for longer and give them far more of a chance. Actually, I think I've just invented my own axiom: "The time a player will spend playing an average game is directly related to how long it took to them to run it.". You heard it here first!)

Anyway, back to my point. I've got a game called Island Commander, which is an applet, but is increasing in complexity. However, because of the lack of "respect" that web games get, I'm tempted to turn it into a stand-alone game so that people will take it more seriously. In addition, nothing is more galling than seeing comments by people about games written as applets, all saying how much they hate applets.

Is it mercenary to make it harder for people to play the game in the hope that they will spend more time on it? Maybe my whole premise is wrong, and flash/applet games get played far more than stand-alone games. However, out of all the most popular free open-source games out there with large communities, I can't think of any that are web games.

Monday, August 24, 2009

Trawling My Own Archives (Part #2)

There are literally tens of directories in my newfound treasure-trove of old source code, and I'm slowly getting through them. It's taking a bit longer than it should due to my old habit of sharing common (but now missing) libraries of source code between projects and using network drive letters that no longer exist.

However, here are 3 more to whet your appetite for the good old days when games were simpler (so simple in fact, that even the author is struggling to find the point).

The first game is one I originally called Floater, in an amusing play on the gameplay of Thrust-type games. There's not a lot to this game at the moment - you float around in an Asteroids/Thrust kind of way and shoot some bullets, not that there are any baddies to shoot at yet. If memory serves, I planned to make this a network version of Thrust or something, a bit like Gravity Force.

The next looks like some kind of puzzle game, though again I can't seem to work out what the actual game is supposed to be. It's almost fun though, as you bounce a ball around lots of other balls, and kinetic energy is passed between them. I think I wrote this on the assumption that some kind of game idea would magically appear once the mechanics are in place. I'm still waiting...

I've saved the best until last - this one is actually quite good and almost complete, and has a point! In a nutshell its a top-down shooter, a bit like GTA 1 but without the cars. The "missions" (if they can be called that) are randomly selected, and range from killing a Terminator-like robot to killing a group of rioting vegans (I always like to include a bit of social commentary in my games). I might actually release this one since it looks like I spent a fair bit of time on it.

Friday, August 21, 2009

Cheating AI

While writing Island Commander, the temptation has always been to allow the AI to cheat, as this would make it so much easier to write.

A programmer has only two options when writing an AI if they want to make a challenging game: allow it to cheat, or to analyse the game so much that they can break down the "secret" of winning into something like a flowchart, where every situation is covered and has an appropriate response.

Needless to say, this is no easy option for anything above the simplest of games (can you imagine something like this for chess?). In addition, every time a change is made to the game, or a feature added, the whole "flowchart" (and thus the AI code) needs to be changed.

However, this is the only option, since if any situation is not covered, the human players will quickly identify it and take advantage of it, and from that point on, the AI is no competition. Something I have been told several times!

Tuesday, August 18, 2009

Trawling My Own Archives

I came across a directory in the depths of my computer's filesystem the other day, which had old programs that I wrote when I was first learning Java. It was a nostalgic experience, but needless to say, none of the programs lived up to their epic names, and most were good examples of brevity of code; there were utilities like "MailingList", which was a one-class Java program that read a text file and emailed it to a hard-coded list of addresses. Also "AutoRunSQL" would basically run a hard-coded line of SQL at regular intervals (why you would want to do this is left for the reader to guess). There was also something called "CommerceNet", which preceeded Ebay and was intended to be a protocol for buying and selling, which would have changed the world if anyone else had known about it.

However the programs were mostly games, which should come as no surprise. The first I came across is called "Mr Do". It shows how long ago I wrote it because I'd even forgotton there was an old game called Mr Do, and this is a simple but quite playable copy of it:-

There was also another arcade clone, this time Bombjack. It looks like I lost interest in this before I'd ripped all the sprites I was needed, so the player and the enemies are all squares. However, the game seems to be all there, even down to "vibrating" bombs.

Finally, what looks like a homage to old ZX Spectrum games from the early 80's, is something called "Roadster" which I have no recollection of, but that's hardly surprising since it looks like I spent a grand total of 8 minutes writing it. I've no idea what's even going on.

However, strangely, this game has given me some insperation for my next project, which will be based around laying down train lines. Nothing so complicated as Railroad Tycoon, but more of a casual puzzle game.

Look out for more programming gems coming soon! And if anyone actually wants any source code, let me know.

Thursday, August 13, 2009

Blindingly Obvious Programming Tips #3

I've not implemented this tip myself yet, since I've only just had the idea, but I thought I'd commit it to screen before it disappears from my head.

One of my peeves about programming are function calls with long lists of esoteric parameters. Stuff like "sprite.draw(10, 12, true, true, false, true);". Unless you can memorised the order and meaning of each of the parameters, you have no idea what that function call is going to do exactly. Multiply that by the number of functions in a typical program, and you realise that a solution is needed.

Some languages can get round this and have named parameters. I don't believe Java has those yet; the closest we have is javadoc annotations. However, my solution is pretty simple: create "constants" (or as close as Java will allow) with meaningful names that are simple booleans. Then the above function call can be re-written as


Much more understandable.

Tuesday, August 11, 2009

Some programmers shoot us all in the foot

I really like Linux, and use it whenever I can for work and home systems. However, every so often something happens which makes you wonder which side the programmers of Linux software are on.

The latest problem is to do with Remote Desktop in Ubuntu 9.04 - Jaunty Jackalope. I've been using Remote Desktop quite happily for a few years on earlier versions of Ubuntu, but now I've upgraded, it seems to have a problem - the "Advanced" tab is missing. This means I can't choose the port number, along with various other settings.

A quick Google later, I discover this gem:
And yes, I've removed the 'advanced' tab. 'Advanced' users know to how use gconf-editor to tunning applications. The advanced tab was a mistake I made. Blame me.

What? "'Advanced' users know to how use gconf-editor"? I like to consider myself an advanced user, but I've only used gconf once, and I always have to remind myself how to get to it. But how am I supposed to know that I even need to use gconf? And where in gconf (which is the equivalent of RegEdit) are the settings I need?

And how on earth can regular users be recommended to use Ubuntu with arrogance like this? It's like we want to build a wall between us and the kind of people we need to bring on board if Linux is ever to get into the mainstream.

Wednesday, August 05, 2009

Java/Ubuntu Graphics Problem

I do most of my development on a Windows box (even though I dislike Windows and much prefer Ubuntu) so I've not noticed this problem before, but it seems that Java software that uses non-OpenGL graphics runs like a dog on versions >= 8.04 of Ubuntu.

One thing I like about Java is that it generally runs identically on most platforms, but sometimes something comes along which stops that "feature" dead in its tracks. The KeyPressed/KeyReleased bug was one of these, meaning I had to write special code get around it. If you don't test software on all the platforms, you won't know about these issues (as I am finding).

I've only got two Ubuntu boxes to test on, and one of these is a VM (which can add its own set of problems), so I'd be interested if anyone else experiences this. And I'd really like to hear from anyone who has a solution!

Monday, August 03, 2009

Metal Glove Solid Update

Now I've improved the performance of Metal Glove Solid, I've turned my attention to the average graphics. This thread on the Freegamer forums (about another stalled Gauntlet-remake) contains some useful walls. I've grabbed these and stuck them in MGS, and this is the result:-

Pretty basic, huh? True, but it's the first version, and I'm combining the change in graphics with a new map generator, rather than rely on designing my own maps. Here we see two rooms joined by a corridor. Procedurally generated content is the future; this is it in it's most basic form, but even this can provide a million different styles of dungeon, so no two games will be the same.

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...

Friday, June 26, 2009

Another "Almost" Game

I had another idea for a game which I've started and now stopped for the usual reason. Originally, I was going to write a 3D FPS that doesn't use models, since it is a massive ball-ache trying to find appropriate models on t'internet. Instead, I thought about just using basic shapes or something, but because they are basic I can make them more animated: moving platforms, floors that go up and down, walkways that extends and then retract, you get the idea. Actually, writing about it now makes it seem like a great idea, so maybe I'll come back to this one. I'm thinking something like Mirrors Edge with a constantly changing environment.

Anyway, the idea then transmogrified - the kind of games that already use this "simple shape" theory are all the old classics - Breakout, Pac-Man, Tetris. Their graphics were nothing special but they were good games. So how about a game set inside another game? Maybe this screenshot will give a better idea of what I mean:

Those blocks are supposed to be the blocks in a game of Breakout. I intend to have a bouncing ball and maybe the puck. The player would walk around in an FPS-stylee, and maybe shoot all the blocks while avoiding the puck or something.

I even got as far as starting a Pac Man level:

I think it was this level that started eroding my enthusiasm. I realised that this game is going to take a lot of time to create all the 3D models for each level/game. Then there's the AI for all the unique enemies, the level design etc etc...

So I decided to (maybe temporarily) abandon it in favour of another game idea; an idea that uses simple graphics, no advanced AI, and is incredibly addictive. As soon as I have this idea, I'll let you know. Meanwhile, it's back to the Spectrum Arcade for inpiration.

Tuesday, June 23, 2009

Someone has used one of my ideas!

It was surely only a matter of time, since I have so many great ideas. However, to quote from this very blog from July 19th 2006, where I described a time-travel game device: "To give you a more concrete example, imagine Command and Conquor with time travel".

Lo and below, fast forward to 2009 and what has happened? Achron: "a real-time strategy game where players and units can jump to and play at different times simultaneously and independently".

I assume the cheque is on the post.

Monday, June 22, 2009

New Game! "Xenogeddon"

It's been a bit quiet on this blog lately. I got a bit bored of writing games that no-one wants to play. However, I've got a new burst of niavity and/or optimism, so I've knocked up something new in the vain hope that someone else might find it interesting.

Todays effort is an FPS by the name of Xenogeddon. It's basically Space Hulk by another name. You walk around an "abandoned" (read: not completely abandoned) and shoot stuff that looks like it might want to kill you.

True to form, it's not actually finished, but is certainly playable.