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

Adding better curves to the Democracy 3 equations

Happily there seem to be very few actual bugs or crashes in the Democracy 3 beta. I  have already fixed the only 2 actual crashes I know about, pending the first patch, which I am aiming to release for PC tomorrow or Monday, with Linux/Mac to follow. Sales seem really good, and people seem happy, which is all excellent news.

What surprised me is how many people say it’s too easy. Nooo!!!! I didn’t think so, but you can’t argue with peoples savegames. Plus, there are a number of anomalies. parents making up 100% of the population, and 100% being retired too. Ooops, clearly that isn’t part of the plan D. I have a big long list of tweaks and adjustments already implemented for me to test today/tomorrow, but I also have some subtler changes to make…

Democracy 3 is essentially a huge web of interconnected things (‘neurons’ in code…) and each of those connections i governed by an equation, and an input/output throttle. The equation is where most of the magic happens. For example, with State Schools, the effect on education is “0.07+(0.3*x). Which essentially means a linear effect from +7% to +37% on education, in line with education spending. Obviously this is a bit simplistic, as well as making for less interesting decisions. Gamers have mentioned (and I agree) that too many policies are Min/Maxed, in that the actual slider is rarely set sensibly somewhere in the middle. It’s the linear nature of that equation that causes this. Ideally, the first few dollars spent on education should have the most effect, trailing off until you are eventually just throwing money needlessly at an already over-funded program.

The chart below shows my proposed solution:

graph

The red line represents the original equation, the green line is the new one, which is 0.03*(x^0.6)+0.07.  This is not possible in Democracy 2 because it couldn’t process that many variables in an equation, but luckily I added this capability as part of the re-write of the code for D3, so this sort of thing is now possible. I think this is a step forwards, and something I need to look at replacing a lot of the linear equations with. Does this make sense?


13 thoughts on Adding better curves to the Democracy 3 equations

  1. You might want to have a even faster falloff in those curves, and a smooth transition to a level (horizontal) at the wanted max. value.

    Could use something like sin (x*pi/2) to get a smooth decay of angle at the range where = 0 to 1 and then add the multiplier for output range scaling and addition term for zero point vertical offset (basically fitting the start and to an existing linear curve).
    I do realise that the sine is awfully heavy to compute, but this stuff could surely be preloaded to an array and interpolated. Somebody could also be able to come up with a simpler function with the same properties, though,

    It would be quite simple to automatically convert all your linear equations to use a nonlinear formula so that the start and end still match, and could probably toss in an extra variable that defines the linearity/decay speed. I assume you have a class that handles all these curves, so it could be implemented transparently there and then just see what happens. It would be a nice experiment! :)

  2. Meh, I was too excited to read through my reply before posting, here is a fixed version of the second paragraph:

    You could use something like sin(x*pi/2) to get a smooth change of angle (derivative) at the range where X goes from 0 to 1. Then add a multiplier for output (y) range scaling (from the range 0…1 to anything needed) and an addition term for zero point vertical offset, basically fitting the start and end to match the existing linear curve. If a smooth start of the curve is ever needed, you can use a larger portion of the sine curve, for example: sin(x*pi – pi/2) * 1/2 + 1/2

    http://www.wolframalpha.com/input/?i=plot+sin+%28x*pi+-+pi%2F2%29+*+1%2F2+%2B+1%2F2+from+0+to+1+

  3. This looks really good, and I look forward to trying it out. Great to hear as well that the simulation has been improved enough to allow this kind of change. I’ve got to agree too that the D3 beta looks very polished for the most part, and aside from the few simulation/balance quirks noted above, it feels like a finished product. Keep up the good work!

  4. found a glitch, whenever the “expand airport” decision appears the game crashes if you pick to expand it rather than block the construction

  5. also can you lower immigration, it is unbelievably extreme and i have the max amount of immigrants coming to Britain for its GDP so i have to have max border controls because otherwise racial tension and unemployment become really high and because of the border controls the liberals get really annoyed and are trying to kill me.

  6. also just realized that you should cut down on the ridiculous amounts of recessions in the game, i have had a continuous amount of recessions piling on top of each other and the global economy effectively no longer exists – sorry to keep adding points :-)
    LOVE the game!

  7. I Played once for now as Germany and the game is pretty easy.
    I have played D2, so maybe is the experience talking.

  8. I agree with the first comment by Metalfusion, it needs to be more faster falloff and quicker to horizontal.

    The only thing I’ve found is playing the US if you don’t pretty much enact a Racial DIscrimination Act on turn 1 you very quickly get into race riots and ghettos. I don’t know how you work out the assassination stuff but there have been a few games where the actions of one turn have left me at a point where I literally cannot stop myself from being assassinated, even if I do everything I can to increase the happiness of those groups.

    Another thing I find is that it becomes increasingly difficult to manage your cabinet and stop them from quitting the further you get in. Perhaps you could let the person choose their cabinet as they enter government (or, depending on the country, I know the US does but I’m not sure about the others), and maybe even let them choose the base supporters for their party so their cabinet can be made up of people who ‘pander to the base’. It makes very little sense for me to get elected with 101% (yes, I managed it somehow) capitalist policies and have a trade unionist socialist in my cabinet that I don’t want to waste political capital removing but having her quit will negatively impact the opinion polls.

    I do agree the game is too easy though, once I got through the initial stages I received 100% of the vote at pretty much every election until I was assassinated (I pissed off too many liberals apparently).

    Anyway, awesome game! So glad I preordered and will be keeping an eye on your blog as we go forward. I figure you’ve fixed the crash bug related to the airport scenario, given your initial paragraph.

    LK

  9. Not sure if this is intended, a bug or oversight, but have a look at my traffic congestion. I have bus subsidies, rail subsidies, road building, clean fuel subsidies, fuel efficiency standards, commuting initiatives, car emissions limits, petrol tax and biofuel subsidies.

    http://i.imgur.com/XenRnKG.jpg

    Strange interaction?

  10. Found a bug, when the Tax minister resigns while playing as Germany it shows up as “Chancellor”. Obviously not correct, as you are playing as Chancellor.

  11. That chart might be due to congestion taking place, then it hitting GDP, which puts back car usage, and thus solves it temporarily, leading to everyone using their cars again…

Comments are currently closed.