Circuits is our last game in Digital Tentacle. It's a musical puzzle game for iOS, Windows, Mac and Linux. Music and levels have been created by David García, an amazing person and composer. We have used Unity to develop this game.
This game is about music. In each level you have music you have to copy using audio clips. You have to do different task like set clips position, set loop counter, etc, to build the final song.
To create a level we use a custom editor inside Unity.
This way, the levels are created very quickly. To generate the playable level, it is only necessary to press "Generate Circuit" button.
It's look obvious that the most important thing in this game is music. It is mandatory that the music sounds perfect and don't be too big on disk space. So in the beginning we used MP3 as a chosen format to store the music, but MP3 has the gapless problem so we changed it to OGG. This works fine in Windows and Mac, but in iOS is not possible to use OGG on Unity, you can use only MP3 or WAV. Unity has a "gapless looping" option when it compresses WAV to MP3, but this doesn't work perfect, you can still notice a glitch. So we looked for another solution and in the end this is the way we did it:
So we store all audio clips decompressed in memory (in a class called AudioBuffer) because we have to create the song mixing them. To create the AudioClips used by Unity we do this:
We use this system to compose the final song you have to copy instead of using a sound file (this way we save space on disk). Our musician use a text file to define the positions of the clips, loops, etc. The file looks like this:
// Syntax: Time: clip_name [ * loop_counter ] [ > clip_name_to_concatenate ] .MELODY [ 2: Cir_lev7_mel_1_02sec > Cir_lev7_mel_2 14: Cir_lev7_mel_3 > Cir_lev7_mel_4 > Cir_lev7_mel_5 ] .RYTHM [ 2: Cir_lev7_arp_1_02sec * 5 > Cir_lev7_arp_2 * 5 ]
In the latest update of the game we included the Circuits composer. With this program the users can create their own songs using a huge sample library (that is in continuous grown) created by Circuits composer David García and by Circuits users. The created songs and packages can be share on Steam Workshop.
In iOs the game is distributed free. With the free version you can only play a few levels and the game contains ads. If you want all levels and remove the ads you have to buy the complete version of the game. You can do this inside the game as ingame purchase. Besides, you can buy also some extra points to use different powers inside the game and a package with new audio clips to use in free gameplay mode. We have implemented a coupon system so we can create coupons (8 letters long alphanumerical string) and decide the action of that coupon. A coupon can unlock the full game, give you some extra points and/or unlock the extra audio clips package. This way, we can send coupons to magazines to review the game or to our friends and give them the full game for free.
We have used Python on Google Application Engine (GAE) to implement the coupons server. The way the coupon system works is like this:
hash_key value is computed use some game information and a password. The server knows how to calculate this, so it compares the petition key to the generated key and if are differentes, it will ignore the petition. Besides, the server check if the coupon exists and is valid (same game, same platform and has not been used before).
Update: In the end we decided to sell the complete game without a demo. So, although the whole coupon system was working, we didn't use it.