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

Democracy 4 crowdsourced translations now on localizor

I was musing about how on earth to manage the people who are keen to help out translating Democracy 4 when I was pointed at this awesome website called localizor which seems to be set up to do exactly what I needed: Localizor

This is so cool. Its basically an online database for you to share the translation keys for your game, and optionally a single reference language (in my case obviously English) and anybody who wants to contribute can enter text for any of the languages you have listed. There is a cool progress bar and it also shows you which users have made the biggest contributions. Its basically awesome.

This has cool features like showing you the google translate version of any string, so I guess you can check that people are not typing in absolute nonsense (or worse, something offensive), and people can vote on each others contributions etc. I think you can ban people too, if they are being malicious. Its basically a reall well-thought out system for doing exactly what I need.

There is a free trial, and then it costs a monthly fee, but its cheap, and a no-brainer really. TBH the biggest hassle was writing the code to output all my translated data (which is in csv files, and some ini files) into the right format to be imported into their database. It works on the assumption of KEY = VALUE as opposed to some of my stuff which has KEY,VALUE1,VALUE2,VALUE3 etc, for a bunch of different columns of data.

All-in-all it took about 90 minutes to write code to dump out all my text, and then manually submit the whole lot to the website. I also need to import the nearly-done fan-made italian translation I have, and eventually write my code in reverse to slurp up whatever format the site exports to and pump those values back into my own format.

Democracy 4 is, by its very nature, a global game, and its really cool to be able to leverage all the work jeff did regarding unicode, and vector rendering and fonts so we can support some often less-supported languages. I’m especially excited at the thought of Democracy 4 in Korean :D

Democracy 4 is in Early Access at last! omgz etc

I’m super tired and got little sleep, but whats the point of a release-day blog post if you do it weeks later? Frankly I need sleep, and a day off. Making this game is REALLY hard, and we had last minute problems, and I actually have a minor eyesight thing recently thats freaking me out. Argggh. Game dev is HARD.

Anyway, last night at 8PM my time (why? because I’m stupid), Democracy 4 went into Early Access. We have already sold a lot of copies, we had 7,600 games played yesterday, there are tons of emails, and forum posts, lots of youtube videos are cropping up, some previews and reviews…its all very hectic.

We launched with a bad bug for maybe 4-5% of players (maybe less), which caused major GUI mayhem. Icons would dissapear, or be massive, or the wrong icon. The game became unplayable, then there was major lag. It was a mess, and the worst possible thing: I could not reproduce it on any of my PCs. Fixing a bug that has no error message and you cant reproduce is…challenging. At the time of writing I’m feeling pretty good that I’ve fixed it, within 14 hours. Thats actually *not too bad*, although it still probably dinged our steam reviews a bit. (if you bought on steam and like the game PLEASE give us a nice thumbs up review!).

I made a lot of mistakes, and I guess this is as good a time as any to confess to them. Mistake #1 was that I didnt treat every warning in my code as being serious. I was seeing some warnings about icons being sized wrong, but it didnt seem to show up on screen, and I figured it was a harmless thing when they got resized correctly before being drawn. who cares right?

Turn out that on some PCs, in some screen resolutions and in fullscreen mode… This caused MAYHEM of EPIC proportions. I just wasn’t seeing it under any circumstance in my test cases. PLUS! we had a lot of pre-EA alpha players who had not experienced this. But… yesterday 4,500 hours of Democracy 4 were played in 14 hours. No wonder stuff cropped up we had not seen before.

We converted the game to be 64 bit a few days before release (Mistake #2), which sped up the start-up time, and future proofed the game against any insane move my microsoft to ban 32bit…but this seemed to be the cause of the bug. It also stopped it running under WINE. I decided the 64 bit middleware had broken the game. I reverted to 32bit, it achieved nothing (but got us WINE back), but wasted my time in tracking down the real cause…

Eventually I think we have found whats going wrong, and here is Mistake #3. Some of our code was just blindly accepting data and doing what it thought was right. This is BAD. You should code defensively, and if you are about to draw an icon on the screen, its worth checking that the width is not -25 or 10 billion pixels wide. if it is… then somebody probably screwed up, so don’t draw it.

Anyway… this sort of thing is SUPER stressful, because we have moved from the lovable, friendly ‘community of friends’ atmosphere of my early-access players on my own discourse forums, to the terrifying confrontational angry wasteland of the steam forums, where people pull no punches. Its always fun to be told your game is rubbish, or biased, or you are a stupid/lazy developer who doesnt know how to code etc. Oh fun times!

Anyway… its out there. it was in the steam top sellers. it might still be, I’m too busy to look! And you can now get the game from us direct using the widget below, OR from steam gog or the humble store.

At some point I’ll do a proper update with a bunch of stats about wishlists and release and all that (we had about 20,000 wishlists on launch day), but I need to deal with the huge list of stuff in my inbox first… Thanks to everybody who put down their hard earned money on buying my game, its hugely appreciated. I hope ya like it!

The irritating last-minute bug

So…I am 99% sure I’ve fixed this, but it was a bug hell nightmare and worthy of a blog post. It also kept me coding till midnight last night, so I did probably 14 hours work yesterday. arrrghhh. no wonder I slept late this morning. Anyway…

Democracy 4 releases into steam early access on Tuesday, but we already have 3-4,000 players, and I had no showstopper bugs., Most noticeable the game was 32 bit, and only in English. Very recently we switched to 64 bit, and I guess some combination of that, and some people playing in different countries started me on a journey of bug tracking hell.

I got one bug report “game crashes on next turn, or if you change sound volume”. I tested my copy, worked fine. Tested on my laptop too, worked fine. Asked them to try and repro on another PC, arrogantly assuming user error. Then another customer reported the same thing, then a third. This is NOT GOOD. I asked for debug logs, which handily my engine does do, and are fairly comprehensive.

Nothing in the logs explained the actual crashes. Everything looked good. nothing was especially shocking except an error about failing to find a specific neuron (no name supplied). This could be just a typo, or a badly written mod. This *shouldnt* happen, but the game should recover. its not critical… but then why didnt MY copy give me the same error… weird?

I put together a new build of the game that outputs the NAME of the neuron it can’t find (should have done this anyway tbh), and I get back a log from a user where the missing neuron is called 0,00.

WUT?

That sounds like a bug with a comma somewhere, as the equation Socialist,0.00+(2*x) for example must have a typo, so instead of the name ‘Socialist’ we are getting the value. Ha! a simple typo. But why am *I* not getting the bug? I do a windows search of the whole data folder looking for 0,00. I get two hits… neither file actually contains the string. Windows search is WORSE than useless. Weird…

So I change the code again to output the name of EVERY attempt to get a neuron by name so I can compare mine with the users, and see where in the code they were just before this goes wrong. This turns out to be no help, as its inside the Voter processing, which makes no sense… there is simply no way any string like that is being passed at this point in the code. this makes ZERO sense.

And then I notice it. I’d normally missit…but it was weird. REALLY weird. In the debug logs of the players:

PreCalcCoreSimulation time: 0,70 seconds

No big deal, this value will vary based on CPU, but on my PC it said this

PreCalcCoreSimulation time: 0.92 seconds

Yup. Mine has a period/full stop, theirs has a comma. No big deal, its debug logging, who cares. Maybe its even an artifact of copy/pasting the log to my forums… I check this…nope. I ask the player to verify thats really a comma in that log file, not a full stop, they confirm its a comma. How? HOW is this possible? I check the code:

char temp[256];
sprintf_s(temp, 256, "\n\nPreCalcCoreSimulation time: %.2f seconds\n\n", elapsed);
GetDebug()->DebugOut(temp);

This is simple stuff. I just used the very low level, very basic, very simple good old fashioned sprintf function to convert a value into a decimal number in a string. I do some googling and… what the actual fuck? apparently even good old c++, ignoring anything higher level, is looking up the regional settings, and deciding whether or not commas or periods are used in decimal strings. In english its full-stops (.). It is VERY VERY important to the structure of my code and engine that its full stops. When the majority of your data uses comma-separated values, you cant go messing around with the definition of a comma for fucks sake…

So theoretically easy fix, find the function that hacks in the ‘locale’ to be English for this app…and boom! No! it doesn’t work. Sure, I can use

setlocale(LC_NUMERIC, "en-US")

to force the number format to be full-stops, and when I check that the locale really has been set…it has! and everything is fine but… once the game loads a new level, everything has gone haywire, all the values are wrong, all the policies are set to zero, and checking the locale returns what the PC has set it to (I temporarily changed mine to commas as a test). In other words….my setlocale is being overrriden.

Arggh. Now its late, I am tired, I am thirsty, but not enough to leave my desk and lose my concentration. I am very tired now. I spam the code with multiple checks to read the locale at every possible location to see where the hell it goes wrong… And eventually I find it. Its the text renderer, which does use some middleware, to convert fonts into vector graphcis, render them into memory and then paste them as strips to the screen, dynamically. Its all very clever and supports any language, any font size, its super l33t. It also has its own opinions about locales.

So now the game is fixed, by me setting the locale to the US the millisecond the game starts, and then the minute its rendered its first bit of text (and thus the middleware has overrriden me, it sets it AGAIN, to ensure no funny business. Everything now seems to work. Hurrah. I hate computers. I need sleep. Why the hell cant humans agree on what a decimal point looks like in 2020?

Democracy 4 Developer Blog #22 : French Steam!

Voila! Hope you like it. One more update (and country…Canada) before Early Access release…

Plus we are super close to Early Access release now, so I should probably stick a steam wishlisty widget in here…

Some thoughts on the evil that is… *comments*

I think a lot about how I think. I’m ridiculously obsessed with this topic, and it kinda screws up my brain. I often have no idea what I think, or what I want, because I am so busy over-analyzing my decisions. Back when I was super into marketing, I read a fuckton of books about decision making and influence, to see what makes people decide to play, or click or buy. I probably got a bit too into it, because now I find it hard to just *want* a thing and then just *buy* it, without analyzing if I really need it or if its irresponsible, or if its good value, yada yada…

Anyway, despite that annoyance, it does yield some benefits in terms of me noticing changes in my own behavior and my attitudes over the years. One of the more weird things I have noticed is how successfully silicon valley billionaires have persuaded me to think differently about information.

Back in the pre-internet days, I would read a book or a newspaper, and think about what it said. I would turn the topic over in my mind, dwell on the facts, or the arguments made, consider how persuasive they were, or were not, and think about how this new opinion/commentary/information could improve my life in some minor way. Maybe I just read something about physics. Now I know a bit more about physics! maybe an opinion piece on tax rates…now I have a more refined sense of my own views on tax rates… whatever.

I think the important thing here is…the time. The actual reading of new information is only the gateway into learning from/absorbing it. If what you read is good, it will stimulate a lot of thought. Some reflection on what the deeper implications are, maybe discovering links to other views or information in related areas. You have *improved* from reading the information, but also mostly from the post-reading consideration and analysis of it.

Say for example you read ‘the communist party manifesto’ by Karl marx/Engels or ‘Capitalism’ by ayn rand. (FWIW I’ve read both! … sort of, got bored with 2nd one) You probably get triggered by the opinions in one or the other of these books, maybe really angry, maybe you think those views cannot hold up to scrutiny etc… But left alone with a paper book, you cannot *react*, you have to consider. You have to analyze, you have to allow deeper thought, and reflection.

But not now.

Now we read everything online, and even if there are NO comments on the article we read, you can bet a site like slashdot/hackernews/reddit/facebook is where we saw the link, and there will be tons of comments for us to join in with there.

There is now NO TIME set aside for considering what is being read. You MUST comment. You MUST read other peoples comments. I feel it too, this is not me being superior, I feel that pull too. I have read something that I have an instant opinion on. I MUST SHARE MY HOT TAKE IMMEDIATELY. In many cases, who really needs to RTFA (read the fucking article) when you can post your half-baked instant reaction simply to the buzzwords in the headline. Do NOT think, COMMENT!

Someone Is Wrong On The Internet. - Pellet On Pellet - Field Target

Of course this is bad, because it means 5% of what we read is thought-out and researched, and considered, and 95% is hot-takes responding to (if we are lucky) the content of the article. I wish there was a way to auto-track how much of what I read is journalism vs random strangers reactions to journalism. I suspect the ratio is very worrying. (BTW I am not elevating ‘journalists’ here, I am referring to any considered, thought-out piece of writing, and actual *article* instead of a single-paragraph hot take).

Much of what is true feels wrong. We tend to overlook this, but some thought shows it to be true. Here are some things that I am led to believe to be true, but which I subconsciously suspect must be wrong, intuitively.

  • The Earth is a sphere.
  • Aeroplanes, made of metal (which is heavy), can fly.
  • Quantum entanglement is a thing.
  • You can raise a tax rate, and then take in less money from that tax.
  • The earth is hurtling through space at an incredible speed.

If I was not aware of any of these things, and saw them posted on the internet, I would likely have to fight an immediate urge to respond with my ‘hot take’. “FFS metal is HEAVY, no special shape, or strapping it to an engine will make it fly like a bird. Have you ever SEEN a bird? the article is clearly BS. This so-called aeroplane doesn’t even flap its wings FFS. what bullshit. Downvote.

Exaggeration for hilarious comic effect indeed. But there is a nugget of truth here. We have been conditioned, by the clickbait seeking engagement-time metric maximising billionaires of silicon valley, to ENGAGE with content, but not to critically consider it, or appraise it. That 95% vs 5% metric is why this is the case. There are simply not enough ad-views generated by reading a single article, but if we can twist that into a 50-page comment thread where people post hot takes, we can get hundreds of ad views of ‘engagement’ for the cost of a single piece of clickbait!

Comments are sometimes good, and the point. A forum about a video game where people share feedback or discuss strategies. and make suggestions is good. Thats a deliberate decision to set up a forum to discuss a topic, but comments on the news are often cancerous and awful. Facebook, Reddit, Slashdot and the rest provide ZERO actual content, they just link to other people’s work, and then monetize peoples hot takes, with a built-in voting system to encourage partisanship and arguments. People get so invested in the comments, they forget what the article was about. The article was the hand-grenade thrown into the room by silicon valley so they can monetize the bloodbath it generates.

We should fight the urge to comment on everything we see. I struggle with this every day. You can never know the pain I suffer of reading an article suggesting hydrogen powered cars make sense, or that writing your own game engine is pointless. *must resist*. Yet I think its better if we all do so. Do not comment. blog your own rebuttal. Think about it. put the effort in. Generate real content, not hot takes.