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

Protest votes in Democracy 4. Final piece of the puzzle?

Democracy 4 is a game, but its also my attempt at a fairly accurate political simulator, given the limitations that are to be expected when you do not delve into the individual mechanics of voting systems, and constituencies and different systems such as primaries, mid terms etc.

One of the things that may feel unrealistic to you if you play the game and get good at it, is that sometimes you will win with a laughably high share of the vote. 80%, maybe 85% maybe even higher. In the real world, in true trustworthy and secure democracies, this is super rare. Why is this? and how can I fix it in Democracy 4?

The most obvious answer is probably that ‘differing views on politics exist…duh!’ meaning that no party is ever going to win over everybody. This is obviously true, but there is definitely a phenomena where political debate shifts focus over time, and either takes the electorate with it, or is dragged BY the electorate towards it, depending on your POV. This is often called the ‘overton window‘ and is the space in a theoretical political compass that contains the ‘theoretically electable possibilities’.

For example right now in the USA, segregation of the races is most definitely not inside the overton window. No serious party would suggest setting up apartheid in the US. Similarly, the forced seizure of wealthy peoples second homes by the state is not considered. This is also clearly outside the overton window. But there are policies that move in and out of that window over time. Is socialized medicine now in the US window? perhaps obamacare suggests it is, but thats a fairly recent inclusion.

The point I am making is that mainstream political opinion can shift over time, so in theory, if a government does a really good job, it could shift a LOT of people towards supporting it. There may remain 5% hardcore racists and 5% hardcore communist, but its *feasible* that a centrist party could get 90% of the vote, based on policies.

So why does this not happen, ever, and why does it feel weird if it happens in Democracy 4?

The trouble with letting a computer programmer like me design a voting simulation is that we act like classical economists, who have a concept of a rational consumer. Rational consumers have a price at which they buy product A. If the price is too high, we don’t buy, if its low, we buy. Thats classical economics. The problem is, it turns out that classical economics is horseshit.

Read up on ‘behavioral economics’ and you will find its a crazy world out there. It turns out that ‘free’ is a magical price that behaves totally different from $0.01. It turns out that sometimes we will buy more if the price goes up. Sometimes we will value a product at a higher price than we paid for it…for no reason at all other than psychological feelings of ownership. It turns out that we get confused between $2.99 and $3.01 and think the first price is WAY cheaper. If we buy a product for $9,500 and we see an option to add biscuits worth $5 to the price as an add on, we happily pay $20 for the biscuits. In other words, we are dumb, irrational chimps!

The same is true of voting. We do not look at all of the impacts of the various policies proposed by the various manifestos and then make a rational choice. We vote for dumb reasons, in dumb ways, for animalistic and pyschological and completely irrational reasons.

Democracy 4 models some of this as best as it can. Voters are individuals that have a sense of elasticity of opinion, based on age. In other words old people stick to their views and loyalties, young people chop and change. Actual chance of voting depends partly on party membership, partly on strength of feeling, partly on the campaign effectiveness by the likely party we normally vote for, partly on their innate tendency to do things like vote (randomized at birth).

Once a voter actually votes, we base their choice partly on rational policy evaluation, partly on their perceptions of the leader (strong/compassionate/trustworthy?), partly on how fed up with the ruling party they are due to its time in office (inverse political honeymoon), partly on the appeal of the ruling party’s ministers, and the amount that party spends. And a lot of this is mitigated based on how educated the voters are. Poorly-educated are more manipulated by this, and less by policy.

And ultimately this super-complex bunch of code spits out a decision by each voter… and sometimes 90% vote for you.

I just today realized what I’m missing. Tactical voting and protest voting. Basically people actually supporting you, but voting for someone else.

This is a big thing, especially in ‘safe seats’ or ‘non-swing states’ for US readers. If you live in a state where the democrats get 75% of the vote every election, and you are hard left…why vote for the democrats? You can safely vote for a third party harder-left candidate safe in the knowledge that the message will be received…but there is no risk of you letting a republican in. And the same vice versa.

LOTS of people clearly do this… but the game does not yet handle it. Not only that but the *chance* of someone voting is probably also influenced by this. I know 100% that where I live, our next MP will be the same Tory MP we have had here for decades. Its a super safe conservative party stronghold. So in theory, if I was a natural Tory voter, I could safely ‘use’ my vote to send a message to him that he should not be complacent…OR I could just stay at home that day, safe in the knowledge that he doesn’t need my vote and will win anyway.

I need to include this in Democracy 4, and I am just working out a way. Clearly some people are likely to vote tactically and some are not. I could simply give it a percentage and say 10% of the electorate are susceptible to these thought processes, then assign some other thresholds. For example if the polls show >70% approval for the ruling party, then scale in a chance I don’t bother to vote if I support them anyway, or scale in a chance I vote for the closest party to the ruling party that is *not* them (could be one of two opposition parties…).

I need to code this, and test it, but also hopefully find a way to represent this in the game. One way might be to make up a bunch of small protest-vote parties with fringe views, and represent them as another column of ‘smaller parties’ on election day. This could effectively be the ‘protest vote’ column… Still thinking about it, but I think it does need to go in…

Could this work?

Democracy 4 mod support (non steamworks)

As people who have played my games for a long time may know, I am a huge fan of mod support for games. The first game I made that had a really big modding community was Gratuitous Space Battles. Some of the mods were amazing, and there were hundreds of thousands of player created challenges alongside proper mods like new ships, new modules and so on. (There was some modding for GSB2 as well, but that game didn’t do so well, and some really abusive ‘players’ of the game put me off continuing to work on it post-release… top tip: hurling personal abuse at game devs does not motivate them to implement your suggestions).

Anyway, the Democracy games have a history of a lot of modding, and I want to make Democray 4 the most moddable game in the series. I already laid the groundwork for that, with relatively little fanfare early on during the games Early Access period, but I’m putting some more work in now.

Like the previous games in the series, Democracy 4 is very moddable if you are happy to edit text files and csv files in excel. To go to further extremes, you might need to know how to create icons in InkScape (we use vector graphics for the icons now), or even supply custom event art images. However, despite it not requiring any l33t tools or an SDK, the mod support is still not as friendly as I want it to be.

Democracy 4 already supports steam workshop for mods, so you can log into steam, browse the uploaded mods (uploaded from within the game by other players), subscribe to them, and have the m automatically installed. You them have an in-game control panel that lets you toggle mods on and off, so you can keep them on your hard drive but decide if they are active or not.

Thats great but there are two areas that are still not good enough:

Firstly this is only good for steam owners. Mod support DOES work outside steam, but there is no easy way to find mods or install them

Secondly, actually making mods involves reading a lot of documentation and editing a bunch of files manually.

I’ve finally got my act together to fix the first problem. The next update to the game will include a non-steam mod browser. You will only see it if steam is not running (if steam is running, you will see all your steam workshop subscribed content instead). This new UI basically works exactly like steam workshop, where you have a list of all the mods I’ve put on my own server, and you can one-click install them. Coding this was a real pain (mostly some php nightmares), but its done now. Sadly for now, its not dynamic, meaning a mod submitted to steam workshop does not automatically also get submitted here too yet…

This is going to be great news for people who buy from the humble store, direct from me, the epic store or GoG. This means they will have to access to most of the mods steam players have. I like the idea that players get the same game regardless where they buy it, and do not like being locked in to one provider. This is why I have my own in-game achievements system for all players. (The steam copies just read my data and then mirror the achievements in the steam UI). FWIW, I also am planning on adding the achievements for the epic-store UI soon too.

I will be working over the next few weeks on the second problem…actually making the creation of mods much easier. Like I say, we do have extensive documentation, but I can imagine there being way more cool mods if people could just create the simpler ones (new situations, or dilemmas etc) in-the-game without editing files externally.

That will take a lot of UI coding, but its something I can do while waiting for the Japanese translators :D.

New Democracy 4 policies: Workers dividends and Ban on crypto

I’m working on adding two new policies to the next update for Democracy 4 today. By popular demand (deduced from in-game player voting during Early Access) I have decided that these two policies are worker dividends (profit sharing) and a ban on all cryptocurrency. I’d like to talk through what these policies represent from a game design and real world point of view, and show how they have been implemented.

First up is workers dividends. Like all Democracy 4 policies, these are not as specific as they sound, but represent a whole ‘area’ of legislation, in this case legislating on how workers must be compensated. In the overwhelming majority of countries, such legislation basically amounts to laying out a minimum wage (if one applies), and perhaps some rules about grounds the company may have to withhold such payments, or perhaps rules surrounding what kind of deductions from wages can legally be made.

In other words, in general, as long as a company pays you minimum wage, thats all you are entitled to. If you notice you earn $40/year and the company CEO earns $50million a year, and its all your effort that enabled this…then basically your option is to just quit and work somewhere else…

Some people take the view that this is unfair. Others take the view that this is capitalism working as intended. A clever company will reward employees fairly, or risk losing them to cleverer companies who spot their potential. This is the ‘perfect market’ school of thought.

Others might suggest that this is fine when we are talking about headhunting people with phds, but when it comes to warehouse workers, or other minimum wage staff, things don’t work that well. A company like amazon may earn billions in profit, but see no reason at all to pay its warehouse staff above minimum wage. If you are of a socialist mind, this is unfair, and exploitation and needs fixing.

Generally in my lifetime this has been a non issue where I live, until the last UK general election, the left-wing Labour Party did propose something akin to this new Democracy 4 policy:

https://www.bbc.co.uk/news/business-50508369

In this policy, the party suggested that 1% of the shares of private companies be taken from them each year for 10 years (total 10%) and placed into an ‘ownership fund’ whose share of the profits would be paid to the workers. In a Marxist sense, this would be described as ‘seizing the means of production’, although in this case only seizing 10%. The idea was to share the profits of big companies with the staff, and was probably one of the most pure socialist policies proposed at the election.

In the end, the party lost (quite badly) so we do not get to see how the policy worked in practice, but it was popular with its supporters (and VERY unpopular with its opponents).

I need to include policies like this in Democracy 4, because as socialist players have pointed out, the game does not go to any particular extremes on the left economically. We have policies for minimum wage, retirement age, worker safety and even mandatory union representatives on company boards, but no direct pure wealth-redistribution from owners to employees. This policy fills that gap. The slider can be thought of as intensity, showing a range of measures from the ‘incentives for bonus schemes’ all the way up to ‘mandatory allocation of 90% of shares among the workers’.

My first thoughts are that this policy pleases socialists, and union members, angers capitalists and small businesses (effectively entrepreneurs), boost the chances of a corporate exodus, reduces foreign investment, but has a side effect of making all strikes less likely. (Why strike when you will feel the pain as profits drop?).

The second new policy I’m adding is a cryptocurrency ban. Sometimes people ask why such ‘ban’ policies even need a slider, but a ‘ban’ can mean everything from ‘some currency mining is banned if using certain power sources’ all the way up to ‘holding, mining or trading cryptocurrency of any kind is punishable by imprisonment’.

In this case the motivation is a combination of loss of government control (and thus tax revenue) and concerns for the environment. Liberals hate banning anything (because…freedom), and obviously any ban would have a vastly negative effect on the usage of cryptocurrency.

How Bitcoin's vast energy use could burst its bubble - BBC News

For background reading on the environmental costs of cryptocurrencies (specifically proof of work), just use google. Its pretty shocking. I have strong views on all crypto, including proof of stake, which although environmentally better, has the perverse effect of making the rich get richer. Perhaps someone will do an in-depth D4 mod that represents different types of crypto and their effects on socialists and capitalists!

And that reminds me… I must check that crypto’s CO2 impact is modeled in the game…

Improving Democracy 4 events balance by using a LOT of data

I’ve been doing some number crunching to check that I am moving in the right direction regarding balance on Democracy 4.

The game has a series of ‘events’ which are triggered by various inputs. Some of these events are pretty ‘informational’, in that they mark changes the player has made and their impacts, other affect the games difficulty by stopping the player racing too far ahead or too far behind. Others are there as a random curve-ball that the game throws to the player to shake things up. There are about 120 of them.

Because they are not triggered purely randomly, the frequency with which each event shows up is determined by the complexity of the neural network that forms the basis of the games simulation. This means that some events may end up triggering much more than others, if the inputs to those events are not balanced correctly.

In an ideal world, the whole game would be a truly self-balancing neural network, but I don’t trust the systems enough to unleash anything like that, so I collect statistical data on which events trigger in each game version, and then change some of the inputs each update so that things balance out for the better.

In an ideal world, every player gets to see 100% of the content in the game, so they are effectively getting what they paid for, and not being constrained to a tiny subset of the content because of poor balance. In other words, if I have an event called ‘school shooting’ and its triggering one tenth as often as ‘scientific breakthrough’, then the balance may be off, in that the inputs to the first event are too strong, and the second too weak.

Note that I am talking in grand statistical terms over thousands and thousands of players. An *individual* player may never see school shooting, or scientific breakthrough, depending on the countries they choose and their play style and skill, but I need to check I’m not adding content to the game that hardly anybody sees!

By collecting all this data, I can build up tables for each game version showing the total events triggered for players of that version, AND the number of times each event triggered. Like this:

1.27
Event Namecount
shareiposuccess7790
shareipocancelled7112
hugehurricane4515
dubiousrolemodel4190
resourcesobsolete3913
multinationalcompanyheadquarters3810
militarycontractscandal3780

..and so on. Because I am looking at 120 events, I can work out that for version 1.27, if every event was equal, they would all trigger 1,406 times given the number of version 1.27 games played. I can then store the difference between the ACTUAL number of triggers, minus the target, and express this as a deviation in percentage terms from the target:

1.27
Event Namecountpercentage deviation
shareiposuccess7790453.78%
shareipocancelled7112405.58%
hugehurricane4515220.96%
dubiousrolemodel4190197.86%
resourcesobsolete3913178.17%
multinationalcompanyheadquarters3810170.85%
militarycontractscandal3780168.71%

So you can see that back in version 1.27, the top event (Share IPO success) is triggering 4.5 times as often as I would like.

I can then add up all of those percentage deviations and get a final number representing the total percentage deviation (in absolute terms) over all events. That gives me this:

VersionAbsolute Deviation
1.276426.89%
1.285717.38%
1.296128.34%

In an ideal world, this number trends down over time as each version comes out.

Another way I looked at things was to just look at the absolute value of the top 10, and bottom 10 events, to see if I am effectively ‘squashing’ the trigger probabilities to prevent extremes. This is a major goal, because players will not notice and event triggering 5% more than another, but if one triggers EVERY game, or NEVER, then that does get noticed. When I look at this data I get these values

VersionAbsolute DeviationExtremes Deviation
1.276426.89%2941.48%
1.285717.38%2239.64%
1.296128.34%2433.29%

By doing this for a whole bunch of different game versions, I can end up with a chart showing my progress!

More helpfully, I can quantify that the uneven-ness of the event triggering has improved by 14.73% since version 1.27. The extremes have been reduced more, by 30.29%

This probably sounds stupidly maths-y and the system is full of issues, such as events that only trigger in a few countries, and therefore SHOULD be seen less… but there are limits to which a single coder/designer/bizdev/marketer person like me can spend time crunching all this.

TBH its just a big relief that the numbers DO seem to be trending in the right direction, especially as I keep adding new countries and complex simulation elements (meaning that the simulation is in flux, and thus just remaining the same would be a balance-win of sorts.

It might be bizarre but I really enjoy this kind of analysis :D Now go tell your friends how well balanced Democracy 4 is :D

Democracy 4 Translations. The Economics

I’m trying to decide what other translations make economic sense for Democracy 4. Its never a clear issue. There are some countries where sales are potentially high, but then most gamers speak English anyway, so the boost effect of a translation is small. Then there are countries that sales are entirely dependent on translations being available. Also some countries have higher piracy rates, meaning you are basically just making pirated copies better! Time to look at some stats. Obviously I cannot make any decision without stats. Yes, I may well be on the spectrum…

Here I am going to consider the arguments for translating into Korean, Chinese and Japanese. Which, if any, of these countries make sense as a potential translation target? One useful stat would be to look at Democracy 3s steam sales figures in each country, as a percentage of revenue, as this game is older so it has lifetime (not just early access) stats.

  • China: 1% of revenue (Chinese translation available but added post-release. 5% revenue in prev year)
  • South Korea: 1% of revenue. Not translated 2% in prev year
  • Japan 0% of revenue. Actually to be precise: 0.478% of revenue. Not translated Yikes…

There are a bunch of countries where we do not have a translation with higher revenues such as these:

  • Sweden. 2% revenue
  • Norway 2% revenue
  • Netherlands 2% revenue
  • Denmark 1% revenue

But I think its fair to say that English is commonly spoken in those countries by gamers, and if not, they also have French or German to choose from, so not bad. The big question is picking between Russia, China and S Korea. Its worth noting that S Korea is a playable country in the game… so maybe this needs adding? So is Japan!

So to get really stupid, lets look at the population under 30 to get the total addressable market for each of our now 4 countries:

  • Japan: 27 million
  • China: 237 million
  • South Korea: 13 million

Hmmm… not helpful. Maybe a better source would be to look at steam traffic in general, which I found on this page.

  • Japan: 1.5% of traffic
  • China: 22.7% of traffic
  • South Korea 3% of traffic.

So frankly Japanese is looking like a bad idea. Untranslated sales were close to zero, and as a percentage of steam traffic, its really low for EVERYONE. South Korea is better, but still low. China might be a better bet. We DO have a swanky Unicode engine which will effortlessly render everything in Chinese and Korean… so it seems like that could be a good idea. I need to get a translation quote, and then look at the numbers a bit more, and then pace up and down and lose sleep some more. I’ve scheduled the stress and pacing for tomorrow…