Bookmark this on Hatena Bookmark
Hatena Bookmark - Sometimes, you just have to go with it…
Share on Facebook
Post to Google Buzz
Bookmark this on Yahoo Bookmark
Bookmark this on Livedoor Clip
Share on FriendFeed
Sometimes, you just have to go with it…peter mares dot com

A few weeks ago, I was chatting to Spencer (the designer of the MindHunters game I’m working on) about the cocos2d-x¬†framework and how I would like to port Lumi over to the framework to allow Android users to be able to experience the game. The beauty of the framework is that it is an almost direct port to C++ from the original cocos2d-iphone framework which Lumi was built on, and since all of the game logic had been written in C++, all I needed to do was rewrite the Presentation Layer code to sit on top of cocos2d-x.

While we were chatting, Spencer had another moment of spontaneous creativity and and idea generation that happens often enough to warrant its own name. I call it the ‘Spence-Idea-Creation Effect’ or… SIC Effect (If you ever have the pleasure of meeting and chatting to him, you’ll understand what I’m talking about). Spencer had just formulated a really interesting, seemingly simple game idea that just seemed too fun to not do- and I could already see how Cocos2d-x would support the idea perfectly. The idea was to put a player in control of a zombie who had to chase, bite and convert all humans in a play field into other zombies. These zombies would then join the player and create a swarm of zombies until all the pesky humans were dead.

The next few days were spent hashing out random ideas and details over coffee breaks and when we felt we had enough to start with, I got a 3 of my friends interested enough to want to get involved in developing the various modules of the game.

The following were the initial requirements for the game:

  • The game controls had to be super simple. A single left click is all it should take to unleash devastation within the game.
  • I did not want to spend time creating game content, and I also did not want to play the same map ever again. So, in short, procedurally generated playing fields.
  • The entities in the ‘swarm’ had to have a decent path finding logic controlling them. However, we could not implement a traditional swarming algorithm since it would not fit the game. Zombies warping around a 2d map randomly just did not seem appropriate, and further more, seemed down right over powered.
  • A finite state machine would be used to control the logic of each entity, which would make it easy to introduce new behaviours per entity (or per swarm) in the future.
Pretty simple and straightforward requirements I think. The team agreed that these requirements were a good start to work towards and started coding on a Wednesday. A few days later we had the following modules created and integrated with each other to give us a first glimpse of Spencer’s vision:
  • The Game application layer that provided general services to the rest of the game sub-systems
  • A procedural map generator for generating city-like maps for the game.¬†
  • Entity and swarm management that allowed our google-imaged zombies to run visibly run around the map.
  • A tweaked A* algorithm that controlled the zombie and human entities.
  • An FSM (Finite State Machine) engine that could be specialised quickly per entity type
We met up for 10 minutes to review where the game, took notes of changes we wanted to implement down the line, as well as new ideas that cropped up now that we could see the first iteration of the game running and planned our next ‘mini sprint’. Another 4 days later we had added the following additions to the game:
  • A rewritten map generation system that easily supported different types of map generators to be selected
  • Specialised FSMs for our various entities.
  • Humans now knew that Zombies were bad for their health and could run away (or, shoot at the zombies if they were graced with ranged weaponry).
  • Zombies obeyed the skewed laws of physics in our game world and would not be able to wrap through each other to try and get to the yummy human first.
  • A decoupled entity property definition system that allowed Spencer to start tweaking the game balance.
  • A couple of cool yet simple visual effects that added a bit more polish to the game.
  • A new map generator to generate park like maps.¬†
  • Health bars and damage indicators (this reminded me of the mobile phone phenomenon – until we had these, we didn’t know we needed them)
  • Dynamic view scaling based on the size of the player’s zombie swarm.
A second quick review, a few more tweaks here and there and we had a game. It is in no way pretty, but it was a game, and we are proud of it. It took 12 days of coding, 2 review meetings and countless ‘what if?’ sessions, but it was great fun. We are now tidying up the code and will possibly make the visuals slightly prettier before release. The game will be released as open source along with a tutorial on ‘how it was created’ and will compile and run (hopefully) on the following platforms:
  • Android
  • iPhone
  • Windows
  • Symbian
  • WoPhone
  • etc (see cocos2d-x’s supported platforms for the platforms this should support).
There are still outstanding pieces of work to do – specifically:
  • Game Level manager that controls the progression of the game and allows the player to continue killing stuff with increasing difficulty.
  • Getting proper graphical content into the game. Another friend of mine has kindly volunteered to produce these and the initial stuff I’ve seen is looking awesome!
  • Sound!! SOUND!! Noise.
  • A nice startup menu interface.
  • Super Zombie Creation :)
Now that we are at this stage, we can see all the bad design choices we made, as well as all the good ones we took gambles on. All of us are eager to rewrite the game with the lessons we learnt in hand and make it ‘publishable’ in some form or other.
Once we release the game to the community, I’ll let you know.

A pre-alpha screenshot of my swarm in the game.

Share and Enjoy:
  • Print
  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Yahoo! Buzz
  • Twitter
  • Google Bookmarks