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

Positech homepage mobile re-design

I don’t sell mobile games, and I don’t play mobile games, but like it or not, most people spend most of their time on their mobiles now, not a desktop PC< which is the target market for my games.

With that in mind, it makes sense for my website to not look a total and utter train-wreck on mobile. Historically, it has always done so. I have redesigned the homepage today so it serves a slimmed down version for mobile which looks basic, but not a total usability nightmare:

This is the ONLY page with that redesign, so clicking on any game will quickly ruin the experience, but that is surely a project for another time, when I am less busy with Democracy 4 updates. FWIW, the desktop website has a different, more appropriate layout:

I used to do some fancy responsive design that filled up all that black space, but currently I am not doing so. At some point I will likely do a complete redesign of everything.

Positech has enough games now that it can really be laid out more like a traditional store such as GoG or epic, with a consistent theme across each game, but to do so would mean re-arranging a ton of content, as each game has a FAQ, some modding information, a buy page, and maybe pages for DLC or for educational purposes (site licenses). TBH some of the real old games like redshirt or Democracy 2 just don’t sell enough copies to really care too much about how modern their sites are…

In other news I have a big update on the solar farm likely happening this week, so lots to write about soon :D.

The sad (but fixable) state of gamer discourse…

To be honest, using a polite term like discourse to describe this is probably unfair, as the general level of communication online by pc gamers should more accurately be described as ‘sarcastic, aggressive, abusive unjustified screeching and yelling’. That feels more accurate.

I guess in-between major game launches I forget just how bad things are, but perhaps this is not the case and things are actually getting worse. I do know though, that now I am 52 years old, and having made over a dozen games, I am absolutely ready to give up on communicating online about games.

I have friends who are writers, and the difference between the discussion of novels and the discussion of games is like night and day. The discussion around writing seems to be more constructive, more reasonable, and approaches the tone of conversation you might have in a pub, or a restaurant, or when hanging out with friends. Some books are considered badly written, and described as ‘disappointing’ or even ‘boring’, but it rarely, if ever approaches the level of rabid antagonism that is associated with PC gaming.

To be clear, I am not just talking about my own interactions as a game developer. Reviews of my games are generally pretty good, and my sales are pretty good, and things are going fine. What I find depressing is how commonly you encounter people who are just professionally abusive, angry and aggressive. Believe it or not, you can actually click on steam reviewers and see other posts they have made about other games, and all too often you encounter these people who are frankly just professional assholes, about every game, and to everyone.

If 95% of your comments in a community (ha! the word community is so abused, when in gaming terms, its more often a rabble or a scrum) are negative, sarcastic or abusive, then really why the hell does that community need you as a member? I cannot imagine any business case for keeping the 1% of the most abusive, offensive members. It seems like a no-brainer to just take that 1% of steam ‘community’ members who have been warned or banned in the most forums and just close their accounts permanently. The only reason not to do so is probably that they spend some money.

This is the problem, sales income is associated with their accounts, but the destructive impact they have on the community as a whole is not being measured.

This is a major economic failure, and is a classic problem that economists refer to as an externality. (Cool fact: I actually studied at the London School Of Economics, unlike 99% of the abusive commenters telling me I am thick, stupid, clueless and don’t understand fuck-all about economics when they criticize my politics games…sigh…)

Externalities are major problems, and economists spend a lot of time trying to devise systems to solve them. A classic externality is pollution. If you have a paper mill, and the by-product of making paper is dumping thousands of gallons of pollution into a nearby stream… then this pollution can destroy the livelihood of a fishing business on the same river. This means economic activity is damaged, but unless the paper mill is fined, they have no economic incentive to act any other way. We see this globally with pollution, especially CO2 being a major problem. (Huge shoutout to the ‘special’ people who send me abuse for daring to represent climate change in a video game here…)

Abusive people in a gaming community cause an externality in two ways. Firstly, they drive away people who do not want to wade through trolling, abuse, fights, arguments and hatred, so that those people no longer contribute to the community, and thus reduce the economic value they get from it. (put another way, people just check out of the steam forums, considering them unusable, and thus find it easier to shift to rival stores like epic, as the lack of community is no big deal). Secondly, they drag other, normally quite civil people into abusive arguments, making the community more and more toxic, enraging the remaining posters until the ‘community’ becomes a place to be angry, providing no utility to anybody.

Social media is basically a big fat mistake, because it was designed around a broken mechanic: engagement. All social media seems to based on the checking of a single metric: how much time are people spending in the community. And how many posts or votes are there? This seems to be the only metric, whether this is because it enables more ads to be seen, or because there is a misguided view that this is all that matters.

The trouble is, deep down we are all pretty primitive animals. If we forget that, and tune our society purely towards engagement, then our society is going to resemble the Roman colosseums where gladiators were torn apart by lions before a cheering exuberant crowd. I suspect colosseum user-engagement metrics were excellent.

AT&T Switches Customers to More Expensive Plans Without Permission -  ExtremeTech

You might think this is hyperbole, but I urge you to consider it further. We already have numerous examples of people committing suicide due to abuse they received through social media. Squid game (a show I declined to watch) seems to prove that we have an appetite for watching horrific abuse as ‘entertainment’. Sure… squid game was just escapist drama right? but imagine if J K Rowling (a controversial figure in recent social media) were driven to suicide by social media. Do you really think there would not be hundreds, if not thousands of people cheering this on, and gloating on twitter? It is, at the same time, both true, and shocking to accept this to be our new reality. We are a mob rejoicing at the suffering of others.

We, as a society, MUST turn away from the mindless encouragement of ‘engagement at all costs’. Nothing makes people more curious than a car crash where people died. Just slowing down to enjoy viewing the carnage causes major traffic jams. This is our nature, and one that is clearly bad enough, without it being weaponized by social media in a competition to drive ever bigger profits for silicon valley companies.

It IS perfectly possible to improve the state of a community. Its pretty simple really. There is only one rule change needed. You just make it super clear that abusive posts, personal attacks, and trolling gets an immediate lifetime ban, without exceptions. You might think that’s crazy, but I’ve done it on my own forums for decades, and people still post there frequently. I’d say the level of discussion and debate is way, way, way better than reddit, facebook, the hellholes of youtube and twitter or anywhere else. Moderation is not evil, its not censorship, its just sensible. I’ve banned multiple users on steam from my steam forums for being abusive. The world did not end, it was not a slippery slope towards fascism after all.

Of course I know things will never change, nobody cares. Nobody has the slightest inclination to fix this problem. I’m in some private communities that are really nice, friendly places to be, and I’ve been in others where, due to a lack of any rules or moderation, people behave like they do on reddit or twitter and are abusive. I spend way less time there… In fact I spend no time now on facebook, and hardly any on twitter. I only use reddit for a handful of communities, and never read steam forums apart from my own games.

I feel that things have gotten so bad lately that when you read a friendly discussion where people are civil and thoughtful, it almost feels weird, or like a joke. When people are enthusiastic, helpful and appreciative, where they thank people for insightful posts, or for sharing their experiences… we can STILL do this, we can all be civil, friendly, understanding and appreciative. It just takes the tiniest bit of effort to do so.

So I offer you this challenge.

To make it clear, I want you to do this for OTHER developers. This is not self serving on my part.

Take the time today, it will be less time than it takes to play wordle… to find 3 games on your steam library that you enjoyed but did not review, and go leave a positive review for those games. Not a one-liner, but a paragraph or two, that is helpful, sincere and positive. YOU will feel better having done this. Think of it entirely as self-serving to boost your own mood.

Do it right now. I’m doing it too. (BTW have steam changed this? it seems there is no way to leave a review unless clicking the game prompts you, based on recent play time… seems…unhelpful?)

Democracy 4 Leaves Early Access tomorrow! (a look back…)

So… on 13th January 2021 at 10am GMT, barring critical illness on my part or a meteor hitting the earth, my political strategy game ‘Democracy 4’ will be released from Early Access into the arms of the wider gaming world! Its as good a time as any to reflect on the games history and development.

Firstly…obviously this is not the first in the series of Democracy games. Imaginatively, I named the first one simply ‘Democracy’, and according to wikipedia it came out in 2005. It was GameTunnel’s 2005 sim game of year! go me! The game was the same basic structure as it is now, but with a horrendously worse UI and much, much lower budget, with me basically doing everything. Feast your eyes on this screenshot:

Democracy 1. Yikes

Like Democracy 2 and 3, it had the voter groups as a big chunk in the middle, but I had not realised all those sim values at the top could be placed in with the policies. Also… the bottom of the screen is kind of a disaster of poor UI decisions and incredibly rubbish stock icons. Still… the basic gameplay mechanics were pretty much all there, and I definitely sold quite a few copies. There were even retail versions in some countries as I recall.

Fast forward to the futuristic sci-fi future of 2007 and we released the much more polished Democracy 2, which we still have a website for, complete with amazingly improved screenshots and UI! This time there was an actual proper paid artist with a proper budget, and it starts to look a bit more professional. This version of the game, unsurprisingly sold much better. Feast on this improved UI!

Democracy 2. meh

We still have all the voter groups in the middle, but I worked out I could interleave the sim value icons with situations and policies, and stick all the menu-stuff in one consistent place at the top (although weirdly I still have your popularity under the voter groups). This game was definitely a relative success, although thats only in 2007 terms. Steam greenlight didn’t happen until 2013, it was 2005 that steam started very very very slowly adding 3rd party games. Online games sales were trivially small by modern terms.

I took a break from indie games at some point around here because I worked at Elixir and then Lionhead, but eventually, after having surprising success with Gratuitous Space Battles, I eventually decided to return to making political strategy games with Democracy 3 in 2013. And that when the game really took off and went bananas, especially on steam, where so far its now sold 780,000 units. There was also humble bundles, and retail sales, and ports to IOS, and a total of 4 expansion packs (social engineering, extremism, clones & drones and electioneering). This game had a proper marketing and development budget and looks like this:

Democracy 3: woo!

Hurrah! We now have a UI thats pretty close to the latest version, although voter groups are still in the middle, political capital is top left, and all of the icons and the icon group zones are the same size. This proved to be quite a limitation for modders, and also made it harder to find stuff (there was no text based search capability either).

Democracy 3 did REALLY WELL, and is my top selling game ever, combining with its DLC it beats even Gratuitous Space Battles and Production Line. Its the game that most people know me for, and got me invites to give talks at places like GDC. It also paid for me to develop a love of fast electric cars, which was nice.

There was then a LONG GAP, where I made other games, most noticeably Production Line, and I also became a games publisher, publishing redshirt, political animals, big pharma and shadowhand. Eventually I turned my attention back to the Democracy series to make a better, ultimate amazeballs version of the game, which is Democracy 4, and is being released tomorrow. Yay! Here is a relevant screenshot:

Democracy 4. Woohoo!

This is WAY better. The important icons are larger (configurable), everything is vector based, so looks crisp regardless of screen res. The voter groups are on the side, which makes them a sortable list, and the icons can all resize smoothly in different game modes. We also now have dark mode and palette support, unicode text support built in, and a ton of other design changes.

Some people are very cynical about game sequels, suggesting its all a cash grab etc, but I defy you to look at these 4 screenshots and think 4 is not an improvement on 1. It took 3 sequels to get there, but any coder or designer will tell you that they can make a MUCH improved version of the game they just finished if they get the chance to do it again.

Democracy 4 is released tomorrow, but its not the end of it. I am determined to improve the game balance, and have some more ideas of stuff to add. I am also obsessed with making mod support easier, and steam workshop support in this version is dramatically better than before. Sales in Early Access have been very good, but its hard to know how to compare it because Democracy 3 never had an early access release, and the entire concept did not exist for earlier versions of the game.

I suspect Democracy 4 will stay relevant for quite a long time. Politics is an evergreen topic, and I’m pleased with the fact that its UI is very adaptable to bigger monitors, and also supports unicode so we have decent language support in Japanese, Russian South Korean etc. This should ensure the game finds a decent sized audience over time.

Personally… I have found that this game leaves Early Access at a time where I really need to force myself to take some time off. For me that just means not working (at all!) on weekends, and maybe building up to being able to step away from work one day during the week too. Because I am a workaholic, I already have another company I run alongside this, which builds solar farms, so I am unlikely to not be busy. And I should play the guitar more too…

A big thanks to everyone who has supported the Democracy games over the years, I really do appreciate it.

Still balancing Democracy 4 with data

My current game: Democracy 4, currently has very good steam current reviews and all reviews scores. As I check right now it sits at 90% positive recent, 85% positive all reviews. However, 90% is not 95%, and any improvements to the game are bound to translate into higher scores, longer play times and better sales, and as balancing the game requires a huge amount of data analysis and thought, and is therefore what I consider fun…lets do some more!

Because it is a ludicrously complicated game, the only possible way to ‘balance’; the game is statistical analysis. There is no way I could hire a team of QA people to give me feedback on where the game is unbalanced, because the number of play styles and strategies, and political opinions, and then the different countries, difficulty settings and other options would mean even if I had 100 people analyzing 20 games a day, its still ludicrously trivial compared to the actual ‘problem space’ that the game represents.

Thankfully, the game sells well, and if I pick yesterday as an example, we clocked up a total of 3,754 games played by players in one day. These are proper paying customers whose stats don’t lie, so analyzing the data from these playthroughs is invaluable. I do not collect ALL possible data (that would strain even my dedicated server, whose current database size is 14 GB), but I do collect some interesting snippets (anonymously).

I rely on my own intuition and feedback in reviews (good and bad) combined with forum posts to give me a feel for areas where the game needs improvement. A topic that seems to come up a lot (with justification) is that the first term of a game is pretty well balanced, but if you ‘survive’ to a second term, things get easier and easier and the game loses its challenge. To check if this was really true, and look at some possible causes, I collected stats by each term and got this:

T1 Wins = 54.19 %    T2 Wins = 79.23 %    T3 Wins = 83.97 %   

Thats term 1,2 and 3+ win rate for game version 1.45. Its pretty clear that the intuition is correct. The game gets easier the further you go. The big question though is exactly WHY does this happen. In order to collect relevant stats I needed to think about what factors could make governing a country too easy. Maybe GDP gets high and stays there? Crime gets solved for good? Technology gets ahead and stays there? Unemployment solved for good? I collected player stats at the time of each election and plotted them over 1,2 and 3+ terms to get these stats:

and also…

So it seems that the stats do not lie. Multiple things seem to get good and… stay good. Education seems a bit easy to raise after 2nd term, but maybe thats because a booming economy allows for infinite spending on state provision? Sadly I do not have data for that, but its clear that GDP has an inexorable rise. Its also interesting to see that crime steadily declines, especially violent crime.

Stats like these are invaluable. Democracy 4 has a bunch of self-balancing mechanisms that are not artificial game constructs but based on what appear to be real-world auto-balance phenomena. It does seem to be the case that skyrocketing GDP in the real world can drive massive inequality (relative poverty…. even if actual absolute poverty declines). This rise in inequality can give rise to higher rates of crime, and also to political dissatisfaction.

Higher GDP and Technology can be a sign of increased industrial automation, which should really cause big spikes in unemployment, and thus also ineuqlait6y, but these do not seem apparent. Luckily, I have control of every equation in the game, so after reviewing all these stats I could make a bunch of adjustments and hope to see a budge in the direction of a more balanced (ie: more challenging) late game. Lets look at the new stats for build 1.46:

T1 Wins = 54.54 %    T2 Wins = 76.46 %    T3 Wins = 83.06 %   

Ok… so slightly better T2 (a bit harder…. 76% win vs 79%) and very marginal improvement from term3 and beyond. How did my actual core stats change:

If anything WORSE for GDP, although I did make unemployment worse, and a slight term 2 boost to crime, but fairly trivial. second row:

Ok… so equality IS now harder to raise in later terms, which is a slight improvement, but basically I have been way too meek in my adjustments and need to ramp those changes up. I also started tracking some additional stats:

This is new data for build 1.46 without prior data to compare to, but I felt it important to start measuring. Winning is the value of a special hidden variable I use in the game to adjust difficulty. That percentage DOES go up over time, which makes sense, although its clearly not hitting the upper 90s, so I could simply take into account consecutive election wins as some input into calculating its value?

Turnout is more of a curiosity, but vote percentage is much more interesting. In the *ideal* game of Democracy 4, the player scrapes narrowly through on each election, excited to view the results, and relieved to know they won another turn. 52 and 58% feel about right, but averaging 74$% is pretty worrying. Perhaps cynicism is not a strong enough effect here, especially given that it clearly drops between terms 2 and 3! (in the real world show me a president who people did actually become less cynical about over time…).

So the main thing is that I have useful stats and a system to compare them and check I am heading in the right direction. The game clearly got a bit more balanced between games 1.45 and 1.46, so here is hoping that being able to spend more time post-release on balancing versus features will allow me to improve that even more…

Speeding up Democracy 4 simulation processing (atof is slow)

I just made a major speedup to the loading/next turn/new game code in Democracy 4, and thought I may as well share the gains with readers of this blog :D. It kind of makes me look a bit like an idiot to admit this is a big speedup (I should have known), but anyway, knowledge sharing (especially on optimization) is always good.

Fundamentally, the code in Democracy 4 is structured like a neural network. Without going into tons of details, every object in the game (policy, dilemma option, voter, voter group, situation…) is modeled as a neuron, which is basically just a named object connected by a ton of inputs and outputs to other neurons. You can run through the inputs and outputs, process the values and get a current value for a neuron at any time, which is done for every one of them, every turn.

Also… when we start a new game, I need ‘historical’ data for each value, so the game pre-processes the whole simulation about 30 times before you start to give us meaningful background data, and to ensure the current simulation sits as a reasonable equilibrium.

Those connections to neurons should probably be called dendrites or whatever, but I call them SIM_NeuralEffect. They contain basically the names of a host and a target (resolved to actual C++ pointers to objects), and an equation explaining the connection, and some other housekeeping stuff.

At the heart of it all, is an equation processor which lets you write this:

OilPrice,0+(0.22*x)*GDP

And actually turn it into a value for that effect, given the current situation. The Equation processor runs each turn, on every neural effect, and there are LOTS of them. Thus, if the equation processor is slow, its all slow.

I just installed a new version of the free vtune profiler from intel. Its not recognizing my ultra-amazing new chip, so only doing usermode sampling, but nonetheless it draws pretty flame charts like this:

Before I optimised

This is showing the code inside that 30-turn pre-game processing called PreCalcCoreSimulation. Lots of stuff goes on, but what I immediately noticed was all this atof stuff. Omgz. Thats a low level c runtime function, not one of mine, and it seems to be slowing down everything. This is a HUGE chunk of the whole equation processing code. How is this possible?

Now, you may think ‘dude, atof is pretty standard. No way are you are going to be able to make that code faster’, to which I reply ‘dude, obviously not. But the fastest code is code that never runs.’.

All those calls to atof are absolute nonsense.

Looking back at the equation above (OilPrice,0+(0.22*x)*GDP) there is obviously some stuff in there which is volatile. I do not know what the current value of x or GDP is, so I will need to grab their pointers and query them when I process the equation, but the rest of that stuff is static. That * is going to remain * and that 0 and 0.22 will remain fixed too. This is the key to a roughly 33% speedup of the whole processing in the game.

I actually did know to look into this, and I do not do manual text parsing of the equation each time. I parse them equation on startup, and stick the various values into buckets, so I am not wasting time each turn. But one thing I had not done is store the atof() outcomes. I was still storing variables[0] as ‘0’ instead of just 0.

Now you may think atof is fast. Its fast enough for most cases, but its WAY slower than just accessing the value of a floating point number thats already in RAM, and cached happily in the equation processor itself. Here is the new diagram:

Faster!

The difference is, (on my superfast PC), for the whole precalc simulation function: 0.85 vs 1.50 seconds. This probably makes me sound pedantic as hell, but I’m rocking some stupidly new and pricey PC, so there are likely people playing D4 on laptops a fifth the speed. I might be knocking a whole 3 seconds off the new game time for some players!

Also, and worth remembering, I just saved doing a ton of processing, which means a ton of CPU time, power and heat. If you can make your game run more quietly, more coolly, and faster on players PCs, you absolutely should do it.