Trial and Epic Fail

Ventures of an indie game developer

Buggy boy


This is me attempting to make the pieces schtick to a "grid" using this algorithm:
const vec3 inp = ...;
vec3 outp;
outp.x = int((inp.x-0.25) * 2) * 0.5 + 0.25;
outp.y = int((inp.y-0.25) * 2) * 0.5 + 0.25;
outp.z = int((inp.z-0.25) * 2) * 0.5 + 0.25;
Looks more like I'm shuffling cards than putting together a puzzle. Trial and epic fail, as always.

I also realized that I couldn't use arbitrary meshes as collision volumes, as ODE can't handle triangle-vs.-triangle collisions very well, as opposed to convex volume-vs.-convex volume. But perhaps that limitation isn't all that bad. I really want to use diagonal shapes (in 2D space, in 3D space would make the game too hard I think), but I'll just have to make sure they're all composed of cuboids.

I think I'm finally seeing the benefits of using my own game engine. This simple prototype contains simple rendering, ray picking, physical 3D movement and collision detection, iOS portability out of the box, importing gfx+physics pieces hand-made in Maya (I'll eventually generate the shapes) and a good level of configurability for things such as physics settings. In two evenings and about 330 lines of new code. Generating the pieces and the "environment" will be the hardest. Then look and feel. Then generating some 500 or so levels. And finally all the screen shots, icons and splash screens. If these tasks each take a week and no others pop up, this game should take four weeks to make. X-mas hit?

Alarm functional

I finished my homebrew security alarm some months ago. Or so I thought, after the initial smoke test. So this summer we turned on the alarm for the first time and left home to go swimming in a nearby lake. When we returned home after four hours the alarm was buzzing and had done so two times since we left. I've mounted the horn on the outside of the house, so the neighbours had duly noted the false alarms. They weren't too happy about it.

My initial reaction, as always, is to blame someone else. I e-mailed the IR sensor manufacturer and got back
... check your power supply for noise
- Mhm, I thought. So much for support. But a couple of days back I pulled my finger out and tried a software approach instead. I use signal sampling instead, i.e. 50+ hits means sensor activated, instead of single hit. Voilà, everything works! (Or at least with a chance of 268435456:1 if we assume the conditions are the same as this summer. Which they're not, we had an exceptionally hot summer. Climate change. Where was I.)

Alarm works, my homebrew internet radio/music player works and my Wi-Fi auto-off works. The last one is a miniscule hourly cron job on my Ubuntu server which curls to my DSL router once an hour and turns off Wi-Fi (if on). It's not that I'm hostile towards technology. Ok, maybe a little. There are two main reasons for this invention:
  • I'm afraid of the radio waves generated,
  • if you prefer to use the iPad to surf on something, it should be a deliberate act where you first take the time to go the the router and press "Wi-Fi on".
I don't believe surfing or watching Youtube on end is any good for one's well-being nor for the general level of education. Sure, you'll see tons of new stuff if you spend a day surfing, but you never go into detail the way you do when you read a paper book or article. And pretty much the same way TV works, there's a rubber-banding effect where your brain wants more, but which steals humongous amounts of time from mindfulness, exercise, working with your hands and so forth. Less being more, this too is a good hack of mine which I'm proud to run at home.

No gamedev lately, but at least I've reset my intentions. Next game (after some refactoring) isn't going to be an MMO. Possibly the next one thereafter. But the next one might just be a 3D version of Cross Fingers.


Cross Fingers is an exceptionally simple 2D puzzle game, in the most original sense. If I make a 3D clone if it and call it something like "IQ", it could actually sell! And it's so tiny, it would be a shame to not do it. I think I will, but not today. Today I'm simply going to enjoy my hacks.

Radio and muzak

Got a wounderful little headless radio going at home now, and felt like I just had to get a pair of Cambridge Audio Minx Min 11's:


They're tiny, but with tremendous sound.

Want to take the software for a headless spin? Download the binaries and mplayer.exe and unpack to same folder. Then it's just to run AidBand.exe. Press [F4] to start playing your favorites playlist, for instance.

Currently only Swedish public service radio is supported, but it's a piece of cake to add more. You simply add a (publicly available) streaming mpeg URL to a text file. Done. The source code is available on github. Some 700 lines, packed with stuff like a remote telnet-style control, various playlists, using Spotify artist search for filling your playlists, using Microsoft Speech to let you know what's going on, building .exe a file, etc. Go crazy!

Drone King Radio

I had so high hopes for that man. Same as everyone else I guess. But Guantanamo, Drones, and criminal accusations cast on Assange, Manning and Snowden has taken its toll on the world. Nothing like reality to get sobered up.


Take this business with the drones for instance. I'm not saying killing with a medieval swords is better. Or perhaps I am. Even though IS kills and wounds a high percentage civilians in heinous ways, what percentage would you say that is? Is it higher than these six indiscriminate 70% civilian butcherings? I don't know. But that is what to be expected when performance of drone pilots is measured in kills.

IS are modern vikings and templars in one: religious fanatics with a blood lust. Vikings were a small minority of criminals from the north who would plunder, murder and become soldiers of fortune (often at competing sides in various battles). Templars would not surrender unless all flags on their side of the battlefield had fallen and instilled great fear in their opponents, not the least due to their religious convictions and disciplined education in violence. But what could spark such a group to come into being?

Many factors, of course. Long-time oppression in Iraq, discrimination, ties with al-Qaeda. And the opportunity when a tyrant falls and a new spring emerges. But perhaps also investment in war of others, invasions in a region where wahhabism was strong, and killing of civilians.

This problem can't be bombed away; I believe the only long-term solution is to build democratic societies with transparency. It's not easy nor completed in a generation, but hey - there is no other option! Right now I guess bombs are the only way to slow the terror down, but US foreign policy must soon change. Maybe it's too late, but the Middle East might be on a time machine headed 500 years back in time. As far as US is concerned, everything after World War II seems to blow up in their faces, from the Korean War to Afghanistan and Iraq I & II. US foreign policy must change - if not voluntarily soon, involuntarily later.

"Make games not terror", how about that? I've been a bit low lately, as you can understand if you've read my previous post. Therefore I've taken a refactoring pause (it's hard and boring to slice and dice a game engine) and started building an old fashioned radio with a higher level of interaction. I'll github the code when I'm done if it's any good. One day of work got me a jukebox with playlists and Swedish radio. Python is still amazing.

Thrice a sinner


He was young and scared shitless. He lied to his mother and told her that he was going for a coffee, but convinced his dad to leave the hospital. He didn’t want to stay a minute longer. He later learned that she’d asked the hospital staff to wait just a little bit longer, as her son and husband would soon return – they where just out for a quick coffee. But the operation had to move forward on schedule, and her family never came back. The operation ended badly and after a few days in intensive care she died.

Four years later his dad could neither cope with with the uselessness of retirement nor the sorrow of his loss. Dying from depression the father didn’t even leave a note. The sick dad strung a rope over a beam in the barn and left his body to be found by his only child.

The son grew up to be kind, gentle and most generous. He could always be counted on to lend a helping hand. But even the best of fairytales must come to an end. Six days ago the son put on his favorite shirt and pants. Now himself ill and overpowered by aged heartrending guilt, he scribbled a note and placed it by the basement door, which he knew his wife wasn’t going to enter for at least eight hours. Then he gathered a leathal doze of sleeping pills, crushed them in a glass, mixed with water and drank. Finally he closed the door on the guest room, lay down in bed, thought his last thoughts of his loved ones and received his final punishment.

Many hours later his wife came home and read the note. At first she looked at it in disbelief. But he had promised! Then the paralysis let go and she cried the name of her husband, while ferociously running through the house. She lunged towards the garage, but no body there. She went into the garden, but no body hanging from the trees. She found his body in the guest room.

I forgive you father, for you have sinned. And we forgive you, for you are still alive. Now let us help you live again. Please don't leave! We love you - now and forever.

Haskell IVL

My miniscule Haskell studies included a workshop which - although interesting - pointed out the all to familiar bottlenecks of sideshow programming languages: the tool chain. Although you can write a fairly advanced game in just a couple of k, it's the debugging that kills the language. Nobody wants to look into the call stack of a recursive language with pattern matching.

On the other hand, who doesn't want a complete OpenGL tree fractal in 32 lines of code? An example from the Gloss 2D library.



Main creates an "animating" window with a black background. Tree is created from a single stump in the lowest level (0), and by rotated, smaller, greener trees recursively down. It looks horrible, but would by horrible to do with that level of control in most languages. IVL it's great, IRL not so much. In this year-old video Carmack himself talk about Haskell:


I looked through the whole thing, and he too advocates strong typing, static typing and tooling. And immutability. Never spent much thought about immutability. Hm. He's right. I should aim for that in my refactoring. Thanks Carmack!

Project planning

  1. Refactor some code to simplify the simple;
  2. Generate roads, estates and vehicles;
  3. Implement game fun: steering, driving, camera, shooting, killing, dying, looting, resource extraction, dumb bots, etc.*;
  4. Simple chat is a must;
  5. Vehicle editor;
  6. Estate editor;
  7. Economy**;
  8. Network infrastructure, security and distribution***;
  9. Managing of user accounts and built stuff;
  10. Keeping and distribution of world data from a master server;
  11. Menus, UX, music;
  12. Port to iOS;
  13. In-app purchase. Limitations, such as time limit per day unless paying;
  14. Testing, refining, polishing, optimizing;
  15. Wait 2 weeks;
  16. Build, deploy, release;
  17. As a gimmick, I'll give away my other games for free. So update, build, release those as well. Peuh!
  18. Go travelling.

* This is where you start to realize that the actual game is only one step of 16, or about 6%. This is also where you make touch controls fun.

** Loot and resources will have to be balanced in an MMO, both to evade inflation and to prevent overly large vehicles. On vehicles and houses/stuff in the yard I'm thinking polynomial cost on dimensions and parts. The dimensions needs to be restricted, or people will build huge, flying penises that will get stuck between skyscrapers, or 10 km tall buildings. The parts would cause bandwidth problems and lag whenever someone decides to put 1M bubbles on the back of their hovercraft.

*** This is the hardest part from a technical standpoint. The other standpoints I don't want to think about (they resemble BDSM to me).

Let's just imagine the vehicle editor. I want to let the player combine any capsule, cuboid or cylinder at any size, angle or distance. Motors, canons, lights, materials. Sky's the limit. Ok, let's not get carried away just yet. But the Lego feel definitely will be there.

Well, I'll start out by treating the above bullets as milestones, and I'll take some time in between each to let it sink in. Nothing has to be perfect, but all parts need to be fun and easy for the user. Even if I epic fail on the Elon Musk part of things, I'm going to feel really proud of myself if I manage to pull this off. But OMG! THAT'S A SHITLOAD OF WORK!!!

And when this game is done, it's not done. There are infinite possibilities: trading, bridges, water, clans, skill system, more weapons, monsters, forests, seasons, day/night cycles... But I still believe that if I make a game that I and a bunch of others will enjoy, it will be pretty fun to build on some more.

About the author

Min bilder
Gothenburg, Sweden