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

An update on balancing Democracy 4 for longer games

I’ve blogged about this a few times in the past, but basically I use a lot of staring at data and charts to evaluate how well balanced my game Democracy 4 is. Its a ludicrously complex game, and balancing it perfectly, so it plays like chess, is actually pretty much impossible (maybe something for deep mind to tackle next), but its always worthwhile chasing that goal as a more balanced game will mean more replayability, and more player satisfaction, so here we go again :D

The last time I collected stats on the games late game balance was in January and some of the headline numbers are here:

Its pretty clear that there is a problem in that everything gets solved as things go on, and things are too easy in the late game (3 terms on…) so lets look at the data for the current shipped version:

A pretty trivial improvement to be honest. Sure, popularity in term 3 is a BIT harder, but health and education are still pretty much solved problems, and crime is still relatively under control. Unemployment is *not* solved, but this doesn’t seem to be holding people back in either economic or popularity terms :(. Stronger, or more creative measures are called for… But first lets compare the other stats. Old:

and new:

Again, not much change to talk about here. In fact equality has got better! Lets look at the voting stats. Old:

New:

‘Winning’ is an internal hidden measure I use that scales some difficulty-related measures, so the increase there is a *good sign* and shows that some internal hidden difficulty-adjusting systems are working more strongly now./ This seems to have resulted in a bit of a drop in votes in later terms, which is a good thing. Winning with 72% of the votes is still not ‘fun’ but its more fun than winning with 75%. Still… I am being too meek about this.

One statistic of interest is complacency. Its modeled in game based on the happiness of each voter group. If they are massively happy, then complacency creeps in. They take the policy decisions you made for them for granted, and start to expect more. The trouble is, a canny player can keep all the voter groups happy… but not too happy, resulting in an electorate that keep voting for you, because they prefer you to the opposition, without any complacency having an impact…

In the real world, there is definitely a phenomena where people get just ‘sick of’ politicians and political parties. Eventually, the long list of dumb things a specific politician has said, or crisis that happened on their watch, becomes so long that the electorate becomes tired of them, and starts to want change. Here is some data from UK elections:

What I find interesting is that we don’t have many cases where a party wins one term, then gets kicked out. Its almost like once you win an election, the next win is pretty guaranteed, and then it gets a bit harder from then on. The 92 conservative win was pretty narrow, for example.

Obviously there are ‘events’ which influence each election outcome, but it does look like British politics is basically a sine wave, oscillating between center left and center right governments fairly regularly. The US picture is fairly similar:

Basically a regular swing from red to blue and back again, with actually pretty small swings. It really does feel that there is this big block of ‘swing voters’ who are very susceptible to a ‘I am tired of this team, lets back the other team’ mentality.

I guess this could be coded into the game by a steady increase in complacency of the ‘everyone’ group, but that feels a bit hacky. I also think that doing so would really just be papering over the problem, which is more simulation-model based, rather than political. In other words: The player keeps winning, not because the voters are not sufficiently cynical, but because things are actually going really well for them.

In the real world, this is not the case. The US/Germany/UK/Italy have not all collectively solved healthcare, or solved education, or eliminated crime. What has happened is that either the goalposts have moved, or the causes of the problems have mutated, but they are definitely still there.

For example: Mental Health. This is a much bigger deal in 2020 than in 1940, but are we pretending that there were not mental health issues in 1940? of course! but other problems were so bad, we didn’t pay much attention. Gender dysmorphia is not a new phenomena, nor is anorexia, nor is depression, or related conditions, but there is a much stronger focus on these issues now, probably *because* so many other health issues have been improved upon.

The game frankly does not model this. We model education just as badly. Its a 0->1 scale, that never changes, and if you improve education to 1.0, you are done! but the real world is different. The world has become more complex. The understanding of modern economics, modern electronics, modern physics involves a lot more stuff now than in 1950. Go back to when I was at university, and economics was simply macro/micro. Then along comes behavioral economics and we all have to go back to school.

Medicine is another area where the goalposts are in constant motion. As our lifespan increases, and technology advances, the demands on healthcare race upwards too. People who in 1950 would already have died, are now living relatively healthy independent lives….but at a great cost in terms of pharmaceuticals and technology.

I really need to improve my modeling here. Right now, the game *does* have some of this, because for example, technology does boost healthcare demand (by up to 22%), but maybe this needs to be on a curve, and more pronounced. Lifespan also boosts demand, but again, not by much. Maybe this needs looking at, and a review of other similar effects. The only design dilemma is how to represent this. Currently the entire game is coded around a system where voters look at the current state of affairs, and judge it against an arbitrary value like this:

“Healthcare is at 60% so I am 60% happy. When it was 62%, I was 62% happy”

Whereas in reality people probably think:

“Healthcare has fallen 2%. Things are getting worse. I’m voting for the opposition, they might be better?”

I REALLY do not want to change any core mechanics of the game, especially now we are no longer in early access, but I am continuing to think of ways in which to accommodate this phenomena into the way the game already works…

side note: I use WordPress (An absolute trainwreck piece of software btw), and as of the last update, the font it shows in post editing mode is totally different to the one the actual blog uses, with seemingly no way to change or fix this. presumably this is just some stupid new bug introduced by a pointless update I never asked for. Is it too much to ask for software developers at big megacorps to give a damn about quality? The almost weekly complete redesigns of their UI apparently do not trash their users productivity enough, so introducing dumb-ass bugs like this has apparently now become a priority. Absolutely useless…

Why you SHOULD get a smart meter

In the UK, we are in the middle of a smart meter rollout. Basically energy firms keep pestering their customers to get a smart meter. The government is encouraging this. Many people I know are very negative and grumpy about this, probably because they are, in general, cynical about government initiatives, and have a hostility towards electricity companies. Plus there is a ton of silly conspiracy theory bullshit to select from.

Getting a smart meter is involved because you need some space around your existing meter to install it. This means for people like me whose meter was crammed into a box, you have to do a staggering amount of work to make a (free) smart meter install possible. I did it anyway. This blog will explain why.

Firstly…what is a smart meter? Its basically an electricity meter that connects via the phone network to a wide-area-network and can report your electricity usage in half hour segments remotely. This means nobody has to come to your house and ‘read’ the meter. Its also digital (at last) instead of an old fashioned 1950s style monstrosity with a spinning disk and analog readouts… Smart meters are fitted for free by your electricity company. My install was way more involved than that for tedious reasons, not least because I have a solar panel array and also an electric car charger. Thus my setup now looks this complex:

Top left is a fusebox (consumer unit in modern-speak), top right another fusebox (for the solar panels). Middle left is the solar panel generation meter for calculating my feed-in-tariff from the government, the white box to the right is the smart meter, and to the right of that is the black box with the main power fuse for the house. MOST people’s houses have far less complex electrics than this!

Why does the government want us all to have smart reasons? Well there are two reasons. One is talked about, another is fiendishly complex, and you have to do a lot of reading about energy markets and the national grid and talk to solar farm installers to work it out. Lets start with the first reason.

Smart meters make you save energy

This is the official reason we all need one. It sounds like it must be nonsense, but its actually super-true. I’m someone who is OBSESSED with efficiency and knows a lot about energy efficiency, and the smart meter effect even works on me. You get a remote gadget like a tiny tablet that shows you your current energy usage, and how much you have spent so far today. You can also get an app for your phone, which is tons better and displays pretty graphs and goes into a lot more detail, but ignoring that for now the in-home-display unit is actually quite cool.

Why do smart meters come with an In-Home Display? | Blog | Bulb

The display even has a tiny, not-oft-seen icon that lights up to show you when you are exporting power back to the electricity grid, should you be fortunate enough to have solar panels and generating more than you are using. This is an immediate sign that you should charge some laptops or phones or put the dishwasher on :D

Cynically, you might think that just ‘knowing’ how much power you use will achieve nothing, but it really does. We can see the massive spike when we put on an electric heater, and an even bigger spike if I plug in my electric car. If you look at the more fine-grained data on the smartphone app, you can see every time you boiled a kettle. Just seeing the massive difference between using one appliance versus another makes you think. And energy prices having shot up means those numbers are about to get way bigger.

So this reason is all about social engineering. Show people WHEN they are spending most of the electricity and they will make smarter decisions. Dishwashers running half empty are a waste of energy. Leaving an electric heater on when you are not in that room is a big waste of money. As people realize this, they will adapt their lives in subtle ways that reduce their energy consumption.

This is the main reason given, but its only part of the puzzle

Demand shifting and protecting the grid

Almost all western countries electricity grids are the same. There are a few super-huge power stations, normally in coastal areas, or remote areas, then a big fat network of pylons carrying the power to local substations, which then run cables to each house. I missed a few steps there, but generally that is the layout. Also most grids are OLD. population density is higher since the grids were built out, but the layout has remained the same. Until recently its kind of worked ok. Before I explain why its not working so well now, here are some technical details.

The UK electricity grid runs at a certain frequency. Its *roughly* 50 HZ. In fact, there are real-time-websites that let you see the current frequency of the grid. Right now it is 49.965HZ. This is really important. Its important because a lot of electrical equipment, especially really expensive electrical equipment, will absolutely freak out and fail/catch fire/explode if its much above or below that frequency. The frequency depends on the balance of supply and demand.

What that means is, that some organization (in the UK its national grid plc) has to keep turning power plants on and off again, to ensure that supply matches demand closely enough that the energy grid frequency remains within a narrow band. If they are going to fail to achieve that, they have to take drastic action, like closing entire sections of the grid off, in other words a power cut. This is a VERY big deal, so its to be avoided at all costs. How do they manage this?

Its generally not been too bad, because demand for energy is pretty predictable. The national grid checks weather reports, to see what temperatures will be (to determine the need for heaters or fans/air conditioning), predicts that supply, and then schedules power station output to match it. This sounds easy, and it is…for certain types of power. Britain gets about 15% of its power from nuclear, which always runs flat-out, which means the flexibility has to come from other sources. In our case, thats gas-fired power stations, which can be turned on and off fairly quickly.

This has been happening for decades and everything has been fine. What makes it work even in cases of extreme demand is that we also have cables connecting us to France, and other countries that let us export power (rare) or import it (more common). However its starting to get tricky, really tricky, its starting to get unmanageable.

Renewable energy has entered the chat

Renewable energy is awesome. I’m a true believer, I’m even building a solar farm. But it brings challenges. Renewable energy is cheap, and environmentally awesome, but its variable. Some days its cloudy. Some days its windy. This introduces instability into the grid, meaning its MUCH more likely that we sometimes have way too much energy, and other times we have way too little. This can be accounted for and managed…but its introducing huge complexity.

FWIW, the national grid has put in place LOTS of ways to manage this. They all have exciting names and acronyms like ‘Fast Frequency Response’ and ‘Load Shedding’ and ‘Peak Shaving’. Its a whole super-involved ecosystem of trying to manage, in real-time, to keep that demand equal to supply while handling multiple different energy types, and demand spikes, and free-market energy trading systems.

You might think that electricity has just gone up 50% in the UK and that this is a big deal. Haha. You know nothing Jon Snow. Lets look at the real charts behind the headlines, that nobody outside the industry even looks at:

BTW, if you are on a long term fixed price energy tariff, you are paying the equivalent of about 50-60 on that chart. So…. looking forward to a potential trebling of energy prices? maybe even a quadrupling? But although this chart should alarm politicians, its not the one that alarms people trying to balance our grid with renewables. here are some more fun charts:

Electricity is traded in half hour chunks. No idea why, so 48 on the X axis is one day. You can see that the electricity price on the wholesale free market in the Uk yesterday ranged from £-50 to £229.90 per megawatt hour, in a single day. This is NOT at all unusual. This chart is an outcome of some desperate attempts to match demand to supply. Talking of supply:

This is what they are trying to balance. Nuclear is 100% inflexible, and must run all of the time (for economic reasons). Wind and Solar do their thing, and then we try and balance the rest by exporting/importing using the interconnectors. The thing is… we still cant do it, so we need to change the demand as well as the supply, or the whole house of cards will collapse…

Demand Management

If supply is an absolute random number generator, you need to change demand, otherwise we are in trouble. The grid already has systems in place to do this in both directions. You can be paid a regular flat fee by the grid, to agree that if they REALLY need to, they can turn off your electricity. This is for big factories and aluminum smelting plants, which draw huge power. If what you do is super-time-critical, this is unattractive, but for some industries its perfect. Thats load-shedding.

Another method is to create a market for energy storage. This is a real thing. The solar farm I am building will also have a 500kwh battery. Thats like 7 or 8 electric cars. The options available to you when you have battery storage are myriad, and very complex. This is where peak shaving and firm-frequency response come in. Peak-shaving is basically a way of smoothing out a sine wave by storing energy when you have too much, and releasing that energy back when you have too little. Some solar farms or other renewable systems can do this. Its especially helpful for solar farms because typical solar output looks like this over a day:

Thats my solar output yesterday. The thing is…if you scale this up we have a huge huge problem. The problem is this: The electricity grid cannot cope.

Remember my earlier description. The grid is old, and designed for a small number of big phat power stations. Incredibly high power and capacity cables run from sites like Sizewell nuclear power station to big cities like London and Birmingham. This works fine. But the cables that go out to all the smaller towns and the rural locations with wind farms and solar farms? These cables suck. They have no capacity to add further generation. They are ‘constrained’ in energy-industry-speak. Upgrading these cables costs a FORTUNE, and I know that, because I’m making a bank transfer today of £50k as a down-payment on an upgrade to some cables for my solar farm. Even if you are happy to pay, in many cases the grid upgrades are just catastrophically hard to do, and slow to do, and we don’t have time for that. We NEED to add renewable energy faster than we can upgrade the grid.

Save the grid!

In a situation where you cannot upgrade the grid, you are left staring at that solar chart thinking “hmmm…if only this was more predictable…”. Like this:

This is peak shaving. Take off the peaks and fill in the troughs. Its still not a flat supply, but its capped at a much lower level than the natural peak. If that natural peak would overload the grid, then we can still connect our big solar farm, but we use peak shaving to put less of a ceiling on our grid output. Plus the grid loves us…because they get a way less ‘spiky’ energy supply to contend with.

To make it clear: when the chart is red, we are sending some of our power to the battery. When its green, we are draining the battery.

Thats peak shaving. Firm-frequency response is different. Thats when the grid pays you, as a battery owner, to reserve usage of your batteries, with no-warning, if they suddenly need to dump power in it, or to whip that power back if they suddenly need it back. This happens on a VERY short timescale (think seconds or less). This is how they can keep that frequency where it should be.

How does this make me want a smart meter?

What I’m describing there is how renewable energy companies can make money, and how the energy industry is coping with renewables. But this also can affect us. To put it bluntly: we are not, and can not build enough batteries to keep up with the demand for frequency response issues for quite a while. For the foreseeable future, we will need to expand the size of the economy that we can do demand-management on. That means that individual home owners need to get in on the action.

Right now, my electricity company charge me £0.24 per kwh of power. If I want it now, its £0.24. If I want it at 3AM, it £0.24, so I frankly don’t care when I use power I KNOW I have to use.

Luckily I have 3 weapons at my disposal that will allow me, as a smug smart meter owner, to ‘haggle’ with the energy company. I own a dishwasher, a washing machine and… *drumroll* an electric car. I NEED the dishes washed today, the clothes washed today and the car charged over the next 12 hours, but I dont REALLY care the exact time any of this happened. So make me an offer…

Star Trek Minus Context on Twitter: "https://t.co/Svy8TL5am9" / Twitter

I don’t plug my car in every day, it doesn’t need it, but if I knew that I might get an offer of power for £0.01 /kwh at 4am tomorrow, I’ll fill my car up to the max. That suits me fine, and it suits the desperately-balancing grid even finer. Its a huge win-win, and smooths out some of those crazy price spikes. This sort of thing is ONLY possible with smart meters.

I’m about to swap to a different tariff, for EV owners, that gives me nighttime power at 75% off. This suits me perfectly, I’ll schedule the car charging and other stuff to run during those off peak hours. Excellent. Good for me, and good for the grid. And yes…EV owners are a minority for now, but a rapidly growing one. A big EV has an 85-100kwh battery, which represents a HUGE chunk of your electricity consumption. If everyone ends up with an EV, and we can all have the charging times auto-negotiated with the grid, thats a big win.

Notice that this is NOT ‘vehicle-to-grid’, where your car acts as a grid-connected battery. Thats a different, and interesting issues, but we don’t even need that. What we need is just to have ‘smart’ usage of electricity. We need to do localized peak-shaving in our communities so that the draw from each community is smoothed out and manageable.

The need for this is even greater when you consider rooftop solar. In an ideal world, if I’m on holiday but its sunny, my solar panels can charge my neighbors EV or run their dishwasher, without that energy ever needing to leave this village and put a strain on the main trunk-roads of the grid. It CANNOT put a strain on the grid, because the grid is already creaking like crazy.

Climate change is driving us to have more electric cars AND more renewable energy, meaning we demand more from the grid, just as it becomes more unstable. Smart meters HAVE to be rolled out to everyone ASAP, and I decided to get ahead of the chaos and the crush by getting mine early. If you live in the UK you WILL end up with a smart meter, and it will likely save you money. There is no real reason to avoid getting to the front of the queue before the queue explodes in size. It took me 3 months to get mine. Electricity prices have risen dramatically since I applied…

Solar farm development update: panels

I know it seems that there is no progress on my solar farm… but there is. I last posted about it in october, and despite the pandemic and Christmas, there has actually been some progress.

To recap, there is a list of things you need to do in order to build a solar farm:

  • Get planning permission
  • Sign a lease with landowner
  • Get an electricity grid connection quote
  • Order panels and optionally a battery
  • Actually build out the farm

In theory, you would get planning first, and do nothing else, because ALL the other things are super expensive, so if you fail to get planning permission, its all money wasted. However, planning can take months to prepare and maybe 2-3 months to actually get, so that adds 2-3 months at the START of the project. You then may need to wait 6 months for a grid connection, and 3 months for panels to be delivered (given current supply woes, normally easier).

So if you do everything in the right order it could easily end up dragging to over a year from the start before you actually put a single post in the ground on-site.

Frankly, we need to hurry this shit up. There is a reason we now say climate emergency. We need to get extra renewable energy capacity operating right NOW. And also, I hate waiting for stuff, and find the process to be stupidly drawn out, so I am pushing to go faster and faster. As a result here is where we are:

  • Lease is signed at my end (still awaiting final bill from lawyer and countersigned copy.
  • Planning permission has been applied for, and paid for (about £9k….just to APPLY for permission).
  • A grid connection quote was paid for, and we have it, but have not accepted yet (its a six figure sum, will wait for some feedback on planning, if not full permission).
  • Panels got ordered this week.

This is all pretty good progress. Building out the farm will take maybe 8 weeks. I’m hoping to get planning permission on the first attempt, hopefully in the next 8 weeks, so some time in April with any luck. Panels are expected to show up at the start of Q3, so in July.

This means that if we get good planning feedback, we can take the risk of agreeing to the grid connection earlier (maybe March?) and that then starts the clock ticking on that. Even assuming a rapid (ha!) 6 months for that, we will not get a connection until August/September.

This whole project is a minefield of timelines, because its a situation where the actual useful operation of the farm is dependent on the slowest/latest part of the process. No point in having an installed farm with no grid connection. No point in having a connected farm, with no panels. My gut feeling is that we end up with planning permission, panels delivered, everything else delivered, even the battery, and we end up with a farm, sat idle and not connected because we are waiting on the grid.

If you think being charged a six figure sum for some upgraded powerlines would get you super-fast priority, then you would be wrong. Frankly the grid is just not designed to handle this at all, and the companies seem to have no tight schedule enshrined in law to ensure new power generation gets connected on a short timescale.

But anyway…

Progress at last, and it means my spin off energy company is no longer a small side project. We ordered over 3,000 panels, and they are BIG ones (410 watts each), and the total weight is 70 tons. I’m not sure how many truckloads or container loads 70 tons is, but its certainly not trivial.

For those technically interested, the panels are from QCells (South Korean), 410watt. Black (monocrystaline) They are 20.9% efficiency (which is pretty good). After 10 years they guarantee 93.5% output, after 25 years its 86%. This is pretty standard for high quality panels.

I’ll do another update when another chunk of stuff happens, probably when we say yes to the grid connection, or planning goes through. You *can* get a partial refund on a grid connection you agree to, but cancel if everything fails (ie: you only pay for works they have currently carried out). I think agreeing early will be prudent, because I strongly suspect that the connection costs are pretty back-loaded, with real costs not being incurred until workmen are out on site installing new poles and building a substation.