Game Design, Programming and running a one-man games business…

Memory allocation improvements

I’ve been working on about 16 different things, but one of them was to reduce the memory leakage of GSB. I know some people design very cunning survival-mode fleets and have battles that can go on for an hour or more, and basically GSB leaks memory quite badly right now. Also, if I ever want this game ported somewhere, it will need to get it’s memory use under control. Plus campaign games sometimes lead to some VERY big battle, which makes the issue worse.

Lots of fiddling around (writing my own memory allocation debug stuff) means I could watch exactly what was getting allocated mid battle. I dumped every memory allocation during battle to a text file, then chopped off the first 10,000 (so I don’t worry about early allocations, which are then cached and re-used anyway), so I could see what the long term persistant offenders were.

The next step was to ensure I was looking at the *amount* of RAM being used, not the number of small trivial 20 byte allocations. Those need optimizing too, but not now. To do this, I stuck all the text which looked like this:

file:..\src\GUI_Particles.cppline:429 28672
file:..\src\GUI_Ship.cppline:733 204
file:..\src\SIM_TargetedModule.cppline:905 48
file:..\src\SIM_TargetedModule.cppline:981 12...

Into Excel, and created a pivot table out of it, to nicely summarise each allocation type by number of calls and total RAM allocated. It was clear that particle allocations were rare, but huge. It was immediately clear that I was allocating memory for a big mega explosion even for the tiniest 7 particle fighter-impact effect. All I did was re-write the particle code to calculate on application-start what the maximum number of particles were that this emmiter could ever need, and then ensure it never allocated more than that when I created it.

Some more work with extensive debug display code mid-battle was done to ensure the new system was working as expected, and that the majority of the allocated RAM was indeed needed and being used.
End result? My test battle (Multari nebula, a fair few fighters, fought to the end with all options turned on) went from a peak of 403MB for GSB.exe to 305MB. That’s pretty darned good. The savings on bigger, longer battles will be pretty noticable.

Expect that improvement to be folded into a future update.

Gratuitous DLC Experiment

Ok, first things first, let me announce the release of a new race for Gratuitous Space Battles. They are called the nomads, and you can see more info here, and watch a video of them here (or below). And you can even go buy the new DLC here.

The idea for the nomads are a sort of retro-future race, suggesting a species that has been around a loooong time. They are travellers, and fighting purely for sport. They don’t come with any new technology or weapon types, but they do have a few extra tweaked ship modules. Also, there are not new singleplayer missions, this is just a race for you to use in existing scenarios, or in challenges.

Here is an embedded video showing off the new ships:

Now comes the slightl wacky bit. I’m selling this DLC for $5.99, just like all the previous races were, and there is no change there. If you are a long time GSB plauyer and just want the new race, then go buy it, it’s $5.99. That gets you the standard version of the DLC. There is also a ‘discount’ version of the DLC. The difference between the two is that one is $5.99 and one is $2.99. That’s it.

Obviously the standard one costs more, and I get more money as the developer. The discount one costs you less, and I get less. There will be updated stats on the page here showing who bought what.

It’s entirely up to you, which one you buy. You decide. I would obviously prefer you bought the standard one. Nobody will ever know what version you bought, the files are identical. This is a bit of a sudden manic experiment to see what happens. If you genuinely have very very little money and would have waited months hoping for a bundle or a sale, then you could make an argument you could get the discount one. If you frankly, *do* have the money to spare and would buy it anyway if there was only the $5.99 option, I’m asking you to do that.

This might make me look really stupid, but I’m prepared to risk it. I like trying new stuff in business. I think it will be interesting either way. Also, the DLC is more about promoting the game and making a bigger range of ships, so there is more variety. None of these expansions are really aiming to make money, the core game does that. ( I hope!)

Anyway, it should be interesting. If you find the time to tweet, facebook like, link to, blog or otherwise promote this experiment, I’d appreciate it. It could be interesting.

Cheers,

The current positech plan (posiplan?)

I see no harm in making my immediate future plans public.

In no specific order this is what I have coming up:

1) Release of the 1.47 patch to all partners (valve etc). I did this this morning.
2) Release of the new Race (The Nomads) On my site, in a slightly strange way (details to follow) then on the partner sites when I know it works ok. Teasing screen:

3) Talk to Steam and other partners about selling the Mac copy of GSB.
4) Pre-order / beta access and eventual release of the GSB campaign game.
5) Game IV.

This should last me a good few months. Hopefully the money lasts a good few months too. Ha!

In amongst all this, I’ll be taking the first holiday (only a week) since I moved house, and it will be my Birthday. I also have a visit from a  structural engineer today to tell me if my roof can hold up solar panels or not. I will be mr sad face if he says it cannot.

Nomads

I spent some time today on a new race for GSB. It looks like I’ll release this pack before the campaign is finished. I actually had expected to have finished the campaign and have released it by now, but it’s much more involved than I thought, so I’m still working on it. Once I’ve finished complete bug free playthroughs as 2 different races, I’ll get some people testing it for me, then there will probably be a pre0order beta thing, then release. That is probably another month (best case) of work.

So in the meantime, luckily I have artwork for a new race all complete, and am working on the data and the balance. There is nothing radically different in the race in terms of gameplay yet, but the style is interesting. The backstory is that it’s a very very old race, a bit like the dwellers from The Algebraist (Iain M Banks). Over the years, they have rebuilt their ships from the salvage of their enemies, so you will see that their ships have some rebel engines, some order engines, and various other components. They are also the first race to have multicolored ships. I’m calling them Nomads, and they basically fight out of sheer boredom on their multi million year journey across the universe. They have a cool retro look.

I was lying awake at 2AM this morning unable to sleep, thinking about new weapon and ship modules for that race. This pack will be different, likely no new missions, just the raw fleets for you to use. I had originally thought no new modules, but I think I’ll at least add some variants.

A lot of the more interesting ideas involve a ton of code, which I’d rather not do when I’m so busy with the campaign, but there is plenty of scope for module variants that work within existing parameters. I keep thinking that a very long range sniper laser with high penetration but low tracking speed and low damage could be interesting. Hopefully I’ll do some work on it tomorrow.

Improving the deployment screen in Gratuitous Space Battles

I found this really annoying when playtesting the campaign, and I know people have asked for it before. I want to know if this is an improvement, before I release it in a patch. People were getting vexed because they often had 5 or 6 or 20 cruiser designs of the same race (for example) and the silhouette icons were no help in picking them, so they have to use mouseover tooltips to pick the right one, which is slow. So i have experimented with adding the (cropped) name of the design to the UI: (Please click to enlarge)

Old:

New:

If you play GSB a lot, you might think “yes, I need this!”, but I’d like to know if you think it looks a bit cluttered, or messy, from the point of view of someone just trying the demo for the first time.

Edit: I tried it with a smaller font. Better? or too small?

Newer!: