For the last couple of months my blog has been abandoned. This happens when someone becomes so excited about his idea, that he forgets about everything, and devotes all the spare time he has to developing this idea. Which exactly what has happened to me.
I love puzzles. This is the only type of games I play on my mobile phone. Last year I came across a very good puzzle game, which took away a couple of weeks of my life: REBUS — Absurd Logic Game. And recently I thought, what if I inverse the idea, and instead of finding out the word encoded in a picture, try encode that word using the set of given pictures.
Developing a quick prototype took about a week, and when I showed it to my wife, she found it playable. So I decided to move on and develop a complete game.
There is a picture, representing some word. You have to guess this word, and then construct it, using other pictures given below. Of course, most of times you need only certain parts of these words, so you have to remove some letters from the front or the back of these words. Like this:
For each correctly composed word you get some coins. Initially, the number of coins equals to the number of letter the target word has. Each time you remove a letter, while composing the target word, the number of coins is decreased by 1. The aim is to find out the word while removing as fewer letters as possible.
The puzzles are composed in such way that there is always one best solution (which gives you at least one coin after solving it), and there are other not-so-bad solutions (which give less or even no coins).
Coins can be used to get various types of hints, like revealing the target word, or the word options, or they can be used to unlock new puzzles. Initially, only 10 out of 250+ puzzles are available, and each time you solve one, a new one is unlocked.
The player can purchase additional coins using in-app purchases, and Google provides a very easy way of integrating such a feature into your app.
Android. Just because I’ve already had some experience developing Android apps and recently completed a few Android Development courses, I decided to make it the primary platform. The iOS version will follow, if the Android gets even slightly successful, meaning that it gets at least 1000 downloads by the end of 2017.
Probably, this was the most time-consuming part. Constructing puzzles manually would take weeks and would have been error-prone. So I decided to automate this task.
I downloaded a file containing 1000 most popular English nouns. This dictionary was fed into a Python script, which I developed.
On the first iteration the script creates all possible splits of each word; each split containing word parts with at least 2 letters, like this: “massage” = [[“ma”, “ss”, “age”], [“mas”, “sa”, “ge”], [“mass”, “age”], [“massa”, “ge”], [“mas”, “sage”], [“massa”, “ge”]].
One the second iteration the script looks at each word, and for each split it finds the full words, from which each word part of the given word can be obtained by removing letters either from the front or the back. For each word part there can be many full words, from which it can be obtained, so the script keeps track of how many letters have to be removed from the full word to get the required part — the cost of that word.
Then it sums up the costs for each combination of full words that construct the target word, and drops those, whose costs are equal or higher than the number of letters in the target word. The combination of words, which has the lowest cost becomes the best possible solution. Limiting the cost of the best solution to the target [word length — 1] ensures that the player receives at least one coin for successfully solving the puzzle using the best solution.
After running the script on the entire dictionary, something like 400 questions have been generated. These questions then have been manually checked. Many puzzles had similar word options, because, for example, if there are many target words containing the part “id”, and the shortest word option in your dictionary, which contains this part is “idea”, of course the script will suggest this word for almost all of such puzzles. So these had to be manually substituted to a different word options. Often, this led to increasing the cost of the best solution, but gave a greater variety of word options.
The resulting set of puzzles has been saved into an XML file, and imported into the Android project. The app would then parse this file, and use it to display the puzzles.
Tricky part. Android runs on a vast range of devices, each with different screen size and resolution. There are literally thousands of possible combinations of these, and it is impractical to try to create images that suit the majority of them. So the solution was to use vector icons in SVG format. Android Studio can import this format, so that there is only one resource for all screen sizes and densities. Also, this greatly reduces the size of the app, because often, vector images take less space than raster ones.
I still had to create different variations of the main puzzle screen, where the lower part of the screen that contains the buttons has been rearranged for better utilization of the available space on larger screens. However, this was just one such place in the app, and all the rest of layouts are completely identical for small, medium and large screens.
Surprisingly, this was the easiest part. There is a singleton, which keeps track of the score, provides the puzzle data, decides, whether the player has solved it or not, and saves the progress to a small internal database. The rest is quite straightforward, so I won’t describe it in too much details.
The game is now available on Google Play, and it is free. Now I’m trying to figure out how to cheaply promote it so that I get the desired 1000 downloads by the end of this year. Social media has been utilized, but this did not result in too many installs. I’ve sent review requests to a few dozens of Android gaming websites, and still waiting for responses. I even tried to run an AdWords campaign, which brought me about 50 installs for the $15 spent. Still, 1000 installs is quite far away. Probably, a larger promotion budget would have given me the required numbers, but unfortunately I don’t have a spare penny at the moment to spend it on promotion.
All in all, this was a good exercise, which gave me the opportunity to get some experience in all stages of an app development, starting from the concept, to prototype, to the complete app, and to promotion. It would be nice to do the same for the iOS version, especially, if the app also brings some money.