Game Development

QA by Child

I recently published a home project I was working on, an app to teach children to read Hebrew. I wrote it originally to help my son learn to read Hebrew.

A screenshot of “Learn to Read Hebrew Easily”

In an early version my son was very excited to play it. He quickly understood the principle – see a word, then tap one of four emojis this word describes. Every time you tap a right answer, you get a few more points, which in that early version were displayed prominently at the top of the screen.

It took him less than five minutes to find a “cheat” – if you tap the right answer very quickly many times – you get points for every time you tap it, as long as the “correct answer” animation is running and the word is not changed.

It reminds that a few years back I was working on Desti and when I gave that same kid an early version of our iPad app – he broke it in less than 30 seconds just by moving his hand on the screen and touching everything at once.

Generally, if you have a GUI, one of the ways to find issues is to let a kid hack at it. One reason is that GUIs have the curious property that changes take non-zero time, and usually buttons are not disabled once they are initially tapped. As a result – you sometimes get the effect multiple times – which can result in extra score, multiple transitions, repeated actions on now incorrect state, and so on. In the extreme case this can lead to resource exhaustion very quickly and your app crashing. I’ve seen that happen to my app!

What else do you get by giving your app to a child? You can see very quickly if your UI and UX are clear and easy to understand. If you need to explain what needs to be done – it’s not good enough. That’s true in general – and doubly so for a kid. If your kid gets it on their own – you did something right.

More deeply than UX- you can learn if your gamification works. Is your app/game engaging enough? Does it invite gameplay? Does the meta-game encourage repeated plays? It took me a lot of thought to get my reading app to work well – and it’s far from done.

Did you test your app with your kid? What was your experience with that?

Game Development Math Programming Projects Python

PyKoan – The Logic Game

As you can probably tell, I’m back from my undeclared hiatus. I’ve got lots of stuff to talk about, and I’ll be starting with PyKoan, one small project I’ve been working on lately in my spare time.

A few weeks ago I stumbled upon an article in wikipedia, regarding a logic game. This game fascinated me, especially because of the “Godel Escher Bach” connection. Quoting from Wikipedia:

Zendo is a game of inductive logic designed by Kory Heath in which one player (the “Master”) creates a rule for structures (“koans”) to follow, and the other players (the “Students”) try to discover it by building and studying various koans which follow or break the rule. The first student to correctly state the rule wins.

As it happens I’m also taking a mathematical logic course this semester. Having read about the game, I wanted to write a similar computer game. Hence – PyKoan.

PyKoan is a game where the goal is to discover some logical rule, for example, “For each x holds x%2 == 0”. This rule is applied to a koan – a list of integers. An example koan that “has Buddha nature” (follows the rule) is [0,2,8]. One which doesn’t is [1].

To implement this idea, I wrote an implementation of an expression tree very similar to the one used in vial, but with a different implemented language. I also did some experimentation with the design. Since I’ve been talking a lot about expression trees without giving a full explanation, in a future post I’ll write about the implementation used in PyKoan.

So far I didn’t code a lot of the game, just the expression tree framework, and a simple rule builder. When using Python’s interactive prompt, one can get a taste of how the game might feel:

In [19]: r = rulegen.create_rule(rulegen.easy_grammer, rulegen.easy_grammer_start)
In [20]: r.eval([])
Out[20]: False
In [21]: r.eval([0])
Out[21]: False
In [22]: r.eval([1])
Out[22]: False
In [23]: r.eval([2])
Out[23]: True
In [24]: r.eval([2,2])
Out[24]: True
In [25]: r.eval([2,2,3])
Out[25]: True
In [26]: r.eval([3])
Out[26]: False
In [27]: r.eval([4])
Out[27]: False
In [28]: print r
x exists such that x == 2

Here is how I would generate such an expression manually:

In [3]: from exptree import exps
In [4]: exps.Exists('x',exps.Eq('x',2))
Out[4]: exps.Exists(exps.Var(x), exps.Eq(exps.Var(x), exps.Imm(2)))
In [5]: print _
x exists such that x == 2

The game has many interesting possibilities for research, for example, computer players. Other possibilities include “just” guessing koans (not the rule itself), creating interesting and playable rules, and so on. There’s a lot to do.

This time, instead of just publishing the (unfinished) code, I decided to do something different. I’ve opened a space in assembla, with public read access. I’m opening this project for participation: if you want to join then leave a comment, or send me an email.

(Since Assembla seems to be going through some connectivity issues right now, here’s a link to a copy).

Game Development Personal Programming Python web-design

Misc. Projects: a preview for the new (academical) year

So now it’s been too long since I’ve written a post, and that’s mostly because I haven’t been programming lately, as I’ve been busy with buying a car\moving\studying. This is going to change now that I’m finally settling in.

There are however few directions I’m going to go about, and I’d like to mention them here. If you are interested in reading more about any of them, just drop me a line in the comments, and that direction will get a bit more attention.

The first direction (and the most serious one) is a website I’m building. I’ll still not talk about the website itself, at least until a beta version is done, but I will say I’m doing it with TurboGears. I’ve always looked for a good Python framework for writing websites, and for now, TurboGears seems to do the trick, although I’m just starting with it. I am going to write a little bit about my experience with TurboGears, and my opinions. Stay tuned.

Another subject that I thought of writing about is a small tank game I wrote with pygame. This game actually works, although I didn’t do the finish. I intended to make it multi player (over the ‘net) but then found out that it is really not that simple. So I intend to work it out sometime in the future, and write about it. For now, I will say a few words about the game. It started when a friend of mine said that he wanted some simple tank game for one-on-one games, with some certain behaviors (such as bullets ricocheting off walls). I heard him talking about it, and told him, “hey, that’s really simple, I can do that”, so I went home, and during five days, one hour a day, I worked it out. That was an interesting experience in itself. Maybe I’ll write a little about that as well.

Other small projects I’ve been working on include doing some more IMDB mining (which I started to talk about), and maybe expanding that to as well. One thing I find missing in Amarok, is choosing music according to musical relations between singers and bands. Maybe I’ll even write a plugin :)

Some other ideas I had include 3d l-strings. I actually implemented those, but to my disappointment, they didn’t turn out as aesthetically pleasing as I’d hoped. Still, it was a curious result (with PyOpenGL doing the drawing). I wanted to implement more simple fractals. I’ll probably write more of those when I break from writing more serious projects. Other small ideas I had include more ascii-art, for example, ascii-art drawing of some vector image format seems very interesting, or maybe a 3d engine (maybe with cell-shading) which renders the result in ascii-art, and then writing an FPS with it… The options are endless!

All of this of course if I have the time when I’m not working on one of the other current projects, which include distorm, and my studies. Among the courses I’m taking there is a seminar on graph algorithms, a course in compilation and a course in cryptography.

This is going to be a very interesting year indeed!