Trial and Epic Fail

Ventures of an indie game developer

ASCII?!?

Yesterday evening I thought a bit about how I should design the editor for the upcoming 3D puzzle game (let's call it Impuzzable for now). At first I thought the editor would be able to create only cubes, like a mini-Minecraft editor. But that I think might be too limited. In fact, the best thing about Cross Fingers is the triangles. They allow you to intuitively feel where pieces go, the triangle shapes are an essential part of what makes the game... not so boring. :)

On the other hand, ODE doesn't do prisms (oh, I'm taking it 3D btw, but you probably already realized that). ODE does meshes, but only badly. So I'll try to build physical prism shapes this way:


Thin green lines = 3D physics mesh, thick red lines = cuboids. Four physics shapes per triangle - some CPU-intensive shit! Nonetheless.

That settled, I started thinking about the editor again. This would be my first editor since I was a kid. I used Maya for my past games. Maya is not perfect, but on the other hand home-brews seldom are either. I saw a couple of different options:
  1. 2D editor written in Python, like a simple version of mspaint... like a version of mspaint, but only placing triangles. Editing each layer individually. The editor would export my native format, so nothing much would be required by the game engine itself.
  2. Make a generic viewer/editor written in C++, but which through stdin/stdout or sockets interface with a python script. I'd leave the logic in the python code, then I'd hopefully be able to reuse much of the viewer/editor for further games down the line. This editor would also export game engine native format.
  3. Make the editor in C++ and sort of part of the game itself. This way each level can be played while developing it.
I wasn't content with either solution, but both number two and three included longer iterations as I had to wait for the C++ linker a few hundred times. The first one seemed least bad so far, but even using tcl/tk would mean many days before the editor was ready to roll.

So in the car home from work today I thought to myself: can't I make it simpler than that? What is simpler than mspaint? ASCII art of course! In retrospect it's the perfect choice. The editor will be written in Python, but I'll keep the ASCII-import in C++, effectively making it a level loader. The idea is still a bit unclear, but I think I'll make four different applications:
  • One for generating shapes. Think of it as the outline of the puzzle object.
  • One for splitting the total shape into pieces, like jigsaw puzzle pieces.
  • One for generating a level, loading the pieces, moving them about, then saving the final level.
  • One for timing each level separately. The time will be used for setting level difficulty. And making sure that each level can be completed without bzguz.z
What a relief! I'm not too keen on this game in general, as it's a puzzle game. But most of the code will be a breeze to write, and pretty fun too. But best of all is I'll still have a little energy left when the game is ready for polish.

Open letter to the open sceptic

Ralph Waldo Emerson is often quoted to have said "a foolish consistency is the hobgoblin of little minds." I have been a small-minded fool for a long time, but I'm slowly improving. (If you want to cut that path a bit shorter for yourself, you'd better read this long post. :)

After reading Emerson's wikipedia page I surfed on to this and that and eventually ended up on the Swedish scientist Swedenborg's. What a stand-up guy! He independently of da Vinci came up with a sort of aeroplane. He published a scientific paper, he was a Swedish Board of Mines fellow, he helped construct a number of engineering masterpieces, he was a member in the Royal Society of Sciences in Uppsala and also in the Russian Academy of Sciences in Saint Petersburg, and fellow of Royal Swedish Academy of Sciences. He was offered a professorship in mathematics, but himself thought he wasn't competent.

He was internationally renowned, and didn't stop at innovations, physics and mechanics. He studied anatomy and all the great philosophers of the time. As with most people in the 1700s he studied Christianity. In his mid-fifties he realized a number of controversial things about the mind and the spirit and went on to be a mystic, totally forsaking traditional sciences. Now I know what he must have felt like. The mechanistic world-view totally looses it's radiance when you find something underneath. Something underlying which require totally different theories to encompass the new discoveries.

As I've mentioned earlier I've pretty recently come to realize that there is an afterlife. The evidence behind my conclusion goes something like this:
  1. Your mind is not executing in your brain;
  2. your brain is your soul's API to the body;
  3. your soul does not need your hardware/body to execute.
Before anything else I should say that, although still taboo, parapsychology today holds very high standards with extreme rigor in both statistics and experiments. I'll think you'll agree that it's not hard to imagine what decades of scrutiny from hardcore sceptics does to scientists any discipline. The articles I refer to here on are all peer-reviewed.

The first statement is in fact very easy to prove. This article shows that brains can be made to interact without direct communication. The setup is basically like this: two people meditate together for 20 minutes, to allow their minds to entangle. Then they are separated by sound-proof walls and Faradays chambers and EEG equipment measure their brain activities. One is exposed to 100 light flashes at random intervals, then EEG correlation between the two is computed. No data has been discarded except for segments where either subject moved, causing EEG saturation. Two types of control tests were performed: one without stimulation, one without any person in the room to safeguard against equipment failure. The probability of this happening by chance is 111:1.

This experiment checks if it's possible to detect if you're being stared at. Through surveillance equipment! The two subjects are separated by six or so rooms (map included in article), one either staring at the other through a monitor, or not staring. The result is weighted depending on if the subjects believe it's going to work or not. The article is joint-written by a sceptic and a proponent. Interestingly a conclusion is that your inclination or mindset affects your results (my stuff in color):


Swedenborg himself had a couple of well-documented remote viewings (i.e. experiencing things at a distance in time or space). This archaeological experiment in Egypt show the level of detail that can be produced with two good remote viewers at hand. The target site was Marea, an ancient city unknown to all but a few archaeological pros. The researcher performing the experiment was blind to the facts to avoid cold reading or such. Neither viewer had been to Marea, and were not beforehand informed that the project was taking place in Marea.

The lead archaeologist was a sceptic, thinking that it would be preposterous that remote viewing would succeed where sophisticated electrics had failed. He believed that if there was anything at the site, it would be the Roman acropolis. The two readers were instructed to:
  • locate the ancient city of Marea. They were told it could be found within a square 24x24 km;
  • locate a building within the city that has either tile, fresco or mosaic in it;
  • In the building, locate the walls, the windows, the doors, and the depth at which the floor is found;
  • describe artifacts or conditions within.
The first remove viewer, McMullen, had a go.
  • Locating the city.
    • McMullen placed the city on the map, and when transported to the site he provided a reconstruction of the city. What's the odds of that? They drove him by car to the site.
  • He walked without hesitation up on a hill without any visible remains of a building. In the sand on the hill he sketched the outline and corners of a building beneath the sand containing several rooms. He set stakes in each corner and one for the door opening, and also stated that the building was part of a larger complex.
    • After excavation the corners set were found to be located within inches, door opening was exactly where he said it would be. The building was part of a larger complex.
  • He located walls and indicated that the culture which had built it was Byzantine.
    • It was late Byzantine.
  • He said the depth below ground to the top of the walls was three feet.
    • They were four feet deep.
  • Indicated there were debris dropped there after being taken from a different structure.
    • Masses of pot debris uncovered.
  • Said the west wall would have tiles on it. He said the floor would be 6-10 feet deep (although he said "I can't see the floor"). Later he stated that the floor would be marble, smooth on one side, rough on the other. The tiles were set in a chalky sub-flooring. The tiles were square 5/8 of an inch across and one color each. The tiles had be laid in a colored pattern once.
    • No floor tiling found at first, but a hard chalk sub-floor was found. The lead archaeologist's assessment was that the covering floor had been stripped away. Later 11 round quarter-sized marble tiles were found, each in either red, black or white. Each smooth on one side, rough on the other. No wall tiling found, but it's not hard to imagine that it was stripped along with the floor tiling.
  • He said that green would have been the most prevalent color, although he reported others.
    • Substantial amount of green tile glaze found. Green color definitely standing out the most in a desert environment.
  • At 8-10 feet there would be a ledge running around the walls.
    • In most rooms ledges were found at 9 feet.
  • Something would be found associated with baths or bathing. Also, after excavation had started (but not finished) he stated one part of the structure had to do with head and fire. And he also said that the building was generally Roman, but the earlier observation was equally accurate to him.
    • Pieces of marble and a hydraulic mortar were probably debris from earlier Roman baths, which were currently excavated "down the hill."
The second remote viewer, Hammid, had gotten nausea from waiting in the baking desert sun for McMullen to finish, so she was taken directly to the site.
  • Hammid walked to the same hill, said the building was buried under the sand there and outlined the northwest corner.
    • Highly accurate northwest corner, exactly coinciding with that stated by McMullen.
  • She described walls, multiple colors but especially green. Tiles on the wall, possibly green. Said the building had multiple rooms. A sense of bathroom, something to do with baths and washing. A colored design laid polished stone floor, possibly in marble.
    • Accurate and/or coinciding with McMullen's viewing.
  • She saw an alcove containing a broken column or statue, and something round and free-standing but not complete.
    • An alcove containing a free-standing, broken column with a round top was found. The column was definitely not part of the original site and it was the most confusing to the archaeologists, and the least probable to have been anticipated.
I urge any sceptic non-archaeologist to put a dot on a map, go there, tread up to the best dune you can find and start digging. Don't forget to guess the color, depth and shape of what you'll find beforehand. E-mail me when you've found anything ancient. I shan't be holding by breath.

What's the overall risk of lab-controlled experiments being bogus science? According to this meta-study in ESP the risk that the outcome of 108 studies in Ganzfelt is by chance is 18861051:1. The risk that the result in 37 studies in Anticipatory responses is chance is 2.9x1013:1.

So if science can prove that the mind is reaching outside the brain, and it is neither sound nor an electromagnetic field, then what? Whatever it is, it's not confined to your scull.

My next claim is that the mind uses the brain as the API to the body, what's the basis for that claim? Terminal lucidity is. That article is plain psychiatry and neurobehavioral sciences btw, no new age mumbo-jumbo there. The term is coined from the unexpected return of mental clarity shortly before death in patients having severe psychiatric and neurologic problems. The stunning examples range from brain cancer to schizophrenia; some have been in catatonic state for years, then suddenly become normal shortly before they die. One former nun went raving mad, and was admitted to an asylum. Three weeks before she died she was completely normal. Which might be said to be strange as her brain was so swollen that the cranium could not be closed after autopsy; "[t]he blood vessels were engorged with blood, and the brain tissue itself was unusually soft."

They seem to have personality outside of their brains, don't they?

Near-death experiences (which of course is also well documented by materialistic science) show that a lot of people around the world have similar experiences. They almost die, come back, get better and tell about what they've seen; mostly it's cosy and nice. The new part for me here is "Peak in Darien", i.e. people who almost die, meet someone on the other side whom they don't think is dead, return and tell about it, then find out that the person had just died. Random dreams by coincidence? Well, when the EEG flatlines you're not supposed to dream, are you? To me this seems like the mind jacks back into the brain.

Finally, my third bullet. I've already touched upon it in the last paragraph, but here's the bulk of new age: the spiritual mediums. How about this article?  In one of the experiments a photo is sent to a medium, and no further information is transmitted. The medium does a reading, the reading is recorded and transcribed. To each "sitter" 6 transcriptions are sent, where 1/5 is their own, and they rank them. The experiment resulted in a z-score of -3.89, which means the risk that this happens by chance is 1 in 10k.

If you have four more hours to spend, sneak a peak at these videos:
Today I met a friend who had obvious spiritual abilities, but refused to believe it. ("I know it's impossible to explain that the deep freezer moved several meters in our basement by itself!!!") I for one need a bunch of evidence to believe, but I'm not ignorant. Swedenborg was way smarter and came to this conclusion by himself. Only little minds consistently agitate for materialistic science though evidence is staring you in the face.

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.

About the author

Min bilder
Gothenburg, Sweden