Trial and Epic Fail

Ventures of an indie game developer

Impuzzable scrapped

I just decided to scrap the puzzle game too. Not only because it took a lot more man-hours than I had expected (not to mention calendar days), but even if I'd get the 3D "understanding" right (which I highly doubt), I now no longer think I'd have any energy left for polish.

But I'm not too upset with that, it's a feeling I've had since day three or so. That makes it my fourth game on indefinite hold so far. Three of the four had lousy controls in common, the fourth was supposed to be a co-op developed with another guy, but he never showed any interest.

The next game I'll tackle is going to be the prototype 3D game editor. The absolutely best part about it is dogfooding: I can fiddle with my own stuff until I'm satisfied. If run with it and let it evolve, I'm sure others will like it too. This will be my first great game, and it's not even a game. But it sure aligns with my obnoxious way of developing a homebrew game engine instead of games.

If it wasn't for the App Store Review Guideline 2.7 "Apps that download code in any way or form will be rejected," I could easily add end-user surveys (i.e. rating and possibly optional feedback) where you'd instantly know if the game idea is any good. Sort of like an instant App Store-within-the-App Store but with no money, no big dragons and no polish. I think that part would have been instantly gratifying, like codepen but for 3D games. Oh well, the tool will have to speak for itself.

This is what I'm thinking:
  • iterative builds on computer, when you're done you instantly shoot it over to the iPhone/iPad (this will have to be protected somehow or Review Guideline 2.7 will bite me again);
  • I'll add a simple Python text editor and interpreter in the iOS version as well, so you can fiddle on the bus (a feature I'd use myself I if I ever went by bus);
  • code can also be downloaded from the device to the computer while the app is in the foreground;
  • 50 lines of code should be enough for the basic versions of games such as Breakout, Tron or Space Invaders;
  • The initial installation will include ~10 examples of various kinds.

The hard part is the API. What I'll try to do is to make some very different games in it, and if I manage to make all of those both small and minimalistic, the API should be good. Less will always be more in this case, it is for game mechanic prototyping only.

Editor FTW!

I had a couple of bugs in my mesh-generating (or rather the mesh-optimizing) code, and wasn't able to resolve it with simple printouts (vertex-merging and corner-keeping wasn't thought-through properly). Actually overviewing even a trivial 3D shape made up 20 triangles takes forever, and usually involves reproducing the whole thing on paper. Then multiply by each step in the mesh optimization process. So I decided to build a general-purpose viewer, that could view each step of the optimization. Another thought I had was that the viewer possibly could be extended into a simple editor in the future.

The viewer, called "tv3d", is controlled via a TCP port, and I built a higher-level interface for it in Python. I had built some unit tests for the mesh-generating code, and for these tests I just strapped on the viewer as a debugger. I'm really satisfied with the way the python code is totally unobtrusive: I neither had to change the mesh-generating code nor the test code, I merely had to extend it with 12 lines of code:

The result after I fixed my optimization code:

(The flickering comes from me removing the whole object, and "reloading" it though the resource system. That's what releaseobjects() and createmeshobject() in the test code above does.) With some small extensions I believe this could actually be a fantastic application if I evolve it into a simple editor. You see I'm betting a gazillion developers have similar problems, and also want to prototype functionality and game mechanics before taking their game to a more advanced development stage. There probably is a plethora of possible ways to do this, but I think this might fly if I make something super-simple in the 3D niche which is portable across PC, Mac and iOS. My engine already comes with a super-simple command-line interface in which you can manually (or through the TCP port) change solid/wireframe/coloring/shading/shadows/particles when rendering, sound parameters, physics simulation parameters, and debug stuff. With some simple input handling and ray-picking support this becomes a neat programmable editor. If I add a python "IDE" on iOS, this becomes a fantastic portable 3D prototyping tool.

Dogfooding is the name of the game, but I can't allow myself to drift off to do this now. When my current game is done though...

As usual game dev progress has been slow. I've doubted the controls further, and even started thinking of a similar gaming idea which I could dive into instead. Spending my energy unwisely, you might say. But the pendulum has swung back, and I hope I'll be able to follow through soon.

Lizard brainz

I haven't done pretty much anything on the game lately. That's probably for two reasons: out of fear and lack of motivation.

The fear part comes from my lizard brain telling me that I'm not going to be able to make the controls engaging, and that thus I'll be wasting my time. So even if I create a puzzle game with a unique game mechanic, it's going to fail due to poor controls. Again. This fear is not unfounded, as this isn't a very improbable outcome.

I also believe part of the part of fear comes from the initial reaction from the maker of Cross Fingers as I e-mailed him for advice on how they made all the levels:
Do you want to steal our game design, or did I miss something??
I explained the situation further and he chilled, but I've been demoralized before by "intellectual property" look-and-feel. It just doesn't feel good if someone thinks you're stealing. It's ok if you say it yourself, and as long as you yourself think you're extending previous work. Sort of like science or evolution. But if someone else says it, it just doesn't feel right. Not for me anyway.

The lack of motivation comes from making a game which is not my best idea.

On the other hand I can get over my fear. And the idea is small enough that I could make it into my best game so far, by far. I think. I need to gain some momentum, the game is not going to write itself. Unfortunately. (This time it would have been nice. Getting old?)

Piece generator

The probably most complicated script is almost done, and as usual it was harder than I had anticipated. I hadn't thought about that very irregular pieces are really hard to visualize in 3D (especially so from a single angle). And I hadn't considered that concave pieces can get stuck. There is still a bug remaining, causing triangles to be lost in translation. But it won't be hard to track down. Here are three generated pieces from a single shape. Good luck in figuring out what the heck I'm up to.




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?

About the author

Min bilder
Gothenburg, Sweden