News :: Guest Column - The making of Hocoslamfy

Date: 2014-03-24, Author: Nebuleon Fumika

About the game

Made in the style of classic cave flying games, in this reimplementation of the widely popular game Flappy Bird by Dong Nguyen, you are a bee and you must avoid crashing into bamboo.

Cave flying revisited

I'd say that the development of hocoslamfy has been really weird, starting with its name.

I had learned, within the same day (2014-02-08), both that Flappy Bird even existed, and that its creator was about to pull it from all app stores. On IRC, we were discussing this, and basically said that Dong Nguyen could have just made this game effortlessly with Game Maker.

It then dawned upon me that I could make a similar game in SDL and C. I had never made an SDL application from scratch before, so making hocoslamfy was a nice challenge.

I set up the project directory and Makefile, reusing lots of code from ReGBA[1], and made a simple version without any graphics. The name was decided hastily, but kind of stuck after the events that followed. It took me only 5:30 hours of coding, and there it was! The first version of hocoslamfy!

It was ugly, but it played well. The physics were easy to code, but difficult to fine-tune so that the physics didn't seem too contrived.

Already, hi-ban (our graphics artist) had started making graphics for the game. He also integrated the graphics into the game, which is the first time he's ever coded for a game. He thought it was cool to actually make the code that drew his graphics to the screen.

We then learned that Apple and Google were taking out any application that referenced Flappy Bird using the words "Flappy" and "Bird" from their app stores. The name hocoslamfy stuck even more.

Users were already posting high scores, but I had no high score keeping system yet. jxv provided this later, making the local collection of high scores easier. He didn't care much about the copyright of that code, so he assigned it to me and agreed that his code was under the GPL v2.

While that was happening, hi-ban was making a second version of the graphics "in a style inspired by Yoshi's Island and its crayon-drawn backgrounds", and he said we'd need alpha blending for a new semi-transparent anti-aliased background. He also made an early version of an image for the columns that the player must pass through.

I looked into using a 32 bpp video mode, and the performance characteristics of everything. As hi-ban gave me the layers, I integrated them into the game, using the Y coordinates he gave, and found that the game now had 95% of CPU usage!

My attempts to improve the CPU usage were odd. I first found some documentation online about an SDL function called SDL_DisplayFormat. It converted textures to an optimised format for the display, allowing the CPU usage to drop. But I was then met with an ugly background.

After getting it to work with SDL_DisplayFormatAlpha, hi-ban started to work on making bamboo in the same style as the rest of the graphics.

We still needed to find some good sound to accompany the game, and I tested the game with my sister. After lending her my GCW Zero and watching her play the game, I noticed that she never made comments on the score until her games were over, which was the opposite of what she did in Flappy Bird. I had to tell her the score because she couldn't look at it while playing the game, so I decided I'd do something about that.

Surkow found some music; I listened to a few tracks and decided on one. The search for sound effects was odder, because people were giving me actual insect sounds, and not cartoony effects. Being creeped out by flying insect sounds, I refused to open any sound I was given, instead searching for them myself.

All the sound is Creative Commons licensed, and I took some time to record the origin of every sound file and all the modifications I had made to them.

After all the sound, it was time to tear down the score display and be novel. Independently suggested by a Dingoonity[2] forum user, Gab1975, was a way to see the score you had while playing, after a fair amount of back-and-forth on the title screen animation.

I eventually chose to display the score a player could have if he or she passed the bamboos in the middle of the spaces themselves.

And there you go! A pretty fun game, using only Creative Commons assets and open-source code[3]. It was even fun to make the game, not just play it! Hocoslamfy can be downloaded at the GCW Zero Repository[4].

[1] https://github.com/Nebuleon/ReGBA
[2] http://boards.dingoonity.org/
[3] https://github.com/Nebuleon/hocoslamfy/
[4] http://repo.gcw-zero.com