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

Ridiculous Stats Battles

A while ago I re-designed the post-battle stats screen for Ridiculous Space Battles. I was MUCH happier with this than the earlier versions and I loved the horizontal histograms for every weapon which showed not just how much damage they did, but how much was reflected or absorbed by each of hull, armour and shields. I think it was a vast improvement on what I had previously. However! there was much room for improvement.

The biggest issue was that the list of stats chosen didn’t seem to be that helpful. If your fleet was 95% frigates, why bore you with the ‘best’ cruiser and fighter weapons? I re-designed the system to show you more interesting key stats such as the most cost-effective weapon, the ship that was hardest to damage (toughest?) and the weapons that were in use the most (or least). These stats are way more helpful:

Although that was a big improvement, play-testing showed me that a key problem still remained (which is true of all auto-batllers), which was namely ‘How can I translate what I learn from all these stats into adjusting my deployment the next time I fight this battle? This is a big problem (and it was back in the Gratuitous Space Battles days), and I have experimented a lot and come up with a solution I am super happy with!

In hindsight, the solution is obvious. Give the player a way to view want went wrong last time, when they try the level again. In code terms, this was a ton of work, but it works!

So when a battle ends, after viewing the current stats (probably best thought of as stats-highlights now), if you then want to try the level again you have a togglable overlay over the deployment map which shows the fleet you tried last time, with a ton of stats for every single squadron showing how they did.

The coloured squares and the percentages show survival rates for each squad, and you get Survived/Escaped/Destroyed percentages as a tooltip, but click on any squad to see a pop-up with a bunch more stats, tabbed into defensive and offensive data.

And at any point you can use a hotkey (or the buttons at the top of the screen) to toggle from this ‘previous battle overlay’ to your placed deployment for your next attempt at a battle. This makes it SO MUCH EASIER to look at your deployment and work out what went wrong and why, and correct it for the next battle. It is also persistent saved-to-disk data, so you can come back to a failed mission months later and still see the battle stats from your last attempt.

I know the games development keeps taking longer and longer but its definitely getting to be a lot better as a result, and I would rather ship a great game late than a not-as-great game on time. Thanks for your patience, and for following its development! Since I took that screenshot, I have had a MUCH better idea for how to make that screen even better, and I’m working on that now. This means even more work, but its going to be awesome.

Auto-balancing and load-testing Ridiculous Space Battles

Its been a while since I blogged… Anyway I have not been completely idle. As well as booking a long-desired holiday to CHINA (oh yes!) I have still been working on this weird project that I cannot decide if its a retirement hobby or a proper serious game launch, and that would be my pretentious re-imagining of Gratuitous Space Battles, which I am appropriately calling ‘Ridiculous Space Battles’.

The game is very playable right now. It has a ton of content, and it runs great, and it looks fab. But it does not have data for the campaign games, and does not have the challenge system coded into it yet. I might at some point decide to put the challenge system off for a bit, and release it with skirmish and campaign games into Early Access. I really do keep changing my mind on that. This game has been very cheap to make, and I am under no pressure to release, so to be honest it feels kinda weird being able to do anything I like with it!

Anyway, something I have always wanted for my games was a pre-release debug build functionality to have them run hundreds or thousands of games and automatically provide data that would let me balance the initial stats before actual humans start to play it. Now if you are a relatively new developer, its easy to just sling out lines like “Yeah just code a headless mode that randomly designs ships and fleets and have them fight each other a million times to collect stats”. This is the sort of thing swaggering indie devs throw out in a reddit thread as advice, as though that single sentence contains all the required skill, code and effort.

Its not that simple.

Now if you have a much simpler ‘problem-space’, then it gets massively easier, but just the process of coding random ship designs and random fleet deployments is a major engineering effort in itself. Getting the game to be able to put together a ‘legal’ in game-terms design isn’t too tricky, but ensuring it produces sensible designs is another things entirely. There is nothing to stop the entire deployed fleet consisting of a hundred ships that only have anti missile defence weapons and zero offensive capability, for example. That would be a valid fleet design, but useless for auto-balancing. Worse, it would imply in the stats that missiles are useless, without the caveat of ‘yup but that strategy can never win a battle’.

Its a massive minefield of issues like this, an frankly I have not addressed any of them yet. My current code designs each ship in a fleet individually right now, so the chances are such anomalies would be highly unlikely. However, the point stands that a ‘random’ fleet design is not ideal. And thats before we start placing those ships in formations, and assigning orders to them based on their designs. I’ve done a bunch of wok on that, but its still not ideal.

The actual easy bit was the stats collection and amalgamation into a nice spreadsheet at the end. My game is very stats-based (its an auto-battler after all), so the code to track all those stats was already in game. What took a bit longer was the wrapper code to run through a battle with a random fleet, record stats, and then do the next battle. This *sounds* easy, but when a game has been designed on the basis of the user clicking buttons, circumventing that without errors can be buggy. I didn’t just simulate mouse clicks because I needed to totally skip the deployment UI for each battle. Otherwise I am flushing a ton of textures and loading a whole pointless UI between every battle, slowing down the auto-run process.

The real delay in this stuff has been two-fold. I need to code some sort of basic genetic algorithm for ship design, and I also encountered loads of bugs. Lets do the bugs first. Its easy to think ‘dude, you shouldn’t have bugs in your code’, but harder to make that a reality when you have a game as complex as RSB. There are over 720 source files for the game and the same amount again for the engine, and the code is fiendishly complex. Plus the actual GAME is fiendishly complex. For example, I encountered a crash bug while typing this (The game was churning auto-balance in the background). It was a crash bug where the game lost focus, then recovered focus (I had moved to another window), and it crashed in the shader for Target Painter weapons.

You might think ‘what a noob, you obviously dont re-init your shaders’, but nope, I do. This is obviously something specific to THAT shader. I have tested the game a lot, but apparently never alt-tabbed away exactly when the game was drawing a target-painting effect. Given how many different systems and visual effects the game has, its no wonder I have not churned through all the possibilities yet. This is one of the major benefits of writing this autobalance code. I am soak-testing my game, running thousands of battles and trying every permutation possible, and it throws up a ton of asserts and warnings and crashes, all in obscure and exciting places. I DO test new features when they are added, but testing them in every permutation of battle is impossible. I’d need 50 people working in QA.

So the last aspect of all this is genetic algorithms. I intend to try a bit of this but no go mad. Right now, I can only tell if ‘fast missiles’ are overpowered by looking at the amount of damage they do, over 100 battles, compared to their cost and weapon module size. If they DO look a bit overpowered, then maybe they should be selected more, to assess whether they are clearly a super-weapon, or if thy just happened to always get matched against fleets that had poor missile defence. Perhaps I need a system that takes the top ten weapons from the previous 100 games and biases towards them so I can concentrate on collecting data for them. Perhaps also do the same with the BOTTOM ten weapons so I can see if they were just badly represented due to random match-up.

And of course all of this is ignoring non-weapon modules. I should probably test the ‘survival rate’ or ‘survival time’ of ships with each armour and shield module or other defensive module like a decoy projector or cloaking device. Maybe these are hugely overpowered? I have not even begun to look at that yet.

One piece of excellent news though. My game is VERY good at pruning its memory usage and definitely has no leaks. I’m watching the area chart in the visual studio debug view as I type and its currently using 234MB (lolz) and rarely goes above 400MB in big battles. This is a vast improvement on my other games, or early builds of RSB that were leaky.

So there you go, I AM still coding, but not in a hurry, and I hope the end result is worth it :D. Don’t forget to add RSB to your steam wishlist if the game sounds interesting to you!

Ridiculous Space Battles Progress

Ok so, I know this is probably not a big deal, or a new thing… but I have spent so long with this blog casually embedding youtube video links, that it took until today in 2026, and my desire to do what I can to de-couple my life as much as possible from US tech companies for me to discover that you can just natively embed an mp4 in wordpress! So anyway… I present the new race-selection screen animation effect in Ridiculous Space Battles!

and yes… before you comment, I know there is a bug with a texture changing wrongly when I scroll to the left. I’ll fix that tomorrow! I am however, pretty happy with this code, and this look. Coding stuff like this is harder than it looks, because to have everything seem smooth and crisp, you have to basically render all of those windows to an offscreen copy (with alpha) and then copy them as scaled sprites to the screen. That sounds simple, but its a lot of management, as you keep swapping render targets, and have to very smoothly transition from ‘offscreen pre-rendered sprite’ to proper rendered and full featured window.

Trust me, its a pain. It took a whole weekend. Well… it took all the hours I worked this weekend (which was not a lot TBH…). Anyway, that is one new thing that is in Ridiculous Space Battles. Another change was the re-colouring and some adjusting of the deployment screen to make it more user-friendly and less BRIGHT COLORS:

This definitely looks better. You can also see that the range indicators from my last blog post are in there with less angry colors too. The next big thing on my list is to balance the various weapons, and in fact before that, I need to code systems that really quickly run a lot of battles super-fast for me to gather stats. That will be a whole rabbit hole of code, but should be fun.

So to recap, the things left to do before early access or alpha-testing are to balance the modules, to put together the campaign fleets, to test the campaign, and to implement and test online challenges. No doubt lots of bug fixes and optimisation to do too, but I love the optimisation bit :D.

Deployment Range UI for Ridiculous Space Battles

I have been a bit quiet on the blog front, but in case you were wondering, yes I am definitely still working on Ridiculous Space Battles! Right now I am thinking about the ship and fleet design for the campaign game, and this is forcing me to think more about the usability of the deployment screen.

For a bit of a history lesson, here is the deployment screen from the original Gratuitous Space Battles:

There are so many things wrong with both the style and the layout I do not know where to begin, but given GSB was the first auto-battler, there was both no competition, and no other examples to be inspired by. Anyway, one of the many bad things about this UI is those circles around every turret on every ship that were supposed to show the player the weapon ranges, but in fact just look like a confused mess. Here is my current version of the same screen in Ridiculous Space Battles:

I think its so much better… but specifically I am working on the range and fire arc overlays. They only show for ship(s) that you have selected, and one of the changes I have made is to color code them as red for short range weapons, white for mid range, and green for long range. Like *anything* in game UI design, there is no perfect answer here. Red for short and green for long feels right, as long range is generally good (assuming everything else is equal). Making mid-range yellow might be a step too far in mirroring those order strips to the right, so I decided to go with white…argghh…who knows!

The problems arise a bit once you have a bigger battle and with multiple ships selected:

Now the red is showing the combined overlay of the short range fire arcs for all selected ship weapons. Be aware a ship might have 7 different weapons, and could be in a 4-ship or 25-ship squad… Its a complex thing to visualise, but its getting better!

In addition to fiddling with this overlay UI, I have also been improving the ‘ship role descriptions’ that are shown as tooltips for a ship design. I’m basically approaching the problem in 3 different directions. Select a ship…and the overlay should show you its weapon ranges on the map. Select a ship-type at the top-left, and then hover over a weapon name, and you get that big tooltip (see the one for ‘Plasma Stream’ above), which lists everything, including range. If the range is especially low or high, it gets a colour (red/green) highlight. Thats true for shield and armour penetration too…

The thirds method is the mouse-over tooltip for the ship types in the top left ‘ship-picker’. The game analyses all ship types and gives them various descriptive tags (I call them Roles in code). Those might be ‘Mixed Range Weapons’ or ‘Anti-Armor’ or ‘SuperWeapon’, or a bunch more.

My goal is to be able to help the player remember which ship design is which, so they are not just blindly spamming down a bunch of ships and hoping for the best. Ideally you have some short range ships serving as tanks at the front, absorbing enemy fire and shooting down incoming projectiles, then deeper ranks are mid-range and long range, or ships with shield support beams. Choosing the right formation and deployment should be a big part of the game.

Anyway, thats what I’m working on right now. The list of stuff to do before Early Access release does keep getting shorter (I think). Anyway, don’t forget you can wish-list the game at https://store.steampowered.com/app/3607230/Ridiculous_Space_Battles/

Designing the orders system for ridiculous space battles

Yikes, this has turned into a really complex and confusing beast. I am very happy so far with the improvements, but I need to publicly brainstorm the details. Simply put, the orders system in Gratuitous Space Battles was a mess, and I needed a much better one, PLUS I wanted to add new orders to take into account the new gameplay style of Ridiculous Space Battles.

In GSB there was a whole bunch of orders, and they all apparently pretended to work together to come up with an opinion on which ship a weapon should target. Orders are per SHIP, not per weapon, which frankly is a whole other story, but I think it would be stupid overkill to have the player assigning different orders to every weapon. My whole unique selling point is BIG fleets with LOTS of ships. Anyway, the original game had orders like Attack Fighters and Co-operate, but it was never clear how they all worked together.

RSB introduces three new orders entirely. Raider (race ahead of the fleet up to a given distance to engage enemies) which is used by Fighters, Last Defense, which concentrates fire on the enemy ships that have got the furthest through our lines, and Breakthrough, which is for punching a hole in enemy defenses, and only fires on ships right in front of you (or in that row anyway).

Here is my new current implementation:

So the big things here are categories, color coding and priorities. OH YES. To explain, this ship has one ‘Special’ Order, which is to engage enemies at 2 squares range. Thats a movement order, so independent of all the targeting stuff.

The next order is ‘co-operate’. Its one of a class of (blue) orders I’m tempted to call ‘Discriminators’ or ‘Tie-breakers’. There can only be ONE of these (Co-operate, Vulture, Retaliate, Breakthough or Last Defense), and essentially they are used at the end of the process to choose which out of a series of potential targets is picked.

The Green and yellow orders are Target Criteria. They describe a target size class or a defense status (shields up, or shields down but armor intact, or down to naked hull). These orders are special because they are in priority order. (I realize now I should show the numbers!). So when the ship decides who to shoot at, it first builds a simple list of all enemy ships in range and fire arc, that match any of those criteria. (You can delete one to make the ship NEVER target those ships). Once that list exists, it then goes through the target criteria from top to bottom seeing if any ships meet that criteria…

And this is where I have a decision to make…

I can either stop the processing once it has one or more targets, then pick the best using the discriminator OR I can then keep filtering down through the list as long as I have 1 or more targets and THEN use the discriminator. I cannot decide which. Are you confused? I suspect so:

Example 1: Using the above orders, I scan my target list and find 4 cruisers and 12 frigates in range. All of them have shields. Cool! So I stop there, and evaluate them all using Co-operate, firing upon the one that is the most under fire right now.

Example 2: I scan my target list and find 4 cruisers and 12 frigates in range. All of them have shields. The NEXT criteria is Fighters. There are none in my list so I ignore. The next is armor. All 16 have armor so again I ignore. The next is Frigates. Wait! only 12 are frigates, so I prune the list. The next is Hull, all check. The next is cruisers, none found. I finally use co-operate to evaluate which frigate to fire at…

Is this dilemma even making sense, let alone deciding on a system? Its very involved. My game IS a complex strategy game, but I don’t want to rely on crazily complex tutorials. Now to be fair, Gratuitous Space Battles had a completely opaque system that nobody understood and was poorly explained and it sold a bazillion copies, so maybe I am overthinking it. But I would like to do a MUCH better job… I know SOME players would be happy to literally write code to control this stuff, and might suggest I add conditional clauses and other complexity but I think that makes the game seem more like work and less like fun…

Looking at it now I KNOW I need to add priority numbers to those yellow/green strips. Maybe they should be called Filters now Criteria? Who knows. I may need to think about this a LOT.

By the way add the game to your wishlist :D Or pester a news website to cover it! Or share a screenshot somewhere you hang out. That stuff all helps :D.