Monthly Archives: July 2009

Ok, so here is the current (and close to final) layout of the fleet deployment screen (click to enlarge). The new thing that has gone in, and was a long time coming (apart from some UI tidyups, and better support for the range of possible screen resolutions), is individually highlighting weapon ranges.

You can see that I’ve moused-over one of the icons for this ships modules (Light Plasma Launcher), and the range of that weapon from the ship is shown as a bright white circle around it. The faded out circles represent the ranges of this ships other weapons, and by mousing over them, I can see which is which. This will make positioning ships better much easier, and will remind you what ships are suited to particular roles.

One thing that isn’t done is offsetting those ranges to take into account the modules placement on the ship. It will not make a big difference, but maybe it’s worth doing. For the big ships on small maps, it’s probably worth putting certain weapons at the front.

The Manual

July 19, 2009 | Filed under: gratuitous space battles

I started work on the manual for GSB today. It’s going to be a pdf that’s installed along with the game, although I am tempted to also make it downloadable before the game is finished, so people can give feedback on the game design.

The good news is that I now have a list of 16 things I need to get done before the game will be alpha, then I need some alpha feedback and I’ll be looking at beta. Some of those 16 things are pretty big, and will take days, some are small, like doing an icon.

One of the bigger ones is the manual. It’s surprising how much information I need to put in it to explain the mechanics of the game, without adding lots of stats stuff such as all of the ship modules and race backstories, which I haven’t done yet. I need to polish up the formatting, and get up to date screen shots for it all too, plus spellcheck, check the grammar blah blah.

Those 16 things do not include graphical fluff and polish which I also intend to get done, but some of that might be done when I’m waiting for alpha or beta feedback.

It’s good to have some sort of plan for getting from here to release anyway.

Today I did some tests on GSB as I expect it to be played eventually by hardcore gamers. That means the biggest mission in the game, hundreds of fighters on each side, huge fleet, huge map, with all graphical options turned on and fullscreen in 1920×1200 (highest res on my monitor). To my delight, it handles it pretty well, dipping below 60FPS only a few times when viewing complete mayhem. (Geforce 8800 GTS on vista, Core 2 Duo)

That’s a release build, but with debug symbols in it, so it might get a tad faster.

In this build, under those circumstances, one of the slowdowns is the debris. Not the rendering of it, but the creation of it. I cap the debris at 4,000 items. 2,000 in each of two ‘pools’. The slowdown was some code that basically did this:

for(each debris item)
{
if(isfree)
{
return debris item
}
}

(It was cleverer than that, in that it only started its search from where it left off last time, to minimize wasted checks, but you get the idea.).

The slowdown was literally the loop hassle of going through maybe 2,000 checks of the ‘free’ flag, with theoretically it being the case that only number 1,999 is free for re-use (or none of them).  Readers with long memories may recall I had implemented a periodic debris-defragger, which makes this stuff easier. However, I can’t be doing that every frame, so I tried out a new system today. (after a few false starts). The new system is fiendishly more complex and works like this:

There are 10 debris ‘free registers’ which are basically indexes into the array of debris. These registers identify debris items that are currently free by their index. Whenever I’m processing some debris, if it becomes free (fades out size or alpha-wise) I notify the pool to stick its index in any empty ‘free register’ that it has. This means finding an empty free register, but there are only 10, so it’s super quick.

Then the new piece of code to get some free debris does this:

for (each free register)
{
    if(register is valid)
    {
        return register[x]
    }
}
for(each debris item)
{
    if(isfree)
    {
        return debris item

}
}

This checks if any of the registers have any free pieces of debris, and if they are free, I re-use them (and note that the register is now blank). If all the registers are blank, I must have allocated more than 10 debris since I last let any fade out, so I need to go through the whole list as usual to try and find some free ones. If that fails, I check for some that are offscreen (I maintain a separate register of those), and if even that fails (we have 2,000 live debris onscreen!), I just randomly kill one and use that.

This chunk of code takes half the time the old one did, despite having more code in general. Does that mean its 50% faster? or 100% faster. I can’t get my head around that. If anyone can spot anything I’m doing thats stupid, I’m not above being humiliated in the comments with a smarter algorithm :D. I picked 10 as my number of registers in an arbitrary fashion. I should fine tune it really.

Formatting code in wordpress is a nightmare. BTW, this isn’t C++, this is simplistic pseudocode with about a quarter of the detail :D

I was chatting to Jeff from Wolfire a few weeks ago about their game overgrowth, and we started experimenting with ideas for cross-promoting our games. Since then I’ve been insanely busy, but I did get as far as putting this rather cool, and (to me) amusingly rabbit shaped spaceship (complete with Overgrowth logo) into GSB:

Why a rabbit? Well I think I should let Jeff himself describe what the rabbit connection is:

“Overgrowth takes place in the savage world of Lugaru where rabbits, wolves and other animals are forced to use paws, claws and medieval weaponry to engage each other in battle. Combining 3rd person adventure platforming with intricate melee combat, Overgrowth achieves a unique feel. Overgrowth also benefits from Wolfire’s brand new Phoenix Engine which has been built from the ground up to allow the use of cutting edge graphics, animation, and physics.”

Overgrowth certainly looks like an amazing game. I remember being impressed by the original Lugaru game, and OG looks like it will be a big hit.

The thing I find really interesting though, is the way in which our companies can do stuff like this, where we promote each others games, even stick content from one game in another, with the minimum of fuss. When I suggested we stick a rabbit ship in GSB to see how it could work, I didn’t need to get my lawyer to talk to wolfires lawyer. I didn’t need a strategic planning meeting with the head of corporate strategy, or have to justify to shareholders why we should help out what they would see as our competitors…

This is what I like about the Indie attitude.  Indie devs often share tips on game coding, getting decent contract work done, promoting websites and running forums, even the financial side of the best payment providers and who knows a decent accountant etc.

Can you imagine the head of EA giving the head of Activision tips on how to save on their bandwidth bill?

This is the indie attitude, and the indie advantage. We tend to take it for granted, because at the end of the day, me and jeff are two guys who love games and love making games. Somewhere along the line, the mainstream industry forgot that.

It took me a while to get support for this in. I still need some decent tools to get my particle effects placement faster and easier.

Anyway…. there is now some basic LOD support for particle emitters and the debris particles. That means I can have buckets of both and only render what I need (although tragically you still need to update a lot of it for consistency sake). here’s a screenshot showing debris increasing as you zoom in. It doesn’t look like I’m zooming in the way I cropped the screens, but I am :D

It’s faked a bit with a sudden detonation, so the screen looks a bit sparse, but it looks very cool in the game :D. It’s nice that it fades into view rather than having any popup.

I’ve been adding in hulk textures for all the frigates today, doing texture-atlases for the fighter hulks, and re-rendering some of them to prevent black jaggies around them at low zoom, designing some more AI fleets and generally fixing and tweaking.