Trial and Epic Fail

Ventures of an indie game developer

Anomalies trips you up

C++ is still the language of choice when building fast things. (Linus being the duly noted exception of course.) Also note that building fast things is not the same as building fast. Rust is never going to catch on for a bunch of reasons: volatility, syntax, performance. Go is better Java for back-end. Etc. But the things you still have to build in C++ make your brain hurt. For instance, I felt the need to write an optimized function for turning doubles into strings! 2016! The good ol' sprintf was an order of magnitude slower and gcvt isn't standardized enough (mostly thanks to Microsoft's _gcvt_s shit). And boost is bloat and I don't use.

The drawback of writing these things in C++ is that it number of lines of code you need to churn out is very high (43 in my case), not to mention the overhead. The .h file takes up another line, and you keep the code in an .inl to create fast code. The problem with that is that when you change a central .inl you need to compile every damn .cpp file in your project. And then of course you make a bug which you aren't able to detect with your home-brew unit tests (home-brew to avoid depending on third parties which sucks in C++, and unable to detect since you don't foresee the hard bugs).

My bug was that 27.05020 would become "27.052". I.e. all decimal zeros not next to the dot disappeared. Rust's syntax doesn't prevent you from these silly bugs, but to Rust's credit I have to say that you never would write this type of code. That is also true for all sensible languages. Fucken C++...

I just experienced another even more trippy anomaly. I noticed a bulge on the bottom of my lower-left arm. Very small, say 1 centimeter long, 0.4 centimeters wide and the shape of a parenthesis pushing the skin out. Hard and very... worm-like. At first I thought it was a piece of my subcutaneous fat that had hardened for some reason. I have no parasites that I know of, and never had (there are practically none in this country). Very strange. After a couple of seconds it loosened up and disappeared. Either this is me starting to lose my grip or I've somehow contracted something in need of a host. I've never been scared of going insane, but would still prefer to keep this type of thing a singular oddity rather than a reoccurring anomaly.

With a least one anomaly gone, Trabant is slightly better than before. We're soon ready for a v1.1.

Candy Crush in Trabant 1.1

9x9 grid Candy Crush prototype (without animations and combos) is 65 lines of code. I deliberately left the pieces unpolished, as they should be in a prototype.


Six different types of pieces and as in the original three or more pieces in a row are deleted and new fall down from the top. You tap-drag to switch places with a neighbor, and the drag is indicated by a slight move of the piece your holding on to in one of the 2-4 possible directions. Works with mouse, and is instantly portable to iOS without any extra code.

Slap a few levels and some design in there, then it's just to get someone to write you that $6,000,000,000 check.

Slime Volleyball in Trabant

Did a Slime Volleyball prototype in Trabant. In 69 lines of Python it includes keyboard steering, a decent AI and an original, humiliating message when defeated.


My original port of the Slime Volleyball Java Applet was 2659 lines of C++. Excluding the 102 lines for iOS portability. I should be able to add touch controls to the iOS prototype in 2-3 lines. I didn't include the different AI levels and the score counting that the game contained, but I estimate Trabant still being about 30x less chatty than plain ol' C++ game programming.

Soon I'll release Trabant v1.1. It will include some performance improvements, a couple of nice-to-have actuators, the odd bug-fix and a half-dozen new prototyping examples. Some of the other new prototypes are Agar.io, Crossy Road, Doom, a fern fractal, Gradius and perhaps I'll build GTA2, Angry Birds and Candy Crush too. Trabant is really something!

Trabant vs. three.js

A new JS framework called Carbide showed up on Hacker News a couple of days ago. It seems like a cewl toy. On the landing page they keep a three.js sample. I never looked three.js before, but it's mightily impressive. Just take the examples. But anyway, three.js can do all sorts of rendering, my Trabant prototyping can do a little bit of it. I just had to compare the minimum 3D cube example from Carbide with one of mine.

The functionality is the same, but the number of lines of code is 8x less in the my version.
Trabant can't do what three.js can, but the opposite is also true. Rapid! Prototyping!

The Energy Age comes flying

The different types of revolutionary energy sources pile high. The Chinese government's thorium molten salt reactors. Andrea Rossi's E-cat. Some Iranian guy's "Magrav." The last one looks like bogus, but a gazillion hobbyists are showing up on Youtube where they've constructed of some type of "magnetic" or "gravitational" (or both or neither) rector from copper wire and caustic soda. It goes something like this:


It seems too elaborate for a hoax, and too widespread. In minutes I'm able to find acclaimed hobbyist replications in US (above), Spain, Germany, China, Australia and Canada. An expensive scam? Or just people fooling themselves? On the plus side there's certainly even more people building in more countries, on the minus side many of them - including the inventor Mr. Keshe from Iran - seems clearly deranged. Keshe has for instance predicted a number of climate disasters which should have happened years ago. But madness might not always be a drawback. The mad genius Nikola Tesla was for instance extremely prolific. A tiny treat of his unique insanity is one of the most remarkable phobias I've ever heard of: the fear of pearl earrings.

My guess on the Magrav reactor is that it's nonsense, but regardless one invention or another is soon going to take us into the energy age. The idea of free energy removes the gravitational restraint on us humans. Why should I pilot a car to work when a drone is so much faster and funnier? The 60's future - where people work for leisure and fly instead of roll - will be upon us in a couple of decades.

Enlightened games

I always come up with interesting side-projects which distract me from what I ought to finish. So instead of working on my Trabant-made game, my psi book or My Upcoming Awesome Game, I started looking into enlightenment yesterday night. The reason was that I found that an American neuroscientist, Dr. Jeffrey A. Martin, has found a solid and proven way to take anybody to "non-symbolic consciousness." I've always thought this would be something I'd eventually want to do, but spending years on for instance meditation seemed like a somewhat unsound choice. Now it seems like I don't have to. His method seems straight-forward and fast. A few of his research subjects were actually able to get to a very high level of enlightenment ("location 4") in just a few days.

Btw: enlightenment is not what you think. The eastern explanation of "you are not your body nor your mind" or that you become "empty of thought" is not accurate and sounds scary to a westerner. A more accurate description is that you loose your self-referencing thoughts. Your ego. When those thoughts of how you appear, behave and say disappear, a peaceful void fills your mind. This void is at your disposal to fill with whatever thoughts you will, when you wish. At least that's how I understand it. I'm aware that this choice will affect the rest of my life, and also that my games and books may never be finished, but I'm willing to take that risk. If I come out on the other side still wanting to make games, I'm sure they'll be more interesting.

Right now as I was jogging in the woods I had a fantastic experience - I had a taste of bliss and it was absolutely sacred, rapturous, fantastic! The reason might have been psycological (self-induced), parapsycic (presentiment of a feeling that I'm going to feel in the future) or spiritual (guides) depending on what side of the wall you're on. I'm on all three sides right now, off the fences! :)

Here's Dr. Martin's explanation of his model:

Crossy Road and Agar.io

I built Crossy Road and Agar.io in Trabant.


Crossy Road took 92 lines of code. Those lines got me grass, trees, pavement, cars from left and right, controls and death when hit by a car. Agar.io took 63 lines of code and includes regenerating "dots" for eating, 20 dumb bots, controls, growing when eating and respawn when eaten.

(Btw: the new builtin game video recording feature of Windows 10 on Windows+G works great!)

About the author

Mitt foto
Gothenburg, Sweden