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

Anatomy of a rare, and weird heisenbug in Democracy 4

Heisenbugs are bugs in code which seem to go away, or change when you look at them in a debugger. They are the worst possible bugs, because they actively resist being found, or even observed by the coder responsible. Any kind of bug that can be reproduced on a developer’s machine, in their development environment can easily be analyzed, stepped through and reasoned with. But heisenbugs are a nightmare. I just (I think) fixed one, and certainly fixed A bug, even if not this one. I thought you might enjoy the process…

First some background. Democracy 4 is the fourth and latest in my series of political strategy games. They are text and diagram heavy, with a properly unique user interface, in 2D, and all of the code is custom, with a custom engine originally coded by me, with a unicode text implementation and vector rendering system coded by jeff from stargazy studios. This means all of the UI elements you take for granted in middleware you use, were custom coded by us. In this case, the bug is my fault, in code written by me. Here is a screenshot:

Then key thing that matters there is the text block under ‘food stamps. This is a policy screen in the game, and that text is the description. Depending on the length of the description (partly influenced by the language you play in), and the screen resolution, it might be that all the text fits in the available space, or it does not. That means sometimes there is a scrollbar to the right of that text, and sometimes its not there. As you would imagine, the scrollbar works just like any windows scrollbar. That means it responds to mousewheels, and also clicks, on the top and bottom buttons (very small) for example.


VERY rarely. And ONLY when I was playing the game outside the debugger, and only in very arcane sets of circumstances that seemed totally utterly random… screens like this (but not just this one) would occasionally not let me click on some elements in the interface. They would not respond at all… BUT… that block of text would scroll upwards, like it was being scrolled through. It was like completely unrelated events (clicking somewhere else) activated a scroll function on a user element I was nowhere near.

This was of course, absolutely infuriating, because it was REALLY rare. And the times I tried crazily to reproduce it in the debugbuild, or even in the release build, but launched from Visual C++, it would not happen. And there were NO reliable steps to reproduce. In fact, even quitting a screen when it DID happen, and then returning to that screen would make it go away.

What the hell?

After a LOT of time, I realized two interesting things. Firstly, when it happened, the game DID make the click sound associated with a mouse click (so the game IS realizing I clicked somewhere) and the scrolling only happened with text inside a specific UI element called a GUI_TextContainer. Although I did not realize it at the time, it was also the case that it ONLY happened where that text container did NOT have a visible scroll bar.

The clue to the bug lies in a closeup of the scrollbars used:

Like all such bars, there is a clickable ‘scrollup’ button, a draggable bar, with above/below page up/down regions, and a clickable down scroll button.

When I create a new GUI_TextContainer, I created a new GUI_ScrollingWindow, which is a container with all of those elements in side. Like any child element, I added it to the Text Container object with AddChild() to ensure it responds correctly and is processed blah blah. Thjn, later when the textwindow is initialized with its position, and the relevant translated text, I do a lot of calculating to work out if that text *is* going to fit in the available space. If not, I set the scrollbar in the correct position on the right, and make a note that the text does not fit (sets BFits to false). Then later, when drawing this UI element, I could skip out a lot of nonsense I don’t need if the text fits, and render it simply as a word-wrapped string. If It does NOT fit, I then drew the scrollbar, and the text in a different way, cropping the text render to the space given the scroll position and so on, blah blah.

All of this sounds reasonable. But it was a big mistake.

I was correctly NOT drawing the scrollbar if it was not needed (why bother! the text fits!) but I had pre-emptively added it as a child of the window anyway. Worse still, I had never initialized the position of the scrollbar and its sub-components AT ALL. This means that in debug / release-from-the-development-environment, all of the relevant variables in that window were getting set to zero, But in a live ‘customer’ environment, the initial positions of those subcomponents could be ANYTHING.

So what could happen, really rarely, is that the ‘scroll up’ or ‘page up’ parts of the scrollbar, might have coordinates like -32054,-5128,27140,41543. In this case, those clickable elements filled the whole screen… but were INVISIBLE. Thus, I have a huge UI mess-up, but I cannot see it, because my ‘quick and easy bath’ that checked BFits, doesn’t draw it.

So very rarely, I create a screen with an invisible scroll up button that fills the entire screen, and happily responds to every click with a scroll-up command. It even nicely plays the button click sound. Luckily, these buttons do not handle keys, so the escape key still quits that whole screen, and the next time it gets created, I’m probably lucky and the invisible bar has moved somewhere harmless.

I’ve changed the code now, to be efficient so that I do not even THINK about creating this scrollbar until I need it, and otherwise its NULL. I also make sure to safely delete it before creating it, in case somehow I go mad and initialize the same text container twice with different blocks of text. I could also have fixed it by initializing the position of a scrollbar safely to 0,0,0,0, but I also like the neatness of ensuring I don’t have a pointless orphan UI element at any point.

This was a classic dumb error. I added an element when I shouldn’t have, and its member variables were not safe. My own dumb slackness. I document it clearly to illustrate how the weird unrelatedness of a bug ‘clicking down here, scrolls text up there. sometimes. only in German, on a Wednesday etc…’ eventually makes total sense.

Hundreds of thousands of people have played probably over a million hours of the game, with this bug in it. No code is bug free, but if you do things right, the ones left in are pretty arcane.

Voting Systems DLC for Democracy 4

I don’t think I’ve even officially announced that I am doing this, so any games journalists reading this can consider this an announcement I guess :D. I am working on an expansion pack for my political strategy game Democracy 4, and that expansion pack will be called…

Democracy 4: Voting Systems

As you can clearly guess, its an expansion that is focused on the way people vote, and on how you campaign in the election. Its mostly a features, rather than just content expansion, so it includes new policies, but also a bunch of changes to expand on that part of the game associated with the election campaign and the voting. Here is a rundown of all of the new stuff I’m working on:

New Policies

There are a whole bunch of these, including the minimum voting age, a scary ‘maximum voting age’, rules on corporate donations to parties, and state funding of parties, bans or limits on donations, robo-calls and TV ads during the campaign. There are 11 new policies in total. Some of these will already be in place at the appropriate setting, like the minimum voting age, for all countries, and the compulsory vote policy for Australia

Campaign Focus

A year before the election, you will need to pick a single metric, from a pre-defined list, to be the main metric that will feature in your campaign literature and campaign advertising in general. This is the game equivalent of Clintons ‘Its the economy, stupid’ or Tony Blairs ‘Tough on crime, tough on the causes of crime!’. The idea here is that you pick a metric that you think makes you look good, and hope that nothing turns bad with regards to that metric before election day. Once chosen, a new effect will run from that metric, to all the voters. If you improve the metric…great but if for whatever reason it turns bad, there will be a big negative impact.

Once the campaign focus is chosen, its highlighted with a small red icon in the corner of that metric on the main UI, and also highlighted when viewing that metrics details. Once the election is over, assuming you won…the focus goes away.

Voting Systems

The majority of countries in the game use some sort of ‘proportional representation‘, but some use a constituency based or electoral-college system, that is called ‘first past the post‘. The two systems can give very different results, and you can now pass a law to change from one to the other. Proportional representation results in higher turnout, and can favor smaller parties in 3 party countries. You can expect to see more coalitions in countries with proportional representation.

Campaign Style

Immediately before the election, you have the option of tweaking how your campaign is run. You have a slider that lets you select anything from an optimistic, safe and respectable campaign, right through to a scandalously cheeky dirty-tricks style negative campaign that tries to smear your opponent. The extent to which such a campaign works (rather than backfires) is partly dependent on how trustworthy you are in the eyes of the electorate. Depending on the outcome, the effectiveness of your campaign spending can be increased or reduced.

Better Polling Data

A new option will appear on the polls screen. Currently, in the base game, this simply shows the voting intention of all voters, along with the current approval rating for all voters. This will get an extra option, via checkbox, that lets you change this to see the likely voters, rather than the whole electorate. Some people are more likely to vote than others, so viewing likely voters gives a better impression of the actual result. Toggling between the two will also allow you to see if you should take action to increase (or cynically maybe decrease) turnout in the election.

…All of this is coded, and implemented, and in the DLC that I am currently testing. Testing an expansion pack can be a pretty long process, because I need to ensure it all works, that its balanced and that it adds something cool to the game. I then also need to get all of the text for the new content translated into every language we currently support (which is a lot…and Arabic is coming too!).

This will likely take me a few weeks, and then I’ll be getting it into the hands of the Democracy 4 players! Hopefully all of these additions sound quite cool. Its certainly been interesting working on it. I know that a lot of people think I should add states/constituencies to the game, and support a whole bunch of different types of PR voting systems. I understand the appeal, but its likely overcomplex for a game like this. Most people are not *that* interested in the pros and cons of different types of PR, and certainly very few people know the political characteristics of all 50 US states AND all 650 UK constituencies and so on…for every country :D

The eventual erosion of the middlemen

Recently I had to communicate with a landowner about a potential site to build a solar farm, because yes, thats what I do some times. Because the discussion might involve some technical aspects I am not aware of, I went through the company I have a relationship with to build these things. However, on the other side of the negotiation, the landowner also went through a third party. A land agent.

Many of you have experienced this if you try to move house, and buy a new property. You want to sell your old house, and buy a new one. But you need to talk to an estate agent (or realtor in the US?) to communicate with the people you are selling your old house to, and talk to a second estate agent to buy the house you want. They are also talking to a third middleman to buy their property…

The problems here are massive, not least the fact that all of these people expect some percentage of the cost, but they also are SLOW, because frankly, they are quite happy where they live. Whats the hurry? And also their incentives are misaligned. An estate agent might take 1.2% of the sale price when they sell your home. You get the other 98.8%. If the house costs $300k, They can expect to make $3,600. If they can get a 5% better price by negotiating harder, they get $180 more. But you would get $15,000 more. Of course they don’t give anywhere close to a damn about you getting a good deal as you do…

Of course thats just when things are going ok, and the actual objectives are aligned. So you want to sell your house, and the estate agent has an incentive to sell it too. In theory, the estate agent is on your side. A bit. But a lot of the time, we deal with middlemen who are NOT on our side.

If you have ever bought a non-tesla car, you have probably gone to a ‘dealership’. There is a good reason that the slang term ‘stealership’ exists in the US. These are middlemen. Their job is not to help you buy a car, their job is to trick you into paying as much money as possible for whatever they want to sell you, and their loyalty is firmly to themselves. You may THINK you know what model car you want, but if they get better commission on another model, then they will say ANYTHING THEY LIKE to try and trick you into changing to that one.

And don’t for one minute think once you pick a car its over. They will then try to sell you add-ons, extras, extended warrantees and other crap. The last time my wife bought a (diesel) car, I remember having to warn the dealer that if he even mentioned a single more thing related to optional add-ons we didn’t ask for, we would walk out and abandon the deal. (she is more polite than me).

As you may know, the stupidly-fast-growing car company Tesla, has no dealerships. They have ‘showrooms’ where you can see the cars, but these are rare, the staff there do not push you to buy, and in fact if you decide you do want to buy, they will basically tell you to use the website. They also do not get commission. The cars have long waiting lists. I’ve been waiting for my new one since October, and its expected by the end of this year. A years wait to buy a car direct from the manufacturer…

Dealerships used to serve a purpose. Information. In 1970, if you wanted to buy a new ford, you would have to go to a showroom, and have the staff answer questions like ‘how fast does it go?’ ‘what colors are available’? and ‘how much luggage space is there?’


Its 2022, and ever car company has a whizzbang website with videos, multiple images, and online configurators where you can see every possible permutation of how your ideal car would look. Every possible statistic is listed. You could also go to YouTube and watch any of the thousands of youtube channels about cars, where impartial real-world tests are carried out and you get to see exactly how each car handles each situation. You can now be ludicrously informed about a car before even leaving your sofa.The information gap between you and the car dealership has shrunk, maybe even reversed. I suspect I know more about the Tesla model Y (my next car) than most of their staff. They have to know about the whole range, whereas I can be laser focused on the car I want. The entire reason for car dealerships to exist is now gone.

The same is true for estate agents. The role of the estate agent is basically to show you what houses are for sale… and maneg the process of buying the one you want (or selling yours). There IS some hassle involving lawyers and mortgage providers here, but actually not very much. The vast majority of the time, estate agents are doing one of two things.

  • Showing you around a house
  • Playing telephone tag or email with buyers and sellers

The first of these is patronizing as hell. They open a door to the bathroom and say “this is the bathroom”. I know, I’ve seen one before. We even have one in our own house. Thanks buddy. There is an argument that they need to be there to keep an eye on you, sure, but the extent to which they need to facilitate viewings is now vastly lower than before.

Before we bought this house 12 years ago, we drove a LONG way here to look at lots of options. When we got there, it turned out one of them was right next to a sewage treatment building. The estate agent had not mentioned this, because they are bastards. These days, in 2022, we can all easily browse google street view, and check out dozens of photos, maybe even videos of any potential house and its surroundings before bothering to go ‘visit’ any which we can now tell are non-starters before we even get in the front door.

Again, information has destroyed the vast majority of the power of the middle-man/woman.

In my own file of computer games, this is also happening, but we are currently only half way there. The original business model was bricks-and-mortar stores, where you walk in, pick a video game from a shelf and buy it. That horribly exploitative model collapsed with the internet and buying online. For a few years, people tended toi sell online from their own website, paying very little commission. 5% would be considered a lot, as you are basically just paying credit card fees and chargeback/fraud protection, plus some absolutely trivial disk storage and bandwidth costs. This is still an option today, and you can buy Democracy 4 semi-direct from me, at 5% commission here:

Most people do not do this, because there are super-popular online stores now like Steam, Epic and GoG and Humble. In the mobile realm, this is totally controlled (many would say illegally) by apple and google. The middlemen who facilitate buying something from someone went from physical stores to online, but did not go away. The commission they take dropped from over 60% down to 30%, buts its still very much there.

I actually believe this may be changing. The EU and the US are both currently looking into legislation to combat monopoly practices by tech giants which no doubt include the idea that they can take 30% of every transaction. Personally I believe this is way overdue. The same forces that have started to crumble the car dealership module will eventually force their way into the online realm too.

Hit hard by digital sales, GameStop is looking to close up to 150 stores  this year - The Verge

When I started selling video games online in 1997, one top tip people had was to put your phone number and address on your website (yikes). People would NEVER hand over their credit card over the interwebs, but they would feel much safer if they could use a telephone to speak to a human. People also HAD to have the option of having the product snail-mailed to them on a physical CD as a ‘backup’ in case your fly-by-night website went bust and they had no way to get the game again! For what its worth, My company has been selling online since 1997. Steam was announced in 2002, 5 years later., I’m still here.

Many of the ‘value-add features that game-store-middlemen provide have ben eroded over time. They provide the bandwidth to re-download the game! This costs virtually nothing these days, especially for smaller indie games. They provide an online message board for the games players! but so does reddit, facebook, and a billion other places. They provide hosting for trailers and videos about the game! But so does youtube…

There is definite *value* to customers in having a single place where they know they can find all this, but increasingly the actual ‘location’ of information on the internet is becoming moot. I no longer have to care what the web address of a specific site is (and I remember the days when we laboriously typed h t t p : // on front of every address…). Since virtual assistants became a thing, I can now just yell ALEXA, READ ME REVIEWS OF GAME X, and it can do it. Are those reviews from site X or Y? I don’t care.

Its an interesting time to be in selling games online. There was a brief period of stability where it was established, firmly, that games got sold through the apple store, the google play store, or through steam. That was it. But this may now be changing. Its likely changing in other industries too.

Middlemen need to be absolutely sure they are providing some value that is not just ‘information’. Information is everywhere, available to everyone, trivially, all the time. There is still value in curation, and convenience, but its eroding, and its probably not going to hold its value for much longer.

Solar farm development costs so far

So… for those who missed earlier blogs, My new company (positech energy) is trying to build a 1.2mwp solar farm in the UK. I thought it might be worth reminding myself how much has been done, and how much further we have to go. Currently, we are awaiting a planning decision, which has been delayed twice already, but should now happen in less than a month. I suspect this date may actually be final this time…

Here is what has cost me money so far:

Feasibility Study£5,000
Planning Application submission fee£9,730
Topographical survey (is the land flat etc…)£1,150
Solar farm scheme design (inverters/panels/substation reqs etc)£3,465
Habitat survey (are there any endangered bats on the site?)£914
Archaeological Survey (are there any buried roman settlements on the site?)£990
Visual Impact Assessment (will anybody see it, and how badly will this affect them?)£1,485
Flood Risk Assessment (will the site flood? will building it make anywhere else flood?)£495
Construction Management Plan (tell people what building works will happen)£495
Planning Statement (honestly…not sure of this one…)£247.50
Transport Statement (how many trucks, what size, when, where, what route…)£247.50
Statement of Community Involvement£495
Consultant Co-ordination (so I dont have to speak to all these people myself)£495
Planning form (actually entering all of this stuff into planning system)£495
Sundry Expenses (site visit mileage)£250
Historic Impact Assessment (Will building this impact the local history, or views of anything historically interesting)£3,285
DNO (Distribution Network Operator) submission for a grid quote for electrical connection£3,600
Project fee for buying the existing project from previous developer (long story)£5,000
50% of landowners legal fees£464.50

Amazingly, I have already paid all of this, and yet do not have planning permission yet. In theory, I could be denied planning permission completely with no way to recover, and that would mean all of this money was wasted. Scary hug? But wait…there is more:

10% deposit on over 3,000 solar panels£44,524.80
First payment towards electrical grid connection£50,000

Yikes. Those are the big ones. And scary too, because the panels will show up in the UK soon(ish). If you think I can store them in my garage until we get a new site, think again. Its 70 tons of solar panels. In theory, if it all goes wrong, we can cancel and only lose 5%, but more likely, we can re-sell them to someone else, or even have the farm construction company buy them from us. We also have another site currently being evaluated, so we could use them there.

The grid connection deposit can mostly be refunded if we cancel, depending how much work they have done so far, but given the stupidly long timescales they quote, I doubt they have done much yet. Its precisely BECAUSE the grid connection timeline and solar panel ordering timelines are SO long, that I took the risk to order both before getting planning permission.

So what other costs are coming up?

Landowner fee on signing (one-off bonus)£10,000
Legal Fees on signing£1,000
The rest of the solar panel cost~£400,000
The site construction cost~£200,000
The solar battery cost~£240,000
The rest of the grid connection costs£101,007.17

You got to love that grid connection cost right? Especially the way they do it down to the penny to support the fiction that its super competitive, when in fact your choices is of accepting the quote…or not accepting it and not being able to build a farm… In theory its highly regulated cost wise, and in theory you can do some of the work ‘the contestable work’ yourself using a 3rd party, but in practice the amount of the work that is contestable is a pittance, so it just introduces confusion and complexity for almost no gain…

There is really nothing more I can do until we finally get a decision from the planners, which I REALLY hope is ‘granted’, but would not be flabbergasted to discover there are conditions or other requirements. Honestly you would think I was bulldozing st pauls cathedral and making solar panels out of the corpses of rare badgers I crushed under a steam roller, given the way these things get treated in planning terms… Needless to say I have a LOT of VERY strong opinions on how fundamentally broken our planning system is (and it gest seemingly worse over time, not better).

I’ll state it again here: The biggest enemy of the UK meeting its net zero goals is not UKIP, or the daily mail, or the conservative party, or apathy, or cost, or technology.

Its bureaucracy.

For starters, the timescales need halving, AT LEAST. Secondly, we really need to collapse a lot of this paperwork into one. There is no need for separate planning, transport, construction and community engagement documents for crying out loud. Also we need a lot of clauses to allow smaller developments to bypass some of this crap. If your total site area is small, you shouldn’t need to do the full archaeology/habitat/flood/historical nonsense. By all means, if you are covering 100 acres with solar panels, then lets make sure all bases are covered, but for a relatively tiny site? This is ridiculous.

I actually anticipate fairly smooth sailing if we get planning. My plan is ON THE VERY SAME FUCKING DAY that we get planning approval, I want to order the battery, the mounting kits, the inverters, EVERYTHING, so that we are 100% ready to hit the ground digging ground screws in as soon as possible.

This is why I took the risk of grid & panel ordering early. Its also why I’m about to sign a lease with the farmer, and start paying rent (likely next month). I don’t want anything to stop us building the farm once we have permission. In an ideal world, the panels would get unloaded from the ship the day planning is granted. In practice, things are bound to go wrong.

I am nervous about, and very focused upon…getting planning permission for this thing. Its DEFINTELY the most risky and bureaucratic and infuriating thing I have attempted so far. Expect lots of drunken tweeting from me on the day we get it (if we do…).

Doing the maths on a home solar-panel upgrade

My data suggests that the output from my solar array is roughly 1.6MWH per year. This is a 2.1kwp install from over ten years ago, that was recently retrofitted with solar edge optimizers to increase its output during times where some of the panels, or part of a panel was shaded.

I am currently using the octopus go tariff (designed for electric cars for my home electricity consumption. This has 2 different rates, depending on the time of day, and at the time of writing they are:

12.30am to 4.30am: £0.075 / kwh.

4.30am to 12.30am: £0.3061 / kwh.

To add to the complexity, I am on an old ‘feed-in-tariff’ which subsidized my solar install (long since discontinued, but I still luckily get it). This pays me an inflation-linked rate of £0.65/kwh for generation (regardless of what I use) and a ‘deemed export’ additional payment of £0.0185/kwh. Another way to phrase this, is currently I earn £0.67 per unit produced.

Of course, I earn that as a payment from the feed-in-tariff provider, but also this reduces my own consumption. If we assume that roughly a third of the power I produce offsets energy I would have used (as some will be peak daytime summer when I’m outside or not using much power anyway), then I can add a third of the price of a unit bought to each unit produced to reflect this saving.

So that gives me roughly £0.77 per unit produced, or given my production of 1,600 kwh per year, an income from the current solar setup of £1,244 per year. Not bad. Can I do better?

I cannot (due to shading issues) realistically add more solar panels, and I would need planning permission for that anyway, but could swapping out the 10 panels I have make sense? The output from solar panels is now a lot better than when I got mine about 11 years ago. My panels are MPE215 PS05 schuco panels. The ‘module efficiency’ is 14%. AT 12 years, the output guarantee is 90%, so they are already 10% down on the output I would expect. On the plus side, I have solar-edge inverter and optimisers, so I am squeezing the best possible output from each panel right now:

If I upgraded the panels then I would still keep using solar edge, so this benefit is not significant in deciding to upgrade. However, if I *did* upgrade it would finally be time to do the obvious, and get a solar storage battery (lithium-ion). This is something I would love, as it would reduce my electricity bills to almost zero throughout the summer (at least the peak usage…I would still use scheduled charging on the car to fill up its 85kwh battery during off peak hours. Trickle-charging the car during the day manually is just too much messing around…).

So what would the economics look like if I had battery storage and new panels?

Firstly, I would 100% lose the feed-in-tariff, as you cannot change an existing install. On the other hand I would qualify for a smart-export payment, but its trivial, and would require me to export power! whereas with battery storage I’d simply use that power to top up the car and likely export almost nothing. On a peak day, I generate a maximum of about 12kwh (perhaps 18kwh with new panels), and the car battery is 85kwh. its unlikely I would have an option to earn anything at all from exporting energy.

So it comes down to how much extra power I would generate (and thus avoid paying £0.30/kwh on), plus how much I would save by being able to time-shift the power. Actually the economics are not good…

When I generate a unit of power now, I ALWAYS earn £0.77. If it displaces peak power usage, its earning me £1.07. If it only displaces off-peak (car charging) usage, it earns me £0.84. The real problem is that with new panels, all I can ever do is get credit for the energy I would not use, so £0.30. Unless new panels were FREE and also generated 200% more than the current ones, I cannot make the economics work, even assuming that the battery is FREE, and the time-shifting and scheduling of stuff works perfectly.

The real elephant in the room here is the old feed in tariff. It did a fantastic job encouraging demand, in that I was the first person in this village to install solar, and helped encourage others to do so, and enabled the industry to scale up. However, people like me are now effectively trapped in a valley of economics, where we are basically paid too much to generate power on old panels to bother upgrading.

In an ideal world, I would be able to keep the tariff even with new panels, although I understand that might seem cheeky. I do find it pretty frustrating that I am incentivized to keep producing 2.1kwp of power instead of the 3.15kwp I could generate with new panels.

What if you don’t already have solar panels though?

Assume your usage pattern is the same as me, so your consumption of power is roughly 474kwh per month, or 5,688 kwh per year.

If you do no time-shifting of demand, that would cost you £1,706 per year. lets assume you have a suitable roof for a 4mwp installation, and can thus produce double what I do, plus 50% for increased panel efficiency. That means you produce 4,848 kwh per year, but spread in a bell curve. Leta also assume your consumption is constant, and a battery allows you to perfectly demand-shift during a given day, so no generated power is wasted. lets assume an export ‘smart export guarantee’ of £0.05 and a power purchase cost of £0.30. (I’ve assumed a similar curve of solar generation to my own setup):

So in this setup, normally your annual bill would be £1,706 but reduced down to £583.50 by having solar panels. Thats an effective saving of £1,122.90. Is it worth doing?

The energy saving trust assumes an install of this size costs £5,400. The big kicker would be the battery. I think to make best usage of it, you need to be able to store 66% of a peak days generation in the battery for usage later. So thats a 12kwh battery, which costs about £4-5000 extra. This leads to a break even point after 10 years.

However, if you assume no battery, and that you cannot load shift 50% of your usage we get this:

So now we are buying power even in summer, because we use some in the evenings, so our total energy bill is £1,025.40 instead of just £583. We saved £681 a year. Payoff time assuming £5,400 install? 8 years. This assumes unshaded south facing like my example, although your output may be higher, as I have some shading from trees outside of peak months…

So should you install solar panels? *it depends*. There are so many factors at play right now. The energy price cap in the UK is likely to go up another 50% in October. Running that through my spreadsheet means payoff time is in 4 years. WAY better. If energy prices rise even further, its super compelling.

Conclusion: if you live in the UK, Solar panels are a no-brainer investment assuming energy prices DO rise in October (hint:yes) and do not fall. Domestic battery storage remains a hard sell, although if prices of battery units themselves come down, they may become a lot better.

YMMV. Things to take into account:

  • If you have a big roof and can go bigger than 4.2kwp, then do so. A big part of the cost is install & inverter. Panels are cheap
  • The extent to which you can shift demand, using an EV charger, or timed dishwasher/washing machine will depend on if you have a smart meter and a suitable tariff. (get one)