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

VOTING SYSTEMS DLC out now!

So.. at last I finally did it, and managed to get the voting systems DLC released yesterday for Democracy 4. If you want to watch a long video with me rambling about voting systems, boy do I have the video for you:

Also if you fancy grabbing the DLC, you can get it here, or just use the fancy humble widget to buy it direct from me. bwahaha!

For the love of god… PLEASE use your own product

There was a bit of scandal recently involving Elon Musk’s potential purchase of twitter, where it became apparent that a number of people on twitters board of directors, never used twitter, or did not even have an account. In people’s mad rush to find a way to criticize Elon musk for everything, this was defended as being perfectly ok.

Its not ok. In fact is absolutely stupendously fucking stupid.

Now obviously, with certain hipster silicon valley companies, fueled by an endless supply of dumb-money venture capital from coked -up idiots who got lucky once with uber, and think they rule the universe, the idea of making a profit, or even having a decent product is seen as passé, but back in the real world where people live and work, if you run a business, its in your interests to make a decent product. This is business 101. In fact this is kindergarten level business. And yet… this seems to be a radical idea to most people.

It is absolutely ESSENTIAL that everyone involved at any level of making a product, has used that product a LOT. You need to know how it feels when that product fails, or works poorly, or slowly, or gives unexpected results. If you make videogames, you need to play your game a LOT. You cannot simply rely on someone else to filter all the data. You cannot understand what makes your product suck, or seem uncompetitive, just by looking at a spreadsheet. You do not really know WHY people buy your product. Maybe there is some regulatory capture that gives you an unfair advantage. Maybe they just haven’t heard of the rival products yet. Maybe they got your product cheap, so are making-do with it until they can afford the better product. maybe it was a gift.

Anybody who just used twitter for 30 minutes a day can tell you its swamped with hatred, anger, arguments, abuse, impersonation, trolls, scams, spam, bots trying to manipulate the news and much more. Anybody who has ever set their timeline to ‘recent’ and seen twitter secretly swapping it back to their algorithm without you asking, KNOWS its horrendously awful UX. But of course if none of the people in charge ever use it…what do they care?

It seems on a day-to-day basis I am increasingly coming into contact with businesses that have no idea how frustrating their product is to use, how impossible to navigate their processes are, and how absolutely infuriating it is to contact anybody. Do we honestly think any call-waiting queueing system would exist for one second if the chief executive was forced to communicate with his own team through the external-facing phone-bank?

This sort of thing drives me absolutely insane, but its also why I have a successful business, and multiple million-dollar selling games, over a 25 year period. Its actually *really easy* to do well in any business. You just make a decent product, work hard, listen to customer feedback AND try your own product and keep refining until you and they are happy with it. It sounds too easy to be true, but the reality is 99% of people are not working this way at all.

An additional; problem, which confounds this lack of experience with their own product/service, is that people at the top in most businesses make it absolutely impossible to contact them. Look up any big company such as apple, google, facebook, reddit, twitter. Show me the way of guaranteed contacting a human being at one of those companies in the next 15 minutes. Impossible.

Every barrier between you and your customers is another step you are laying on the path to failure and bankruptcy. Companies who totally blank their customers and consider them to be peasants, not worth talking to, are companies who have absolutely no clue what their customers actually want.

Do customers really want an 8k TV? No, but people are making them. Does anybody really want the metaverse? No, but its getting invested in. Does anybody really want to sign up to 8 different streaming services? No, but here comes another few… Does anybody really want to remove the headphone socket on a phone? no, but there it goes… again and again and again.

Sometimes a companies management isolation is so laughably bad, it can go years, maybe even a decade without realizing it has no idea what its doing any more. Adobe probably think people REALLY like having to subscribe to a monthly service just to edit some graphics files. Whoever runs CBS probably thinks people are really excited to sign up for their streaming service. Microsoft seem to think we are excited to know exactly what random redesign the windows taskbar and explorer gets next year. These companies are all absolutely delusional.

So my top tip, if you run a company: make it REALLY easy for people to talk to the management, Even the CEO, even you. You will not get anywhere near as much email as you think you will, and the best thing is you hear about (and fix) problems immediately, not after sales drop for 3 consecutive quarters and none of the geeks in the accounting team understands why. Video game players are notoriously argumentative, aggressive, passionate and prone to outbursts, and yet my email address (cliff at positech dot co dot uk) is all over the web, all over the place, and it all goes to me, totally unfiltered.

I’ve sold 3 million games on steam alone. Today so far (midday) I got 2 emails. What are people so afraid of?

Democracy 4: Voting systems DLC Video

I did another video! OMG I have not done one in ages, but it seems to have worked :D. This shows some small UI changes plus all of the features that get included with the voting systems DLC, out in a few days time :D

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.

…anyway…

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