Trial and Epic Fail

Ventures of an indie game developer

C++ parsing, Linux, and Linux no more

I recently "modernized" my C++ code style using a Python script. The script didn't catch everything and probably contained some bugs, but considering the amount of text it had to go through I'm pretty impressed with it anyway. C++ is notoriously hard to parse, and I just had to write the whole thing from scratch.

The script converted:
  • 1335 filenames+paths and 1040 include statements to lowercase;
  • 16 namespaces to lowercase;
  • 45 global variables from gMyVariable to g_my_variable;
  • 1550 constants from MY_COSTANT to kMyConstant;
  • 2556 member data variables from mMyVariable to my_variable_;
  • 6100 unique stack variable names from lMyVariable/pMyVariable to my_variable.
When the scoped stack variable and the parameter stack variable would collide, the scoped stack variable got an extra underscore, like so: _my_variable. Another 7k classes, functions and macros were left untouched as they already complied somewhat with Google's idea of a good coding style. Before-after:

So the code got a fix-up. Then I open sourced it on GitHub. And eventually I've gotten around to building the binaries for Linux (including the simulator for Trabant).

Wonderful! Finally I can leave the crappy world of Linux! The GUI is yuckie, but there's so much more to it than meets the eye at first. Here are some of my recent encounters:
  • Installing my Samsung laser printer took me hours, and the final solution included manually downloading and compiling some part of some CUPS driver (CUPS was originally an Apple network printing framework made open source).
  • Installing the scanner was fairly straight-forward, and worked quite well as long as I didn't perform too many configuration changes to the scanning software while the scanner was on.
  • When I booted, the computer would often hang with a blank screen due to a broken motherboard.
  • When I replaced the motherboard I got USB 3 support. Which rendered the USB scanner software non-working. Took me forever to realize what the problem was. Had to go into BIOS and disable USB 3.
  • The problem with the motherboard was not with the motherboard. Even with the new motherboard the system still hangs during boot 10-20% of the time. Probably some driver and/or some part of the kernel that hangs.
  • If computer hibernates, it hangs during boot 90-95% of the time. And takes forever those few times it actually does boot.
  • Had automatic updates enabled. Got a new kernel, 3.13.0-83. Hangs during boot 100% of the time. Same with 3.13.0-85.
  • When Ubuntu 16.04 LTS got released, the old 14.04 LTS became unfashionable and I was no longer able to update my system. I also don't dare to update to a newer Ubuntu as the most recent kernels crash on my machine.
  • Thus I was not able to install vlc to watch films.
  • Could never get my expensive Philips screen booting to 144 Hz. Instead I had to run something as extravagant as xrandr --output DP-4 --mode 1920x1080 --rate 144 every time I log in. When run the screen flickers for five seconds which lead to me not using that command at all, I just leave it running at the default 60 Hz. I could have just bought a 60 Hz screen for 1/3 of the price.
  • Whenever I jack in the HDMI cable to watch something on the TV instead the monitor flickers for five seconds and half of the time the TV becomes the primary monitor, so the thing corresponding to the "start menu" goes missing. Is the glass half-full or half-empty you ask. For Windows users' it's half-empty I can assure you. Also switching sound to go through the HDMI wire takes installing a software like pavucontrol and then clicking around for ten minutes until you succeed by accident. 
  • Default fonts, and font rendering in general look like shit. In the desktop and in the browser. I didn't think I had any preferences what so ever regarding fonts, but I apparently must have a distaste for ugly font rendering.
  • I used CodeLite for C++ programming and Sublime for Python hacking. CodeLite is free and has a lot of (MSVC-like) features, but is lacking some important ones like mouse hover over variable while in debug to read it's value, and keeping debug vars expanded during single-step which is really frustrating to be without. As always with large freeware, most of the interface is extremely poor and it's filled with output panes, quirky icons, incomprehensible check-boxes and empty areas with strange names. Which of these ugly icons and/or tabs would you click first? Dare to click one without mouse hovering first? I think not.
    It's not that I'm ungrateful or anything - or well I'm that too - but it's just that why would you want to work with this low quality when you easily can choose not to?
  • Sublime is like a poor version of Notepad++ and lacking hotkeys for "replace all" and similar features which Windows' users take for granted; the only option is to retort widd da mouse. I've used vim more than ever before in the last months, but the i-esc-:wq mode switching from the seventies sucks ass and if I ever use Linux seriously in the future I'll start using Emacs again. Vim you fucker.
So all in all, Desktop Linux made me buy a motherboard and a screen I didn't need, and I've wasted many hours building my own shitty software on other people's shitty software for no apparent reason since only 1.65% are stupid enough to run Linux on the desktop.

Where there any extenuating circumstances? Well when apt-get worked that was nice. And at first I was a bit infatuated with the "configure everything" concept. But frankly, that was it. As soon as I have time I'll move over to Windows 10 and never look back.

Bad conf

Went to my first conference ever in the beginning of the week. The conference was free and cheap, but I was surprised by the mostly unrehearsed, poor speakers and by how little the conference was about hard-core programming. My warning-bells started whistling already in the first few minutes when all return visitors were asked to raise their hands - and less then ten out of seven hundred did. From there on it went downhill. (The food was excellent though, but food is for suckers.)

Perhaps one should try to start something small in the municipality. Like inspiration for the kidz and socializing for the elder nerds. If I had more spare time I could have given it a try, but for now I'll just settle with a backseat driver's "I could have done better than most presenters at"

Free game engines++

When I started out writing a game engine fifteen years ago or so, the end-goal was to create a good one that could be sold. It didn't take long to realize that would never happen, but I stuck to the idea of developing a game engine and not just games.

Possibly one of the poorest choices in my life. I've spent enormous amounts of time on details that UE4 and others surely solves more elegantly and without sleepless nights.

In the duration of the project I've started a game engine from scratch, abandoned that to work with a friend's game engine, then abandoned that one to work on another friends game engine. Eventually, in 2006 I think, when he abandoned ship, I gave no shat about the redundancy and poor quality of the base we'd lined out and I just ran with it. 3 year later the UE3 SDK became free and last year UE4 came out. 7 years post UDK3 and my game engine is so utterly pointless that there is no point in keeping it to myself.

Not only have I struggled too many years, but I also had no time to refactor the code where it hurts. One especially poor decision, to use inheritance in two central "GameTicker" and "GameManager" classes makes my own eyes bleed, not to mention what it must look like to an outsider. Another bad decision. to use asynchronous resource loading to be able to stream huge amounts of world data (think MMOG), was also an awful one as it makes for horrible, fragile code, and there are coroutine options since 10+ years which would have been a much nicer solution.

When we started coding many years ago, hungarian notation seemed like a good choice. Now that I release the source code free I wanted something better, so I converted to something similar to Googles C++ coding standard. I wrote a small Python script for it, but it was non-trivial to get things flying and I easily spent two days on it.

Anyway, the code is out there. If anybody ever has any use for it, great! If not, well, hopefully I learnt something in the process. If I did, maybe it wasn't so bad after all. Trial and epic fail must the closest to the meaning of life one could ever get, right?

Surprising 17k iOS downloads

Was astounded to find that I have some 17k downloads on App Store. Not today, but overall. Lifetime. A that's like 10x than I thought! Life is humbling, isn't it?

The first app I released in February 2011. It was not a game, but a fairly good what-favorite-tv-programs-are-on-later-today app called "TeveSilen," or "The TV Strainer." I wrote it to learn the basics of native iOS controls for work and charged $1 for it. Without any marketing what so ever I suddenly saw sales for a single week in the 100s. The reason, I found by googling, was that the largest telecommunications company in Sweden, Telia, had written a review in their blog.

Since then I've released five games, the first one was a port of the classic Slime Volleyball which was created as a Java Applet in the 90ies by some anonymous guy, presumably from Australia if I remember correctly. I put my Slime Volleyball port for sale on the App Store in mid-2011 for a buck. 5% of my downloads come from Slime Volleyball.

2/3 of my App Store downloads come from the first game I made myself: Kill Cutie. I launched Kill Cutie as a free app in 2012, but I was so worn down by the App Store release process (porting my game engine to Mac+iOS; handling iOS device rotation in a portable way; creating icons; creating screen shots; writing the info text; creating developer+app accounts, keys and certificates; dealing with the release process; etc.) that I didn't have any energy left over to create a good game mechanic.

The game had four levels and four vehicles, but only one of each was free, the others were in-app purchase. The controls came out as pure sheit. Content-wise, as with all my games, it looks like something the cat dragged in and the rendering sucked. I didn't follow my own advice to do exploration instead of refinement. I've never looked for reviews or anything like that, and I guess the reason for it being downloaded 12k times in the four years it's been on the App Store is the name. And possibly the icon. And certainly the totally deceptive App Store description.

The one feature that adds a little bit of umph an otherwise lousy game is the high score list, which frankly is very good. You just enter your name and press enter. No account creation, no checking for "is that really you," nothing. The app just sends a simple message to the high score server with a digest to keep the simplest hacks out and the player is able to see his/her position overall. The score counting algorithm however is still a mystery.

I've sold 114 level and vehicle in-app purchases, 1‰ conversion rate. A telling figure.

After Kill Cutie I made Downwash. It has controls that works for very small kids, as well as extremely hard controls for the nerds.

I've loved radio-controlled helicopters since I was a kid, and always had a couple (!) at the top of my X-mas wish list. My parents never got me one, which was probably for the best as they were hugely expensive 30 years ago and extremely hard to fly. Now I own a couple of tiny, cheap, battery driven ones and I still love them. But as always (and without dragging Buddhism into it) the fantasy about a R/C chopper was better than actually owning.

Making a game based on what you loved as a kid was not the best idea, and placing it in the simulation -> education categories was just coo-coo. Education!?! Is that hubris or what?! Who gets educated by flying these dummy helicopters? Anyhoo, 9% of my sales come from Downwash. As can be expected, the sales bump when launching Downwash is hardly visible as I charged $1 for it.

Then I made Bound 3D, which got a launch spike since it was free. The game was exceptionally boring and I don't think I ever got iAds working. I sold 10 in-app purchases for Bound 3D, which is remarkable as you don't have to, to get rid of the advertisements.

My latest game NSAgent has sold 288 copies a buck each. NSAgent is probably worth five minutes of play when you've spent your hard-earned dollar and have nothing else to do under gun-point. There is no launch spike what so ever in april 2014. I made it free yesterday, and judging from the past I'll get 1k downloads in the next year or so.

My five games were sold without any marketing, promotions, news letters, press releases or helping hands. Possibly they ended up in the "new games" part of App Store. Otherwise I doubt I'd see any spikes at all in my downloads.

My game prototyping tool, Trabant 4 iOS, is free but only downloaded 133 times. Which is better then I thought but still yuckie.

I've never tracked the downloads of the Mac+Windows versions of my games from my webpage, but I have to guess they're around a dozen, and I'd be surprised if they were more than a hundred.

My goal for the next game will be to get more than 17k free downloads in the first month. As soon as I reach a critical mass of players, I'll turn it into a paid application. The icon style was probably best in Bound 3D, so I'll use that. The App Store description of Kill Cutie was good, so I'll see if I can produce something along those lines. The game will land in the action category of App Store. And I will not release until controls are great and the game is fun. Looking forward to making a great game for the first time. Wish me luck!

Sleepless in Floda

Tossed and turned, woke up early, couldn't go back to sleep. Realized my decision yesterday was wrong. Came up with a new plan:
  1. Release a couple of my games on Debian.
  2. Open source my code, put it on Github. Nobody cares anyway. Compared to Unreal Engine 4, and that's what I and most others compare to, it's crap anyway. Apart from it's very specific 3D physics domain, it's useless. And frankly I think it's useless to everyone else anyway, as the design suffers from organic growth without refactoring. And I'm not going to fix it any time soon.
  3. Release Trabant for Ubuntu, using .deb packaging. Don't know what, how or why.
  4. Co-create some actual games with my kiddies using Trabant. I'll need to make some additions to the API to be able to supply content such as sounds, music and what not. I'll attempt to release the good ones on App Store. If I'm able to reach the fidelity required by Apple, we could mass produce games! As long as the kiddies find it fun this could be a blast!
  5. Create the great game that I've been building up to for so long. My currently best idea is a massive multiplayer online GTA2-tank-style game (minus the walking sprites) where you earn money as you blow up opponents and loose money when you get hurt. The money is used to build bigger+better tanks. I'll prototype the whole thing in Trabant until it rocks. If it doesn't I'll scrap the idea - if it does I might build the whole thing in Trabant.
  6. Sell/educate about Trabant, Python and/or the importance of game prototyping. This would be really fun to do part-time, hopefully yielding some extra dough.

This feels like a much better plan, and even though it's going to take a little bit longer to realize it's definitely going to be worth it. It will to some extent relieve my pain of having wasted so many years building a useless game engine, regardless of the result. If the engine fails me, so be it. At least this way, I'd have put it to the trial-and-epic fail test. That makes all the difference to me.

55+ and still going strong

Today I found to my surprise that my 55+-somewhat female colleague, who normally works with mainframe computers, is a game developer. Didn't see that coming. She and her friend decided to build a game, bought a game engine, learnt PC programming, went to a game developer exhibition for inspiration and spent three years actually building the stuff. That is sooo cool to me - fuck the comfort zone! Ok, so the outcome may not have been the awesomesty in the universe.

But still! It's on par with my design for sure. And both I and my colleague still has a couple of magnitudes to go before we're anywhere near modern graphics. Take this GDC talk at the other side of the spectrum:

I'm glad I've always postponed graphics, I couldn't have kept up with shaders, GLES 1, 2, 3, Vulcan and the rest. Come today where all game engines are free-ish and a fork in the road for me. Should I:
  1. try to build a great game, using my own game engine and ignore everything graphical; or
  2. try to build a game using Unreal Engine 4; or
  3. finally take off my rugged and ugly indie game development hat.
Both #1 and #2 involves huge loss of time and energy, and at a staggering risk of failure. The third option closes one door but opens even more. So, at least for now, I'm going to go with #3. Here's my plan:
  1. Build and release a couple of my sad games for Linux. How hard could it be?
  2. Port Trabant to Linux.
  3. Try to find some angle of sales and/or education around Trabant.
Trabant is really good, possibly the only really good software I've ever written. But the hard part about marketing it is making game developers realize that rapid, interactive prototyping is essential.

As an example, just look at the AppStore. According to PocketGamer there were over half a million currently active games in 2012, and by a five-minute google I'm assuming that number is fairly stable. 20-25% of all AppStore apps are games. How many of those games have more than a handful users ever heard of? 10%? 20%? Considering that by 2015 35 apps in Google Play had 100+M downloads among them, and that by 2012 400k apps on the AppStore had never once been downloaded, a lot of indie game developers have a long way to go.

The same is probably true for smaller studios as well, so I'd say that there is a desperate need for Trabant among those that want to create arcade, racing, simulation, puzzle, dice, strategy or robotics games.

It is really invaluable to be able to start seeing things on screen from the first line of code, to test an idea in hours and to start testing on your iPhone in seconds. I hope I am somehow able to convey that message and make Trabant the go-to product when it comes to simulation prototyping. Before that can happen, there's a lot of work to be done.

Deep Blue (Something)

When IBM's Deep Blue beat Kasparov in chess 20 years ago, they said go would be the next big hurdle. Now Google made that hurdle history by beating a go grand master. What's next? IBM's working on their Watson, and have already made some progress on cancer diagnosis and financial bots working the core of investments (in a broken economic system). But those are really only pattern-matching, same as sound or image recognition. It might be impressive by today's standards but not really new or outside the box.

Some (for instance Google) say the next goal should be beating a Starcraft virtuoso. Sounds both plausible and interesting to me. If they manage that, and I can't see why not, only the written, and then the spoken Turing test remains. And the latter, I'm sure, will never be accomplished.

There are two reasons I think that. The first one is that no amount of pattern-matching will ever get you to human behavior. I think we are more than patterns, more than just the sum of all previous experiences in life. The second reason is related. I believe - for good reasons, I must add - that humans have souls that are not part of this physical world, and not causal. At least not causal in the everyday space-time semantic.

AI will still be able to do fantastic things, and may well take over the world if we ever move across the singularity in the future. My current thinking only sees it as highly improbable.

About the author

Min bilder
Gothenburg, Sweden