Category Archives: democracy3

So recently I’ve been -rebalancing Democracy 3, my political strategy game for the PC. It looks like I released that game in October 2013, so not quite three years ago. Why would I be balancing it now? First of all, some context and the results so far of my re-balance. the game is an indie ‘hit’ by the standards of solo-developer-owner, having sold (according to steam spy) 485,000 copies. Its currently $25. if you guessed, you’d probably guess that the developer earned $3million ish from the game. Lets say $2,500k profit, which is very nice. Before we go further into strategy, numbers, and the ‘resource curse dilemma’, lets look at what I did.

Part 1: The changes:

Essentially the game was too easy, and a lot of its content remained unseen, untriggered. Some anon gameplay stats showed me that 86% of elections resulted in victory. Thats an easy game. And at election victory, only 1% had the ‘vigilante mobs’ problem, with 12% having it when they lost. There are many other situations, but a lot of them were just not being encountered enough.

maingui

So I did some re-balancing, tested it on beta players, then rolled it out, and collected some initial data. The data needs a few days to bed in and to eliminate the bias from beta-opt in players (whom I assume are more hardcore). Anyway,. initial results show that…

Percentage of election victories dropped 8.39% to 79.3%

Average debt level on victory is now up 22.59%

Percentage of games where poverty has been eliminated at election has dropped 10%.

All of these are deliberate. My results in some areas were not so good, maybe even contrary to my plans. For example, the blackmarket situation has gone DOWN, the OrganisedCrime has gone DOWN, the only negative event which is now more likely at elections is TaxEvasion. Technological Advantage has dropped 9% and high productivity dropped 10%, both of which I consider good news in terms of re-balancing the game. So TL;DR: Its moved in the right direction, but not enough. I may have to do another patch.

So part 2: Why fucking bother?

Lets look again at that not official guess of a profit of $2.5 million. Thats fucking cool, but more interestingly, that means if I was to boost sales by 1%, thats worth $25,000 in profit. Thats fucking amazing. Thats more profit than a lot of indie games will make in their lifetime. Holy crap. So if I can spend a week collecting data and analysing, a week re-balancing, a week observing beta, and a week deploying the update (4 lazy weeks), and it makes ONE PERCENT increase in sales, thats $25k / month or $300k a year.

gold

In practice thats bollocks. Will my change make the game 1% better? I suspect it will make it roughly 3% better, but this will only apply to people who come to the game now. A lot of people will have heard of it and discounted it, its only really going to apply to people hearing 3% better reviews from recent players. Say 90% of the games potential audience already have bought or rejected it, then that means there is $250k of potential sales out there, and my 3% boost will be worth $7,500. Of course, thats still a bloody good month. Also, there is the issue of what that 3% boost in game ‘quality’ does. I am assuming a linear distribution of current satisfaction among potential buyers, but what if its skewed with 90% of the potential buyers evaluating the game between 97% and 100% of the quality required to prompt a sale? In that case, a 3% quality boost results in 90% sales increase. Buying a game is a pretty binary decision. TL:DR: Its probably a very good use of my time, but might not be.

so Part 3: How could this possibly be bad.

This is something people occasionally called the resource curse. Country A has fuck-all. Country-B has bananas. Country B just throws the bananas into a ship and exports them everywhere. Job done. Country A is fucked, and cannot afford bananas unless it comes up with something worth trading for bananas, so it invents ipads, and swaps them for bananas. Country B, once a happy smug banana-owning paradise is kinda fucked, because it turns out ipads are worth more, and they never set up the ipad factory because they were eating bananas all day.

bananas

I typed that last paragraph purely because I like the idea that my old economics professors are yelling at the screen in agony at my gross simplification.

Anyway, having a big success can be a huge curse. If Democracy 3 makes me enough money that I can keep tweaking it by 1% in order to earn a decent living, why ever take a risk on making something new. This is a problem a lot of companies face. Microsoft are cursed by windows. They cant create a new O/S or office suite from scratch, it makes no economic sense, because windows & office are such cash cows. Its not so much a sunk-costs issue, but a sunk-profits issue. This is a real issue for a lot of developers and entertainers in general. A new series of the big bang theory, however desperately played-out, unfunny and now repeating itself like crazy, is so profitable it doesn’t make sense for the actors or writers to create anything that might potentially be better. he same is true of all fads. Why bother making an interesting new movie when you can dig up some crappy superhero from obscurity and monetize that?

ant

I know this may read as ‘woe is me!, my game sells too well’, but forget finances and think about creativity for a minute. The aim of game development is to make cool stuff, and enjoy doing it. Anything that lures you away from that might be profitable, but is it really the right thing to be doing?

(FWIW, I am working on other stuff, I did months and months of work on a potential new game that I will return to next year, plus I have a new expansion I’m working on).

After a brief period of thinking about writing AI that plays Democracy 3 (I am still going to do this one day), I took to doing some cunning data mining, and then did a lot of play-testing, and musing, and staring at graphing calculators and came to a few conclusions as to what improvements could be made to Democracy 3 to make it a more accurate sim, a more fun game, and a better balanced game. The conclusions I came to are in the beta patch I’m releasing today on steam, meaning that you need to right click the games name in steam, go to the properties tab for it, then betas, and opt in to the pc beta (no password)

beta

. That gets you the following changes:

Version 1.26
============
1.    Unemployment now contributes towards obesity
2.    Increased impact of car usage on traffic congestion
3.    Increased base likelihood of a teacher shortage.
4.    Unemployment now reduces the chance of a teacher shortage.
5.    University Grants now increase the chance of a teacher shortage.
6.    Reduced impact of CCTV on Armed Robbery.
7.    Added impact of low inequality on Armed Robbery.
8.    Changed equation for GDP impact on Alcohol Consumption to be non-linear.
9.    Added impact on doctors and teachers strikes from trade union membership
10.    Adjusted impact of state school funding on teachers strikes.
11.    Added effect of wages on Teachers & Doctors Strikes.
12.    Added effects of science funding and the environment to contagious disease.
13.    Arts subsidies, Bus subsidies and community policing now reduce unemployment.
14.    Adjustments to triggers for various events.
15.    Increased impact of refugee crisis event.
16.    Effects of corporate exodus event worsened.
17.    Increased impact of Unemployment on CrimeRate.
18.    Impact of religion on antisocial behaviour now linked to membership, not frequency.
19.    Unemployment now linked to antisocial behaviour
20.    Trade union and Socialist group memberships now contribute towards general strike.

As you can see there are some new links which should have been in there but I never thought about them (unemployment causing obesity is one), plus some tweaks to simple numbers and influences on events. It was really interesting to look at stats and realize how some events and situations were simply not triggering for many people, so effectively they were missing out on part of the game, and the numbers now mean that they are m,ore likely to experience the whole range of events and dilemmas etc. I feel such a fool for not having done this analysis ages ago, but I guess you live and learn. I felt like a fool for never having multi-threaded the ‘next turn’ bit of the game until recently. (BTW thats why its so fast).

Hopefully a bunch of ambitious tweakers will opt in to the beta (you can always go back to the original game at the moment), and give me feedback on if this marks an improvement on the basic game. I’m probably going to leave this beta for a while to see what the consensus is before I set it live, or maybe do some more tweaking.

In the meantime I have 2 big announcements about other stuff coming up. Oh yes.

Oh and if you are confused and wonder what democracy 3 is. click here. And if you have any opinions on these changes feel free to post them here, I read them all.

 

 

So it turns out that we already have about 2,000 games of Democracy 3 being played every day by actual players, rather than some hacked-together AI of mine, so I thought step 1 might be to grab data on how those games are being played to see if I could spot any obvious balance issues. I started collecting a few basic stats at the point of elections yesterday and already have a ton of data here:

http://www.positech.co.uk/democracy3/stats.php

I have a few pieces of data I was interested plus a snapshot at elections as to which of the best known situations are active during victories and during defeats. So for example 1% of people who won the election have gridlock, but 10% of losers do. Average GDP during an election is 51% but 55% if you win, and so on…

Actually extrapolating balance issues from this data will be a bit tricky though, as I likely need more data to back up my assertions, but right now, from the current data I am tempted to proclaim the following:

  1. The game is too easy (85% of elections are won. Granted some people get assassinated beforehand…but still..)
  2. Unemployment at victories is still 28%. Maybe unemployment is not having enough of a negative impact?
  3. 20% of people have eliminated poverty entirely (got it to 0%). That seems high. This should be harder.
  4. Gridlock is only a problem for 1% of victories. Maybe this should be harder/slower to fix?
  5. Teacher shortage never seems to be much of a problem, this should trigger more?
  6. Armed robbery is generally very rare, even when losing. This should maybe trigger more?
  7. Corporate exodus is actually higher during victory. This may actually make sense, as people are ‘buying’ the public support despite a huge debt?

Its going to be pretty difficult to get the exact data I want. For one thing, the game NEEDS situations that are *bad* but only crop up in later terms, and I don’t currently track which term we are in. Democracy 3 Africa has a very cool mechanic where people arent bothered about some issues until more pressing issues have been fixed. I suspect I may need to introduce an element of that here.

My main worry, a bit like a doctor is that I need to ensure I ‘do no harm’. Its better for me to leave Democracy unbalanced but hugely popular than tweak it and break it…so I#’m nervous of any big changes.

The problem with games like Democracy 3, or indeed Gratuitous Space Battles, is that they are VERY hard to balance. Balancing a game is exceedingly hard, even if you agree, like me, that ‘some’ inbalance is actually what can make a game fun. (If all choices are equally effective, why pretend there is strategy to the game?). DFor big AAA studios with huge testing teams, pre-release balance is easier. For one or two man indie studios, its almost impossible to do in house.

The common solution is early-access / pre-orders with beat access, which get a lot of people to play the game. However this assumes that

a) Those players are representative in terms of skill, time, and play style to the wider public

b) You get decent feedback from all those players, not just the hardcore and

c) The feedback from the players is impartial and can be relied upon.

With a game like Democracy 3, c) is a real issue. A lot of people complain that capitalists are hard to please, but how do we know if that’s true, or if its feedback from socialist players? Anyway, as a geek, and a coder, and someone who embraces complexity, an alternative strategy of letting the game balance itself obviously appeals. So clearly, getting the game to play itself constantly and discover, then report, and maybe even auto-tweak and adjust its own rules, is the ultimate goal.

This would be an ideal ‘summer vacation’ project for me.

Actually, the bit most people are probably wary of (coding the bit where the game comes up with a strategy, plays the game and developers improvements to its play style based on the results), isn’t the bit I’m worried about coding. That bit wont be too bad (i’m not aiming for alphago levels of skill here), the bit that makes me roll my eyes and go ‘Can I be arsed?’ is the mechanics of introducing a wrapper to the game that lets it play itself. The problem here is just doing a nice, clean job of introducing such a system without breaking the game or introducing anomalies.

This is where Alphago is AMAZING, because it simply uses visual input. Frankly that ain’t gonna happen, so I’d have to embed code in there…or would I? an ideal system would be hands off, a new ‘GeneticD3.exe’ that launches D3, non invasively, makes player decisions, then handles everything without touching any D3 code directly… Surely that cannot be done?

Mwahahahaha. It possibly can…almost, because D3 is already set up to autosave each turn. And because its turn based, all the ‘decisions’ happen at once. So all I really need to do is to write code that parses the D3 save game (handily already xml), makes decisions as to what to do, runs those decisions through the D3 engine (that bit gets tricky), and then dumps out the next turns save game, repeat ad finitum. To do some rough maths, lets say saving and loading D3 takes about 2 seconds (I rule at optimizing), and we give a generous 2 seconds to make a turns decisions, thats 4 seconds a turn, 64 seconds per term in office, or a 4 term complete game in 256 seconds, so roughly 14 games per hour, or 300 games a day. Thats actually remarkable slow. If AlphaGo needed 100,000 games to learn, I’d need the best part of a year. Still, assume some cunning multithreading and optimizing (I don’t ever need to touch the disk really, all save/loads could be trapped in a RAM buffer), I could probably quadruple the speed, so 1,200 games a day?

I am seriously thinking about it. It would definitely be fun.

In playing a lot of Democracy 3  lately (also playing a lot of democracy 3:Africa), I have started to wonder if the way a lot of the situations are set up is a little too ‘steep’ and could be balanced better, especially regarding some of the negative situations.

Take for example, technological backwater…
This kicks in at level 0.6, and ends at level 0.4 for its inputs. So if your hidden backwater value reaches 60% it starts, but you have to go below 40% to get rid of it. I think that mechanic is fine but…

The impact on GDP (for example) is
-0.02-(0.12*x).
Which means that when this kicks in, you will get
-0.02-(0.12*0.6) which equates to -0.092, or a 9.2% drop in GDP. (actually not that simple, because its a 9.2% cut in 0-1 terms, which if GDP is, for example 0.5, that would be a 18.4% overnight drop in GDP).

Looking at it backwards, when you beat the tech backwater, assuming a GDP value of 0.5, that
impact on GDP just before it drops is
-0.02-(0.12*0.4) which would be -0.068, or 13.6% of current GDP.
Thats a sudden jump up and down of GDP in double digits, which seems huge, given that its a fairly arbitrary measure.

I’ve tried to illustrate the current setup with this crude graph. Bright red is the bit where the backwater kicks in and is in force. Dark red is the bit where its still in force once its triggered. The green lines show the sudden ‘jumps’ in impact on GDP when its triggered (rightmost) and when its fixed (leftmost).

graph

What I’m trying to avoid is the situation where you GDP just flat-lines or is 100% all the time, rather than being more interestingly poised between the two and shifting more realistically. Which countries GDP ever jumped 13.6% in one quarter? I’d say few:
http://data.worldbank.org/indicator/NY.GDP.MKTP.KD.ZG

So…if you are still reading..well done :D. What I’m suggesting is that maybe the situations such as these need to be tweaked a bit so that the ‘entry’ and ‘exit’ top the situation is less drastic, and that, for example ‘reducing’ a situation like tech backwater becomes more relevant than the current situation where its a bit binary and a bit of a ‘its active or not’ mechanic. For one thing that -0.02 starting point could go and be replaced with an adjustment to the top end (so 0-(0.14*x)) or maybe it needs more of a curve and a different starting trigger. Or is it fine as it is?
Thoughts welcome!