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

Modelling voter happiness in a video game is… interesting but also horrendous

Its less than 2 weeks until the US election in 2020, and although it looks likely Joe Biden will win, nobody really knows, because modeling how people vote is really hard. I know this, because I’m struggling with it in Democracy 4. Over the previous variants of the game, the voting model has got better and better and more complex, but its still a nightmare.

Here is a very very basic, simple description of how the voting system works:

We collect all of the various inputs to a voter from voting groups and calculate their happiness. If its over 50%, they vote for the player, if its less, they vote for the opposition.

Thats fine, but way too simplistic. For one thing…who says they will vote at all? so we have extra mechanics to decide based partly on age, party membership, and how angry/happy they are… whether or not they even vote. Plus culturally every nation has a background level of ‘apathy’ which feeds into this. Then finally, there are extra multipliers based on how strong a ‘campaign’ each party runs, which help to ‘get out the vote’ by financial means (adverts) or activism (party activist boots on the ground).

Thats better… but not perfect because it assumes rational voters making purely policy-based decisions based on self interest. So I have to then adjust the happiness of the voter based on their ‘perceptions’ of the candidate, which are affected by both policies and ‘spin’ events in the media. I then adjust *that* effect depending how educated the voter is. Basically the poorly educated are swayed more by spin, the better educated less so. (FWIW you can toggle that mechanic off in the game).

That all sounds complex enough…but its not. There is also the matter of party loyalty. So for example, say you are a trade-unionist left winger in the late 1970s, and have voted labour in the UK all your life. Along comes Tony Blair as party leader, by any definition a centrist. You still keep voting Labour because…well you always have done right?

The party position drifts dramatically but for a good few years, maybe multiple elections, you still vote for the same party. You become someone in a centrist party, holding left wing views, but still voting for them. In short, your loyalty has trumped your analysis. To make the game more accurate, we model that too! you can even hover the mouse over a voter and see their loyalty and analyze them (and click-through to a detailed breakdown).

(To illustrate this, generally you see cluster or red, blue and green on this screen to show members of each party, but sometimes those colored dots seem to be further away from ‘the pack’. These are people like I mentioned above… members of a party, and voting for them, but actually holding different views).

This is all a big improvement, but its not *quite right* yet, because the problem is…we still have what seems to be fairly wild swings in voting behavior. This is because of ‘soft’ support for a party position. To put it simply, if 100% of the country have an opinion of you that is 49.9%, you will get 0 votes, and be wiped-out in an election. Shift them all towards you by 0.2%, and you will win a landslide.

This is correct political modelling, exactly accurate and how it should be…but somewhere, some of our numbers are not quite right, so we are not ending up with the real-world results we expect. I have not *yet* completed my analysis of exactly why, but I suspect its because peoples opinions sway too wildly, and because party membership and loyalty is not strong enough.

For example in the UK right now, a lot of polls would suggest everybody is very unhappy with the current government. In Democracy 4, they would be in a bad way, because so many of the electorate are angry…. but I suspect the Conservatives would win an election tommorow, because despite their anger, many people who voted conservative in the last election still prefer them to the alternative. In other words, their party may have changed, and performed badly…but they still have party loyalty, and its not been bad enough for long enough to drag them away from that…

This sort of stuff is a nightmare to balance of course, but not that hard to code. I think I likely already have most of the data and variables exposed for me to get it right. I hope people realize that this is what Early Access is all about, and hope people can see more of whats going on by looking at that scatter chart (these are new to democracy for d4).

The real challenge is explaining all this to the player. I can get a better UI than I currently have. it just takes a lot of time, and experimentation, and analysis. Hopefully people are patient about this during Early Access.

Democracy 4 is on Steam, GoG, itch and the humble store


5 thoughts on Modelling voter happiness in a video game is… interesting but also horrendous

  1. Chance of voting = approval rate.
    That is person with 50% approval has 50% chance of voting for you.
    You can make it fuzzier more or less.
    Or use other function.

  2. Don’t forget the us has an electoral college. So the voting mechanic throws away most of the votes that didn’t go to the winner.

  3. I’m assuming this is accounted for, but a considerable part of a voter’s opinion of a given party/candidate is how much they support the policy positions the voter cares about, regardless of how the country performed with them in charge.

  4. Hi Cliffski,

    Perhaps it would help to get someone with a politics or sociology degree on your team for a few months and brainstorm together the relevant factors on voting decisions and how they’re modelled.

    Regarding the modelling itself, I think network effects play a huge role. What are my family and friends voting? What is my city/neighbourhood more inclined to vote? That influences opinions strongly and can keep the apathy momentum or the grassroots movements going.

    There is also a psychological drift tendency, from socialist opinions to a more conservative world view, with age. This is also influenced by career, wealth and network effects.

  5. Hi Cliff,

    Played the game for the first time yesterday and was really enjoying myself. I really appreciate all the effort you put into it.

    I’m glad to hear you’re tweaking the voter happiness. Elections in Democracy 3 felt a bit uncontested. Even if your administration has been doing a great job, I would expect about a 10% turnout over the opposition, not capturing over 90% of the electorate.

    Would you consider adding more voter types? Or is that something modders could do?

    Again, really enjoying the game so far. What kind of feedback is most helpful?

    -Cole

Comments are currently closed.