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

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.

Is this game you designed actually any fun?

When you develop an entire game by yourself, there is a staggering amount of work to do. Coding, business stuff, marketing, testing, balancing, designing. And I think that the majority of people who ‘want to make video games’ tend to over focus on the design bit. The whole ‘I have an idea for a cool game’ bit. It might surprise people to know that this is the bit that I am least fond of. In many ways I am a cross between an AI/Engine coder and an entrepreneur who realizes he has to design games to sell that code inside. The whole ‘working out how the game will play’ side of things has always been hard and frustrating for me.

You might find this an odd thing for me to say for two reasons: Firstly, I’ve made a bunch of (I think) pretty innovative games. Kudos was the first turn-based life-sim game (AFAIK). Democracy was the first commercial game designed around a neural network and based on the aesthetics of infographics. Gratuitous Space Battles was the world’s first auto-battler game. There is no shortage of innovation there. Secondly, not many game developers would ever admit they don’t enjoy the game design bit. Thats the bit we are supposed to excel at right? Admitting you don’t enjoy that bit as much is almost blasphemy.

As is probably obvious, I’m autistic, and one of the ways this manifests is that I like, and even need… data. You can tweak your ad campaign or marketing strategy and see if sales go up or down by 1%. You can re-engineer your code and check that performance has gone up or down by 1%. But game design? How on earth do you know the game is fun? How do you measure if you are making the game BETTER with all those changes… or worse? And in the absence of such data, what the hell are you doing?

I think most fulltime game designers seem insecure, as they are always asking other people if what they are doing is any good! We have to, because its very very hard to tell. In some ways, designing a game is like writing a joke. You can put a lot of effort in, have some skill, lean on prior experience, but by the time you are finished working on the joke, it stopped being funny to you personally ages ago. If you spend your entire day staring at spreadsheets of weapon characteristics until your eyeballs are sore, the question ‘Is this spreadsheet fun?’ feels almost insane. There is a good reason many game designers are NOT avid players of their own games after release. We are too close to it, too aware of the mechanics, too aware of the areas we are not sure about. We saw the sausage being made, and we do not want a sausage sandwich for breakfast.

This might sound a bit depressing, and it would be more so if this was my first rodeo, but I’ve experienced it before as a musician. For probably 20 years, I was unable to just ‘enjoy’ music. I would listen to it from a technical point of view. I might marvel at the clean guitar tone, the incredible timing, the complexity of the arpeggios, but I was listening to it from a teacher and student point of view, not as an audience member. I can now mostly just enjoy music, but I’m still aware of the keys and scales and techniques…

Being ‘too close’ to your own work will always be a problem. You will not be sure your joke is funny, your novel is gripping, your music is cool or your game is fun. Its just impossible for someone so close to the system to evaluate it in the same way a customer would. There are however, ways to get around this!

One is obviously to ask a lot of people. Friends, family, fellow game devs. The trouble is that these people are normally pre-disposed to worrying about hurting your feelings. Not many people will say to me “Cliff, this sounds boring as fuck”, although over the years I’ve managed to find people who know me well enough to be aware they can be more honest with me than other people. Even so, its not disinterested feedback, and if all your friends are game designers too, you are hardly getting a representative slice of the consumer base.

A second technique is time. Take a weekend off, or a week off. Ideally a month off. Some novelists stick their work in a drawer for a YEAR and then come back to it fresh, and can evaluate it with a far better critical eye. Of course the problem here is you need to earn money, but if you can work on multiple games at once and swap them over, this might be an option. Its definitely a system that works.

A third technique is drugs. Yes I went there. I am quite boring in that my narcotic of choice is just good old fashioned alcohol. Its not like I am permanently drunk when designing (am I making this denial too strongly maybe?), but I *do* drink, and I do my best to learn to ‘channel’ the feeling of being drunk when thinking about game design. The reason? when you are uninhibited, you have a different emotional response, and I think that change in emotional response gets you closer to the enthusiasm of someone seeing your work for the first time. Drunk cliff can watch a battle in Ridiculous Space Battles and have no greater design insight than “WHOAH LASERS!”, and if thats the response to my game, then I am totally fine with that.

In fact ‘Whoah Lasers!’ is a good name for a game.

Anyway, I offer this blog post as counterpoint to the idea that game design is something that you can get from a text book and can be quantified and analyzed with ‘player verbs’ and ‘core loops’. Ultimately what you are trying to do is make something FUN and this is no different to making something FUNNY. Its folly to suggest there is an equation for either humor or fun. Making something with either of these attributes is hard, and fuzzy and it doesn’t come easily to everyone. Certainly not me.

But obviously I need to reassure you that Ridiculous Space Battles will be totally fun. Its currently 92.65% fun by I am optimizing it. You can wishlist it now etc. Wouldn’t that be fun! (am I funny?)

Ridiculous Space Battles Design Goals

In case you missed it, I am doing a total re-imagining of Gratuitous Space Battles, 15 years after the first game, and calling it Ridiculous Space Battles. This is a sort-of-hobby semi-retirement project that I have got super into. I thought it worth laying out what I think is to be gained from re-doing the game.

Firstly,. yup its still a 2D top-down game being made using directx9. I know a lot of developers will think it mad not to go 3D, and mad not to use unity/unreal and to use directx 12 or whatever the latest version is (I don’t care), so let me address that first. I do not think 3D games are automatically better than 2D ones. In fact most of the time I think they make a game hugely worse. Having enjoyed the Company of Heroes and Age Of Empires games over the years, I can attest the the fact that when really enjoying the game, rather than posing to get screenshots for magazines, the best approach is to just leave the camera locked and play them as 2D games.

But oh noes! the horror! How can I not want to zoom in and see the game in a first person POV? Well I have the Battlefield games for FPS views thanks. Playing a big strategy game in 3D is just deliberately making things hard for yourself. People who make promo videos may enjoy letting the camera strafe around one of their units because ‘its cool’, but in terms of actually playing the game and working out whats going on? No. Humans are still basically 2D thinkers. Most strategy war games still work best in 2D, even if you want to use 3D meshes and 3d hardware to draw them. I prefer RSB as a 2D game.

As for Unity/Unreal. Ha. Fuck off. No. I do not want to spend these happy hours when I’m working on my dream game working out what bullshit combination of middleware actually compiles or works. I do not want to be begging developers on middleware forums to explain why their API crashes or beg for source code. I do not want a random ‘engine update’ to totally break my game, give me random crashes or just not compile, or trash the performance. I want to OWN and CONTROL all of my code. And the idea of paying a percentage of revenue? LOLZ. Its that real? I cannot imagine people being so beholden to some 3rd party. I’m typing this on a logitech keyboard. They don’t ask for a cut…

So yup, 2D and own-engine it is, at which point TBH the effort of switching to Directx11/12 is not really worth it. DX9 is the ‘sweet spot’ for 2D stuff for me, because I know it inside out and backwards. I could maybe take advantage of some newer API stuff, but the tradeoff is relearning enough code that it would become frustrating and no fun. So no. Besides I’ve made it look quite good just with directx9:

So thats the tech stuff. What HAVE I changed and why? Well basically the big changes are as follows:

Grid based deployment.

Gratuitous Space Battles had a ‘deployment zone’ but let you do pretty much what you liked inside. As I recall I ‘tried’ to prevent you putting ships on top of each other, but people managed to hack it. The result is a huge ‘scrum’ where people stacked massive capital ships into tight bundles. Little dense islands of spaceship that were insanely hard to defeat. Thats fine, thats a player prerogative, but it went against a core design principle of mine: ‘In play, the game should look cool’. When ships overlap it just looks bad. I call this ‘total-war gameplay’. The total-war games always had great setup formations, but once battle was jopined they all just looked like a punch-up in a bar. I hate that. So now ships stick to their assigned grid formations. Except fighters, that can raid ‘ahead’ of the fleet.

Fixed squadron size.

GSB let you have any combo of anything, but RSB lets you deploy units into a grid square. 1 cruiser or 4 frigates or 25 fighters. Those are your options. This simplifies gameplay a lot, and I think 95% of players never adjusted fighter squad size anyway. It also means its super easy to place really organized looking fleets. This also contributes to the ‘huge battle formation’ aesthetic.

Simplified Orders & movement

RSB units have a ton of orders, but they do not retreat to repair, nor are there any escort orders (they are no longer required with fixed formations). This simplifies things, and makes the game more clearly a game of ‘design ships and place them in a group’, rather than ‘chain together some complex orders like you are doing shader programming’. It might allow for less esoteric combos but I think it is much easier to understand and control. GSB players often wondered where the hell half their ships were going and why. In RSB its simple: The lead ship maintains the fleet position, and moves forward as enemies are destroyed. Movement of ships is only on the X plane.

Defend the line gameplay

This is the one I am not sure of. The win condition for the player is to destroy the entire enemy fleet. The lose condition is triggered if any of the enemy fleet makes it to your (left) side of the screen. Its done mostly so you have to have a proper distributed ‘line of defense’ which looks cool, but it might be too arbitrary. I will likely tweak this and solicit feedback from players when the game goes into early access eventually.

So there you have it. I made a bunch of changes from GSB. I will be doing a challenge system online just like GSB. This one will use the latest version of PHP and be way more stable! I have not started work on that yet. There are still a ton of things to be done in the single-player version yet.

By the way, if you think this game sounds interesting, it would be super cool if you added it to your steam wishlist:

Ridiculous Space Battles: how and why?

Its 15 years since Gratuitous Space Battles came out, and when I announced a few days ago that I was making this game, I said I’d been working on it for 18 months. How come? Why not announce sooner? and why am I making it, and why now?

After I made the last expansion pack for Democracy 4, I took quite a bit of time off, because I had the mad idea to build a solar farm. This literally took years longer than it was supposed to, and swallowed up a ton of time, and effort, and caused me an insane amount of stress. Even though the farm has been generating for 6 months, its STILL causing me stress and still not properly finished. To put it mildly, during this time I did not have the energy to actively and publicly be working on a new video game.

Any indie game dev will tell you that it is a super stressful job, and a very very hard way to make money. I can say with experience now that solar farm development is 10x as stressful, so that took its toll and meant there was absolutely no way I would also announce a new game. I simply could not cope with having to deal with people asking me about the game, or asking when it would be done, or telling me it was a bad idea and that I was doing it wrong. I had multiple bouts of screaming and tears over the farm. No way was I going to add more pressure or work on top.

You do not know stress until you have personally financed and managed a project like this. Gamedev is easy.

So as a sort of ‘hobby project’, I decided ‘for fun’ to make a little space shooter game using the assets from Gratuitous Space Battles and its DLC. This was a fun project to work on. I coded it all completely from scratch, with a new engine, because I actually find writing engine code (2D but using 3D APIs) to be genuinely relaxing. I know most people would not agree, but thats me. I got quite into this game, and eventually made it public, and put it up for sale on itch.io and on steam. I’ve since stopped using itch, as they ignore requests to pay developers for months, but you can still grab that game on steam:

Anyway, I enjoyed that enough that I ended up making a proper game rather than a little vertical scroller. The amount of change this early game went through is huge. At one point it was called ‘paint by spaceships’, where you basically had microsoft paint, but with brushes that deployed formations of spaceships. To this day, the game’s project folder is called PBS.

A screenshot of ‘Paint By Spaceships’

That then got changed to a game called ‘convoy’ which was like GSB but entirely about protecting a convoy of freighters from enemy attack. The Visual C++ project for the game is still called CONVOY. That then morphed into a ‘re-imagining’ of GSB, called Ridiculous Space Battles. I had decided to re-code everything entirely from scratch, because I prefer to do that rather than hack and bodge together 15 year old outdated code.

At some point I decided that re-using art assets from GSB was a bit boring, so ended up buying stock 3D art packs and kit-bashing together my own new art for the ships. At this point, solar farm dev was less intense, and I was working 40+ hours a week on the new game. I even spent some actual money on the art packs and some new textures for backgrounds and planets, so suddenly this was less of a hobby and now an actual new commercial game I would release.

I am in a very very fortunate position as an indie game developer, in that I have had a run of hit games, starting ages ago with Kudos, then Democracy, then Gratuitous Space Battles, the Democracy 3 and 4 and Production Line. I also published Big Pharma, and I invested the profits pretty cannily. Thus I made enough money that retirement beckoned. Early retirement no less! what a luxury. I then decided to spend a gratuitous amount of money on a solar farm. I do not know if it will break even yet… but even so, I am in the fortunate position of not *needing* RSB to make a huge income. I do not have to stress myself half to death chasing reviewers and streamers and youtubers. I do not have to manically work 60 hour weeks on it, or beg people for wishlists and bundles and marketing opportunities.

However…

I am now super proud of what I have made. Having a ‘second go’, from scratch, at a game idea from 15 years ago, with no financial pressure is a huge opportunity. Realizing very late that I somehow invented an entire genre (autobattlers) and never really capitalised on that is very motivating. When I look back at GSB, its a very very innovative game, but it was a first-go, and suffered from a load of obvious game design mistakes. Why not right them, and try to make the game GSB should have been? Even if it makes no profit at all, but just leaves behind a game I am proud of, and a small percentage of GSB players bought and enjoyed and brought back good memories, thats definitely a good and worthy thing.

An early design for the main menu

As of today I have not sent a single press release or told any journalists about the game. I am building up to it. The game is actually playable, and looks lovely, and I have a never ending supply of awesome screenshots. I could do a trailer right now, but I am thinking about getting new music for it before them (it currently uses music from GSB, which is…ok, but could be more modern perhaps). I also have no real release date, and a very flexible schedule and design.

I am also really enjoying writing the code for it. I updated from Visual Studio 2013 to 2022, which actually went extremely well. I am sticking with directx9 but pushing it to its limits, and doing it in a way that will be tons more stable than when I attempted it in Gratuitous Space Battles 2, which had technical issues :(. I have way better tools to develop the game now, and 15 years more coding experience. I also am happy to stick with top down 2D graphical style. GSB2 did mock-3D lighting and I don’t think it was worth it. Sticking with simple 2D gives me other options to ramp up the crazy spectacle, and its working well.

I’m already pleased with how the game looks, and it will only get more ridiculous

So yup, expect a lot of technical coding blog posts (and design ones) over the next few months.! In the meantime you can add the game to your steam wishlist now :D

Designing a system of orders for units in a war game

So… I am sort of working on a game as a hobby. It may never be released. But anyway, lets pretend its a Napoleonic war game.(its not). That allows me to at least talk in non vague terms. I am stuck slightly in the way I am designing a core part of the game.

Imagine a game where you have to place down a large number of units, on a map, and give them orders. The game then plays out the resulting battle against a pre-placed AI enemy. These days the kids call that an autobattler, but AFAIK I made the very first one (Gratuitous Space Battles), so I didn’t have a name of it back then. Anyway…

The goals in the design for such a game are actually quite complex. The system needs to be intuitive, so it can be played easily by a fairly casual gamer, but also provide depth where possible, must ensure that the way things play out goes as expected by the player (they feel like they had real control over events), and must result in a visual outcome that looks appropriately cinematic, and not just like a bunch of idiots in a bar room brawl. (This is my #1 critique of all the total war games, that seem to descend into this). These goals are actually quite complex and conflicting, and I have spent a lot of time and code trying to reconcile them.

Formations

One of the clearest places where stuff falls apart is when it comes to formations. If you have a long line of units, and declare them to be a formation, then you are expecting them all to operate as one. My solution for this was to make all the units but one the ‘dumb followers’ of this one independent formation ‘leader’, which would be free to care about other orders. If the leader moves forward, everyone in the line also moves forward. Sounds simple enough to design & code right?

Nope.

Firstly, the leader may die. In that case we need a new leader, so the system has to hold an ‘election’ to pick the most appropriate replacement. Initially I chose the largest unit at the time of election, but you then encounter issues where the lead ‘unit’ may weaken down to 1% health, but is still the leader. Ideally there are periodic elections to ensure ‘leadership’ is tied to current strength, but this needs to take into account units healing and not result in leadership ping-ponging etc. Also in my game the ‘strongest’ unit does not necessarily visually make sense for deciding who leads and who follows. Just picking a leader is complicated as it is.

Its amazing what good condition the grass is in after a thousand soldiers have cartwheeled around on it to form patterns.

Secondly, how is the formation maintained? A line of units that represents a column in the Y axis looks good at the start of battle, but is the formational-consistency based on the initial x/y offset or does the line ‘wheel’ around the leader? If the leader turns to the left are we now doing a wheel adjustment? and if so, shouldn’t the leader be the unit in the middle, not the strongest?

Thirdly how do we handle gaps? If half the formation is destroyed, does our line now close ranks to form a thinner line? a shorter line? or do we just ignore the holes and continue as a depleted sparse formation? What would the player expect, and what looks coolest?

Engagement Range

This is the one that has just stumped me and made me write this blog post. For example, lets presume that your unit is not in a formation, but it has an ideal range to engage the enemy, due to its weapons, of 800 meters. How do we take into account this engagement range (and maybe a minimum range of half this?) when deciding where on the battlefield we need to be. So for example, a unit of cannons is looking all over the battlefield, thinking ‘where is the place I should head to now?’. How does it decide where to go?

The first system I have coded looks ahead and slightly to each side, and evaluates every square it could move to and gives them a score. For each square, it looks at all the units, in all the nearby squares to this potential target site, and counts up the values of all the potential targets for each square. There is then some minor tweaking to penalize far-off squares, and a hellishly complicated system of ‘reserving’ and ‘occupying’ squares so that the units don’t all end up stacked on top of each other. All of this code is written, and to some extent it seems to all work but…

…you then get the Total War bar-room brawl situation because it turns out that with this algorithm the ideal place for every unit is to be slap bang in the middle of the battle where it can shoot at absolutely everyone. Hence the big furball of messy collision in the middle of the map.

My first thought is that this is just something needing a minor tweak. If units heavily prioritized locations where enemy units were within a certain percentage of the engagement range (in this case say between 600-800m) and actually penalized places where enemies were within that range (say under 600), then you would get the long range units more sensibly placing themselves at a nice aesthetically pleasing distance where they could shoot at each other in a classic war movie style.

I can throw a banana further than this. WTF is their engagement range set to?

The Bigger Question

However, I am starting to wonder if that is all a load of bollocks.

There are three different scenarios under discussion here. The military reality of what makes sense in a real war to win a battle. The movie version, where the goal is to look cool, and the game version where the goal is to be fun, and intuitive and satisfying to tinker with as well as watch. I have definitely been starting from a real military position, which is at the total other end of the spectrum in terms of where I need to be (a fun game!).

One of the primary drivers of the code I have written so far is that it is supposed to seem like it makes sense for military units to do this. But as a game, I kind of don’t really care. Games are not vaguely concerned with the inconvenient truth of military history. We want things to feel fun, even if that means the choices make little sense. It might be TRUE that a line of 10 gatling guns on a hill could obliterate an entire roman legion, but after seeing it once, is it still fun? Not really. What wargames like this focus on is a sort of block-puzzle game, where carefully mixing and matching and positioning units ‘unlocks’ a solution, which is a complex feat of ‘combined arms’ resulting in a close victory.

One of the great things about modern gaming is we can make some really cool special effects, and use massively powerful video cards to draw amazing spectacles. That takes a bit of the pressure off of designing a game that is so intricate in the abstract. I used to play a tabletop war game called Starfleet Battles. Its LUDICROUSLY complicated, and a single turn can take an hour with a group of players. The ‘fun’ comes from the complex interactions of highly detailed systems. It has to, because the actual experience is just hours staring at pieces of cardboard on a map, hoping nobody sneezes.

I was ludicrously obsessed with these games back when I was young and before electricity was invented.

Simplification

I’m not exactly known for simple games. But there are certainly companies that outdo me. The Hearts Of Iron games are just way beyond me, in terms of the amount of stuff to keep track of, and Eve-Online has become a game seemingly more involved than life itself. These games also have 100+ developers working full time, and this game is a hobby project I am spending an hour or so a day on, so its not going to go in that direction…

…and genuinely I am starting to consider the idea that my game should more resemble a simple puzzle game more than a complex uber war simulator. The amount of variables will still be high, and the outcome very pleasing. I think the cool ‘fun’ element of games like this is ‘I tried this… it failed, but was an awesome battle. I’ll try again’. It shouldn’t involve multiple hours of tweaking individual units decimal points in the AI decision making. Maybe the whole army is always just ONE formation, and it just moves right at the enemy as a single cohesive pattern? Maybe all the complex route-planning AI is utter bollocks? There are definitely a ton of much simpler games out there that seem to do this. I wonder if thats what a ‘roguelike deckbuilder’ game is? (I am sick of the term, but still don’t really understand what it means tbh).

Anyway, it might all be academic, as I might get bored and make something else. But I might not :D.