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

Balancing Democracy 4 using stats and number crunching

I’m still working away on improving the balance for my political strategy game ‘Democracy 4‘ which is in Early Access, and likely the hardest game to balance in the history of humankind, due to the insane number of interconnecting variables.

Something I was working on today was the likelihood of each dilemma popping up. These are occasional ‘situations’ that are urgent and need the player to make a choice one way or the other. Basically the choices are always hard, because they mean upsetting someone, or causing an effect that may be undesirable given your goals.

For example, if a company is about to collapse, you could bail it out (pleasing the workers, but setting a bad example for other companies, maybe upsetting capitalists, who prefer a free market), or not, and your decision depends on who you can afford to (or choose to) upset at that moment.

Some of the dilemmas are totally random, but most are influenced by some variables so that they seem fairly ‘relevant’ to the way you are playing the game. So they all have inputs based on certain variables, and thus as the game designer I don’t know in advance when they will happen (they are not timed or scripted in a conventional way).

This is all very easy to design and code, but the problem is you can end up with the inputs being unbalanced, and thus maybe everybody is sick of seeing dilemma A, regardless what they do or how they play, whereas interesting and exciting dilemma B hardly ever gets triggered. For a small studio with a limited budget, having any game content that is rarely seen by the player is an efficiency disaster.

Luckily I (anonymously) keep track of every trigger of a dilemma by version number, so I can guild up big databases of such events. The events database is currently about 4GB in size, and is testing the limits of my MySQL optimization abilities. Thus I copy the last 2 versions events into a much smaller (600MB) database for me to query. That lets me get cool charts like this:

Which lets me visualize the extent to which some dilemmas (the ones with long red bars) are triggering WAY more than they would if their distribution was completely random. I’ve been using this data for the last few versions, but I still have the unbalanced issue despite a lot of manual revisions, so I’m working on code today to visualize this better.

I actually found this easier in excel, once I had data that showed me every dilemma, and what percentage of dilemmas each one represented, over the previous 2 versions:

I can then work out what percentage they *should* be, thus the error in terms of over or under representation. Luckily I’m analyzing 100 dilemmas, so its a simple 1%. I calculate an error in percentage terms, for each version, then calculate the change. A positive value is movement towards better balance, a negative one is movement away, (worsening the balance). This can then be conditionally formatted in excel:

Which is a cool trick, but also depressing to see the extent to which I often am having a trivial effect towards balance, or even making things worse (negatives).

However, at least having a nice process to visualize this stuff makes it more obvious to spot where I am being too timid in my corrections. In an ideal world, this would all be integrated into a single web query, and in an ideal, ideal world, some sort of cool machine-learning AI would be making these adjustments instead of me…

But hey, its a big step up from just ‘setting some numbers and then playing it a lot before release’ which is what I did ten years ago :D I’ll gradually get this stuff more and more optimized.

The emotional satisfaction of physical creation

Long ago, before netflix, twitch, steam, social media, broadband or even Tony Blair, I worked in a boatyard nailing boats together. They were smallish rowing boats. This was hard work, as was building wooden bridges. here is a bridge I helped build.

The Chinese bridge - Picture of Painshill, Cobham - Tripadvisor

And here is a boat I probably helped restore/build etc.

Thames Camping Skiff Hire

To be honest, it was stupidly hard work (often involving lying on the floor while holding a lead weight above your head as someone hammers it.), and not exactly well paid or with great prospects. However, at the end of the day, something got built. You could point at it, and say ‘we made that’, and there was great satisfaction in that.

I definitely don’t miss the physical work, although I miss having very strong forearms and being super slim despite eating like a horse.

What I do miss, to an extent, is the fact that however hard I work, there is nothing *tangible* to show for it. I can point to stuff I bought with the money I made form doing the work, but thats not the same. The work I do rearranges some bits on a hard drive, which then get copied and put on hard drives around the world, but there is nothing to really SEE. I cannot grab a hold of my work and lift it up to the sky in that dramatic fashion people do with their first child in classic TV series ‘roots’.

sidebar: Did you know who played kunta kinte in roots? Here he is from the series:

Here he is older. Yes really. Amazeballs…

Israeli scientists develop prototype of Geordi's Star Trek VISOR

anyway…

I spent a lot of time reading about car manufacturing when I made my earlier strategy game, Production Line, about car factories. I also follow the progress of the electric car company Tesla, a lot, and have got sucked into reading about lithium ion battery manufacture as a result. I am now reading a book on solar farm financing, and solar panel manufacture, because thats the kind of person I am. And my conclusion from all this is…

Manufacturing is AWESOME.

We have gone through a big shift over my lifetime from a world where manufacturing was a big deal, and something people were excited to work in (my father worked in a factory, making various steel things), to a world where factory work is considered menial, and low paid and boring, and the smart people worked in offices…typing.

Now I know that there is more to computer programming than typing, and more to law and marketing than typing…but it still lacks that gritty sense of achievement you get from working somewhere where stuff is MADE.

Ultimately the real progress in society is not being made with an app. Uber is fucking useless unless someone makes cars. Deliveroo is useless unless someone is cooking pizzas. Facebook and Instagram are useless unless someone is making phones. Meanwhile, we all have to eat, need somewhere to live, need decent clothes and shoes, and a decent TV and we need power and heating…

I feel like society has lost respect for the admirable job of MAKING stuff. Real PHYSICAL stuff. We sit in our airconditioned offices looking down our noses at people who have to sweat for a living, or work somewhere with physical goods, without which our lives would be hellish. The scales have tipped too far and they need to tip back.

Besides which…manufacturing has moved on. Its not people working a lathe anymore. Here is a modern battery factory:

Someone had to design that, build it, maintain it, optimize it. This is AWESEOME. I would love to do this. I’m too old to re-train, but if a teenager asked me what industry they should aim for, I would be hard torn between tech (AI/programming) and manufacturing/logistics. I’m going to stick at programming for the rest of my working life, but I’m trying to get involved in another industry, one that actually makes things. I’m sick of just ‘investing’ in something built by someone else. Making things that other people want to invest in is the REAL hard bit, and I suspect the rewarding bit.

An indie strategy game translation business case. lets do the Math(s)

(My wife is triggered when I say ‘math’ because its American. we say maths here in the land of Monty python)

I have a bit of a rule that I try to follow, that when I am trying to make a business decision, I always calculate forwards not backwards. What I mean by that, is I try not to think ‘I’d like a Polish translation of Democracy 4. is it justified?’. That already sets you on the foot of WANTING it to be. The best way to do this is to set out the number that justifies a greenlight, then to work out the equations as best you can, then unemotionally go with the result.

Democracy 4 is currently in English, French, Italian, German, Spanish and Brazilian Portuguese. The classic strategy game translation pattern is EFIGS. I have added Brazilian Portuguese because it was done by someone who got in contact with me direct, so was affordable.

Anyway. Lets look at Russian, Japanese and Polish.

If I look at Democracy 3, which was translated into Russian and Polish but not Japanese, I get the following full-history revenue breakdown. Note that the game did not *ship* initially with those, the languages were added later.

  • Russian revenue $91k gross
  • Japanese revenue $45k gross
  • Polish revenue $89k

Democracy 3 sold super well, over 6 years with 4 expansion packs, so the total revenue is really good, and obviously Democracy 4 revenue right now is WAY lower, but I’m trying to plan ahead.

Steam take 30%, and there are refunds, chargebacks, and sales tax, so we actually get about 60% which gives me:

  • Russian net income $54,600
  • Japanese net income $27,000
  • Polish net income $53,400

The cost of a translation for the game is roughly $7-9k. It can go higher with more interesting languages like Japanese, so lets say the high end and assume $9k. We are likely to add a fair bit of extra policies etc. over time, and need to keep everything up to date so lets budget for a final $10k per language. I also have to implement it, play test it, and deal with any problems that might come up that have not been seen before in earlier languages. This generally isn’t taking me more than a few days each time, but lets push the complete implementation cost for each one to $12k.

This currently assumes that Democracy 4 sells the same as Democracy 3. This may not be true due to the following negatives:

  • People might be sick of politics due to real world events
  • Much more competition in the games market in general
  • Players of democracy 3 may have ‘had their fill’ of politics and decide not to upgrade

However there are also positives:

  • Young people seem much more engaged in the Bernie sanders / alt-right / Jeremy Corbyn / AOC era than they were during the relatively bland time when D3 came out.
  • Steam is bigger, with a larger addressable audience now
  • D3 was a hit, and some people will be easy to persuade to get D4 if they enjoyed the previous game.

I’m not super risk-taking, so lets be pessimistic and assume that the balance of these factors means that the long term income of Democracy 4 (which I should have mentioned is a MUCH better game btw) is likely to be about 66% of that of Democracy 3. That gives us these values:

  • D4 projected Russian net income: $36,036
  • D4 projected Japanese net income: $17,820
  • D4 projected Polish net income: $35,244

There is a big assumption here, and that is that people playing Democracy 3 in country X…were playing it in the local language, and would NOT have bought an English-language version. The way to check this is to look at the percentage of sales in the first year of release that were Chinese for D3, and compare it with the percentage in the most recent year (where Chinese was translated). This is not perfect, and china specific but we get this:

  • Percentage of D3 sales to China year 1: 0.16%
  • Percentage of D3 sales to China last year: 4.33%

Same for Polish:

  • Percentage of D3 sales to Poland year 1: 0.53%
  • Percentage of D3 sales to Poland last year: 2.7%

So we can see that the effect of a native language version boosted Chinese sales and Polish sales, and the relative native-language-applicable revenue was 96% and 80% respectively, so lets split the difference and assign a value of 88% to the revenue:

  • D4 projected income from native Russian: $31,711
  • D4 projected income from native Japanese: $15,681
  • D4 projected income from native Polish: $31,014

This all makes a super-convincing case to do Russian and Polish, and a slim, but arguable case for justifying Japanese. There are of course other factors, and huge margins for error. One factor is the multiplier-flywheel effect. If I could sell an extra 10,000 copies of Democracy 4 tomorrow and get no money at all for it…its kind of in my interests, because then it climbs up the ‘top sellers’ lists and gets more visibility. Also, I may already be selling copies of D4 to english-speaking players in Polad/Japan who cannot recomend it to their non-english speaking gaming friends yet. Thus, the word-of-mouth of the game is currently not at full capacity.

PLUS! Democracy 4 is not just sold on steam, but direct from us (via humble widget), through GoG, Humble Store and the Epic store. Epics royalty rate is famously higher, and that then changes the figures slightly again in my favor…

I shall mull this over, because no indie dev suddenly commissions $30k more contract work without being 100% sure and sleeping on it, but I thought people may be interested in seeing the thought process.

I know that crowd-sourced translations are a thing, we even started it with D4, but progress is too slow, and also too unpredictable. It also runs the risk of multiple contributors having different translations for the same word in various places throughout the game. I think professional translations are a better system. YMMV.

An amazeballs chart of Democracy 4 playtime since initial release.

Thanks to the wonders of excel, and php etc, I can present this amazeballs chart showing both the number of games, and the number of hours in total playtime each day for Democracy 4, my indie political strategy game.

I think people can overanalyze this stuff TBH, and I don’t think there is anything especially amazing to note. This is ALL playthroughs, not just steam copies BTW. There is a very nice bit at the end where the hours played decouples upwards from games played, implying people are playing for longer sessions (which generally you equate with better balance, and happier customers).

I have quite a lot of Democracy 4 stats, but they are much more interesting to me than most people, and the data can be a bit complex. Probably the most interesting stuff is player feedback on what they think the developer should work on next (taken from in-game voting). Here is the data from the latest version:

I do find stuff like that pretty helpful tbh.

Updated Democracy 4 to build 1.19

Here is a full list of changes in this version:

[1.19]
1) Fixed bug on retirement age selecting top slider value.
2) High corruption now impacts the cost of the military.
3) Fixed a bug that caused an unneccesary error message when selecting a language that exists purely in a mod.
4) Re-balancing of some event triggers.
5) Road building changed so that it no longer appears to boost car usage at minimum policy level (moved to default value).
6) Added mouseover information for each point on the historical finance chart.
7) The global economy fluctuates more randomly now.
8) Improvements to some internal balancing systems should make the game swing less suddenly between success and failure.
9) The next turn report now includes a warning that the voters have detected a policy reversal.
10) New policies: Religious Tax, Religious banknotes, State Religion and Ban Women from driving.
11) New country: Spain.
12) Certain event windows such as donor changes, credit rating changes and assassination attempts now have a details button.

Hope ya like em! Some more balancing and country specific tweaks coming over the next few weeks. Don’t forget to vote on your priorities from the main menu, and thanks for supporting the ongoing development of the game!

If for some crazy reason you don’t have a copy yet, grab one here, comes with a steam key: