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

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.

Gratuitous Space Shooty Game released!!!

And you probably thought I wasn’t still making games right?

After the long and intense development of Democracy 4, which is a HUGE sprawling game with a LOT of code, and a ton of content, and is now in about 10 languages and has 3 expansion packs… it was nice to be able to make something small, and simple, and not at all commercial or serious. With that in mind I started messing around making a space-invaders style vertical shooter, using the art assets I have from an older game of mine: Gratuitous Space Battles.

GSB is pretty old now, but TBH the spaceship graphics for it still look incredibly good to my eyes. I generally think its very wasteful that the games industry hires so many people to make music, SFX and graphics, and then makes a single game with them, never to be re-used in any way. Frankly a spaceship is a spaceship, whether its used in an RTS or a shooter or a turn based grand strategy game.

I know some people worry that gamers will bombard you with abuse for daring to use the same artwork in another game, because they will feel ‘cheated’. This strikes me as utter nonsense. Sensible re-use of assets just makes sense. As a general principle I hate waste, and I love efficiency. Also, not doing something because a tiny, tiny percentage of vocal gamers may complain about it is definitely a losing strategy in gamedev. There are always people who complain about any choice you will make.

After working on this game for a bit, and initially thinking it was a little throwaway thing I’d probably keep to myself, I started to really enjoy its development. I have never made a vertical shooter, but I loved Star Monkey, which is very old, and I am old enough to remember the first space invaders arcade cabinets as a kid, as well as Galaxian (far superior imho) and then Phoenix and the rest. I also spent a lot of time playing Astrosmash on our intellivision console as a kid.

Gratuitous Space Shooty Game is a bit of a mashup of a lot of those shooters, with some extra ideas that occurred during development. My wife playtested it a lot, and HATED the asteroids, so I added a repulsor beam to keep them away from you. Once implemented, it became a very cool new gameplay mechanic, as it allowed you to ‘balance’ attacking ships above you to get some extra shots in before they leave the screen.

During development I experimented with a bunch of ideas, and after a lot of playtesting, I’m happy with what I chose to do. The fact that you can accidentally shoot ship bonuses gives the player an incentive to keep moving and not risk a volley destroying a bonus. Penalizing you for every ship that escapes, INCLUDING the left-right ‘saucer’ ships also adds to the challenge. Making it so that the best power-ups are only dropped by those ships was also a good move from a design POV. Adding friendly ships you have to avoid is an evil mechanic, but its still in there!

In the end I went with 25 levels, and the levels get slightly longer as you go along. I don’t do any adaptive difficulty stuff, although I considered it. I do offer 3 difficulty levels from the start though. The top one is seriously hard. In-between levels you get to spend your cash, earned from shooting aliens and collecting bonuses (and a cool 10% bonus if nobody escapes) on upgrades for your ship.

Right now the game is only on itch, for $3 with a suggestion of $5 if you want to. It will not be a big financial success :D. Because I was doing it for fun, its currently windows only, and fixed aspect ratio of 1920×1080, or scaled to fit fullscreen. Windowed option literally went in the day before release :D. Its English only for now. I may try a google-translate for the limited text at some future point if I do an update to it.

So there you go, its another game by me! the first non-strategy one for a long time. I’m quite proud of it. Its a fun short laptop-friendly game you can play in lunch hour or multiple coffee breaks. If you like the look of it, get a copy!

Making a hobby game!

I’ve been getting very motivated about a little hobby game I’ve been working on in-between dealing with solar farm stuff, and playing the guitar. I have a lot of really cool space-game assets from my old game (some might say classic!) ‘Gratuitous Space Battles‘ and it just feels wrong to have all the art to make a space-invaders style game and not just do it! I decided to call the game ‘Gratuitous Space Shooty Game’.

I am so disorganised that its simpler for me to code a new game engine from scratch than find the hard drive with GSB code on it (or at least all of it), but luckily I have time plus experience, and I can type stupidly fast, so I’ve basically written a new game engine for this little hobby project. Its nothing amazing, the game currently only uses 2 shaders, no clever effects, no amazing visuals, just a simple ‘shoot at static sprites and enjoy some primitive particle effects’ style game:

Obviously its 2023, so just making simple ‘space invaders’ wont cut it even for a hobby game, so there is a lot of influence from stuff like galaxian, and pheonix, and all the other space shooters out there. Right now, the alien movement is very generic and simple, and nothing to shout about. No fancy splines, just left right and down!

The thing thats motivating me about this game is the small scope, and ease of adding new stuff. When I work on a giant commercial game of mine like Production Line or Democracy, every single line of code or change to a single data item needs to be checked and balanced for 11 different languages and every conceivable screen resolution and hardware, then uploaded as a patch to itch, gog, epic, humble and steam. The amount of admin, and busywork required to make marginal changes to a large project can be pretty overwhelming.

With this game, its 1920×1080 res or nothing (stretched to actual resolution, and bordered if necessary), only in English. And right now its not even on any store. This means I can have a cool idea, start typing code, and be testing it within minutes, which makes the development process pretty fun.

I don’t want to put up a public build for it quite yet, because so much of it is just totally broken, or half assed. The current font sucks, and doesn’t even display percentage symbols :D. The gameplay is unbalanced, and there is no high score system that actually stores anything anywhere yet. I reckon I need to code a primitive online high score system, and include music and sfx volume controls before I make it public. Oh and a pause button might be nice too!

I have to say though… its already very very fun. There is something very adrenaline-rushy about playing it on the harder levels, where everything gets a bit hectic. In these days of F2P, monetization, competitive e-sports, multi gigabyte patches, and achievements and so on… there is something very pleasurable about a simple game where you move left and right and hit the fire button!

When I stick it on itch or the humble widget I’ll post about it here :D.

What income can you get from your old indie PC games?

There are a whole lot of different strategies for running a pc games business. I know people trying a bunch of different strategies and here are a few:

  • Publisher-funding model. Get publishing deals, and charge enough for the development milestones that you make a profit regardless of whether the final game makes a profit or not.
  • Patron model. Using patreon, or kickstarter or other methods, build up a loyal fanbase that pays you money to make games, regardless of whether they play them, or buy them in any quantity.
  • Straight sales model. Self-fund games, release them to the world as self published titles and hope the royalties exceed the development costs on a continual basis.
  • The big hit model. Go all-in, on a big title you bet your entire financial resources on, including remortgaging house/car etc. Assume that scale brings its own bonuses, and that the huge payoff outweighs the risk.
  • The continual release model. Release multiple games each year, maybe one a month, hoping that over time, the long tail builds up a relatively stable income.
  • The searching-for-a-hit model. Similar to continual release, but in this case the aim is to hope to strike it big with a sudden hit. Always be poised to drop everything and ramp up any game that gains initial traction.

Unless you didn’t already know, my method is the straight sale model. I’m pretty conventional in that I think the model where you just make the best games you feel comfortable with, from a risk POV, and aim to have them sell enough to result in a profit… is the most ‘normal’ and sensible way to do things. This plays to my strengths, because I’m not scared of risk, but not nuts, and also not a people-person as you need to be with patreons etc, and as a self-code-engine guy, I’m not churning out quick asset flips hoping for a hit.

However…

Because of the sheer bloody-minded determination to stick around, it turns out I have been making commercial aimed games since 1997, and therefore I have ended up with a big bunch of older titles that still run on most PCs, and can still generate revenue. have I perhaps become the ‘long-tail-indie’ just out of sheer hanging around? Could it be that actually positech games is self-sustaining on the basis of really old games, that although they do not sell much each, combined they add up to a tidy sum?

I’ll be honest, I have no idea how much those older games make without digging into the data, but I thought either way it might be interesting, so here goes.

Kudos 2 (2008)

This was the first game I made that made proper ‘omgz’ money. I got a cheqck one month for $20,000 and it was on the basis of that game, selling on about 15 different casual games portals. This was amazing. It was however, a long time ago now… 2008 apparently. This was certainly not my first game, mobygames catalogs a bunch of earlier ones, but it was the first one to make enough money that its worth even looking at the numbers.

Kudos 2 is unusual in that its not on steam. I also actually made it free on itch last year, but people tend to follow old buy links, and I still sell copies through BMT micro. Lets look at the last 365 days income from Kudos 2 for BMTMicro:

269 copies for a total of $1,463.69

Not bad, but this is pretty much the only income for the game. I accept donations on itch for it, and earned another $49

Gratuitous Space Battles (2009)

I always think of this as the game that was released on steam the day I moved house. That was a stressful day. Anyway… its old now (2009), and its on steam, and sold through BMT Micro, and also sold through apple on various devices. Lets check the last 365 days data:

Steam net income: ~$8,700 Apple sales: $0 BMT sales: ~$120

I actually forgot that apple sales were zero now because apple decided anybody who wanted to play 32bit games on devices they bought and paid for could go fuck themselves and revoked that ability, so there you go. Just one of many reasons I despise the company. But anyway… its about nine thousand dollars in the last year. Which for a game released 13 years ago is… pretty amazing?

Gratuitous Tank Battles (2011)

This is a game I often consider a flop, but its not really because it made a decent return at the time. However, its a game I have kind of forgotten about, after I made a single expansion pack. Its now 11 years old, so how is it doing?

Steam net income ~$550 BMT sales: ~$14

Whoah what the hell? Are those number correct? Yes they are! pretty bad. But why? I think its because the total peak sales of Gratuitous Tank Battles never managed to hit a real escape velocity. When it comes to long-tails for games, I get the impression that there are basically two scenarios:

The ‘Meh’ game.

This sort of game sells some copies, and maybe makes a profit, but it never really ‘takes off’. You don’t see dozens of youtubers covering it, there are not more reviews on websites than you can count. The community for the game never really gets going. Its not a watercooler discussion topic. People see its released…some buy it. And then its over. Gone. Done. The end.

The ‘Hit’ Game.

This doesn’t have to be Minecraft. It can just be a game that hit a certain threshold. I don’t know what that threshold is, but my best guess is $1-1.5million gross sales on steam. Once you hit that sort of level, you have a ‘community’. There are people posting online about the game every day. People who ask questions get community answers. People make mods, and the game thus expands. There is justification for DLC, which leads to more news, more coverage and more players, and you get a flywheel effect.

GSB and Kudos 2 hit the ‘hit game’ level. Kudos 2 is now so old its become irrelevant, but amazingly GSB still sells a non trivial number of units each year, and makes comfortably more than beer or coffee money.

Conclusion?

I think a lot of developers get frustrated that they are constantly in a grind, always having to desperately work on a new game to hopefully release it in time to survive the drop in royalties from the last one. Residual income from old games is almost zero, so you are constantly working away like a developer on a production line, never getting to relax.

I suspect many of these developers are at 90% between ‘meh’ and hit, but the problem is, being 90% of the way is not enough. Its pushing really hard on that flywheel, and feeling absolutely despondent, because you simply cannot see that point in the future where the momentum takes over. Its very, very easy to think things will never change, and that extra effort on a ‘failed’ game is simply not worth it. I totally understand why people do not push things that extra mile, when it feels like you have been pushing for the last 99 miles and got nowhere.

FWIW I think this applies to almost all endeavors, but especially creative ones that require popularity. I used to be in struggling heavy rock bands, and the constant putting up of posters and handing out of flyers for gigs, in the seemingly futile, pointless effort to get a few people to show up is soul-crushing and demotivating.

But in a sense, that explains why so many fail. Only dumb optimism or sheer bloodyminded obsession with success can possibly explain why some people still go out every single night and stick up those posters or give out those flyers, or keep tweeting and blogging about their video game. It always looks hopeless, totally and utterly futile, and impossible odds, and never gets you anywhere…until it does.