From Above

From Above is my next project in the pipeline.  Development started one week after Master of Tea Kung Fu was released and has progressed far enough to be revealed.  I originally wanted to submit this to last years IGF but it simply wasn’t ready.  It started first as a fast paced action game on a single planet but quickly evolved.


From Above

From Above is a procedurally-generated planetary exploration game. You play as an engineer on a small planet (mother ship) travelling to different galaxies and exploring planets for resources. Resources are gathered using your trusty multi-purpose capsule-bot. These can then be used to upgrade your home planet.  New buildings and factories will allow advancements in technology and weapons for exploring more challenging galaxies.

Galaxy Exploration Using Your Home Planet (Mother ship)

Deploying Capsule-Bot Sequence


  • Procedurally-generated planets, some with inner layers that can be explored
  • Environments that react to local events (shock waves, surface damage, etc…)
  • Upgrade and personalize your home planet (mother ship) adding new weapons and abilities to explore more dangerous galaxies for higher rewards
  • Dangerous creatures that attack you in space and on planet surfaces
  • More to come…

Drilling Down To Inner Layer

During early prototyping, the game used full planets modeled in Blender.  I added land features and props that would be randomly chosen to try and add variety but it just wasn’t working well.  So for the last 5 months, I coded my own procedural planet system.  It’s by far the most interesting thing I’ve worked on and I’m quite happy with how it turned out.  It will allow many combinations of land region types each with their own set of parameters to control the type of land feature and foliage they get.

Here’s a video demonstrating the transition from galaxy exploration to planet exploration.

For frequent updates, visit my TIGSource devlog here.

Updates for IGF

Master of Tea released on iOS on Nov 20th, 2014. Almost a week after that, work began on my next game and something I’m really excited about and will reveal soon. But for the last month, I began updating Master of Tea to Unity 5 and making changes to parts that I felt were no longer fun in the game in preparation for submission to the 2015 IGF. I actually had a few areas that I wanted to improve but simply ran out of time. Besides minor bug fixes and updates to some animations, the following enchantments were implemented.

Special Effects

Shadows were finally added.  With the update to Unity 5, real-time shadows are easy to add for Android.  Unfortunately, the performance cost were too great on both my test devices.  So I implemented a much cheaper blob shadowing method.

Vignetting effects were added to help add more focus to the center of the screen.  The values are also bumped up during dramatic effects.

Shadows and Vignetting

Screen distortion was added and used every time hits or blocks are made.  They’re also used to create streaks of distortion that follow the attacking limb for every attack.  A typical implementation requires rendering the scene to a render texture and then applying distortion when rendering to the screen.  On my test devices, performance dropped well below acceptable values.  Adding optimizations such as downsizing the dimensions of the render target helped but didn’t improve performance enough at the cost of quality.  But I was so impressed with the effects that I just wanted to keep it in.  A lot of time was spent finding an alternative.  Honestly, it was probably more time than necessary given most people will probably never really notice it.  But it was one of those development tasks that I really enjoyed tackling and felt happy with the results.  In the end, my solution was the avoid post-processing by rendering the game scene to a much smaller render texture 10 times a second.  Distortion “bubbles” are rendered at the end which use this render texture and add some distortion over the scene.  The end effect performs much better but doesn’t look quite as good.  I’m still happy with the effect though.

Here is a video of a typical implementation for distortion.  In the screen shot, the effects are harder to see but in motion, it looks much better.

Here is a video of my optimized method.

Drink Tea Changes

The old drink tea system had very simple enemy attacks that the player could block.  The whole sequence was inspired by the final scene in the Matrix movie when Thomas Anderson realizes his power and stands there looking at his own hand while blocking all of agent Smith’s attacks with the other.

I decided it was time to change this to have more complex animations that chain together.  The enemy initiates an attack that the player blocks and this can chain to other attacks that all link together seamlessly.  The results look much nicer to me and requires swipe inputs that match the action of the player.  This took up much more time than I expected though.  About 30 animations had to be created and each animation the enemy had would require a corresponding animation from the player.  Below is a video of a long chain of attacks although in the actual game, the chain length is capped much lower.  I do plan to add new animations over time just to have more variety and reduce the likely hood of animations being repeated too often.

Future Updates

One part of the game that I really wanted to change was the hawk attack sequence.  It doesn’t seem so fun anymore and I’d like to rethink how that whole sequence should play out.  Maybe even just remove it completely.  For now, I reduced the number of hawks that attack to make the sequence faster and easier.

I also started work on a new game mode, one that can be played in short spurts.  The current campaign mode feels to “grindy” so I’d like to try something new.  This is a larger change though so it will take a while before it’s ready for release.

A Little More Character

The last month has been nothing but a constant crunch to polish and fix remaining issues. I never enjoy this part of the project no matter what it is I’m working on. But it does feel very satisfying when you see how many issues and fixes you’ve crossed off each day. I have a strong desire to refactor my code. I’m so glad I’m not working on a shared codebase. I’d feel embarrassed and ashamed to subject anyone to it. Crunches don’t yield the best code from me. But I put lots of comments to remind me to go back and do proper fixes later on. At least the bugs are resolved and my fixes do not affect performance.

This is sort of old stuff, I believe it was implemented all through the summer but I didn’t have time to mention it before. It’s one of those features that, once implemented, I regret not exploring earlier in development. I was working on adding a new enemy to the game and trying to figure out how to make this one different from the rest. It made me really look at the 6 enemies that were currently implemented and I realized apart from the attack animations, there was really nothing different about them. At least nothing from the point of view of the players. Sure their stats varied but it just made certain characters stronger or more aggressive. I realized adding a new character would just result in another clone so I decided to spend my time on trying to give the existing enemies more personality.

The result was adding the ability for characters to exist in different states. In code, I called these demeanors. And each state would have its own set of animations (idle, hit reaction, attacks). Enemies would transition to other states through a transitioning animation. These transitions are triggered either when their health has fallen below a specified value or when the player performs a specific counter after blocking all attacks. The coding requirements to implement this was fairly small but required a lot of small changes in many places. The animation requirements were huge in respect to my experience as an animator. I also wanted to create counter attacks that required specific opponent animations to play in sync. The animations alone probably took about 80% of the time. But I feel the end result was totally worth it.

In code, I assign each enemy type an alias. The first enemy to use these states was the Weasel. His default state is very calm and confident. He stands upright and keeps one hand behind his back. His second state is furious and he gets triggered into this state when his health drops a bit and you perform a counter code named “Forced Splits” as shown below.

The next enemy, Assassin, also has 2 states. His initial state is calm and a lot of his attacks will have him dropping a smoke bomb that replaces him with a piece of log and then he’ll reappear to try and hit you with sneak attacks. He has a very high chance of blocking all your normal free form attacks too. Once he’s weakened enough, you perform a counter where you grab the smoke bomb out of his hand and shove it in his mouth. The bomb explodes transitioning him into a weak state where he essentially becomes your punching bag.

The last enemy is the General. He’s the last enemy type you’ll encounter and has 3 states. He wears a gauntlet on his left arm that shoots lightning. These lightning attacks do massive damage and you can only dodge them, there is no counter. He transitions to his second state when you perform a counter that cause some damage to his gauntlet. This puts him into a furious state that changes all his attacks. He’s more aggressive in this state but is less likely to block. Another counter finally destroys his gauntlet puts him in a weakened state.

I’m really surprised by how well these changes went. The characters have more personality and it becomes a joy to watch as you break them down into their most vulnerable state. I wish I had time to implement states for the remaining characters and perhaps I will through updates. I will definitely explore this option for characters in future games.

Hawks and Hair

Hard to believe it’s been over 3 months since my last update. July and August were very slow months since the kids were off school and there were weeks in between all their summer camp programs where they stayed home with me. It was a good summer and I enjoyed being able to spend more time tending to family matters. But it’s good to get back into full-time development.

I’ve made a lot of updates and improvements to try and reach a June release. I was hoping to have everything all done before the summer break. That didn’t happen, but the extra time did allow me to add various improvements and features that I had on my list. I’m currently doing polish for release now so I’ll keep this update short.

More Hawks

One mode I added to the game a while back was a Swarm Defense mode. Its purpose was to add a bit of variety to the gameplay instead of always fighting one on one with a human opponent. The original implementation had a very small swarm of hawks that would fly in and players would have to dodge them as they attacked sequentially with random attacks.  It succeeded in providing something different to break up the action.  But it wasn’t fun.  Actually, the whole mode just felt unnecessary.  Here’s a video of what the old Swarm Defense mode looked like.

In the original implementation, you can only dodge the hawk attacks.  But because of the time required to play the dodge animations, the hawks attacks happen very far apart.  That’s no fun!

So I decided to add more hawks and throw away the ability to dodge.  Why dodge when you can kick!  You’re supposed to be a master of kung-fu after all.  Gone are the swipe inputs, replaced with touch indicators that scroll across a rectangular pane.  Each indicator represents a hawk attack and you have to touch all of them before they scroll out of view.  Here are the results.

In my opinion, it’s a huge improvement.  Actually, I believe with more modifications, this could probably become a separate game on its own!  It offers a faster pace of action and it’s quite challenging.  It’s rare for me to complete this mode unscathed.

Messy Hair

The next update I’ll talk about is a small feature.  One of many things I thought of a while ago and put it on the very back of my priorities list.  It’s one of those features that are completely unnecessary but add a little charm and personality to the game.  I was probably burned out and just needed to work on something else for a few hours so I decided to implement this.  The hair for the player now gets messy as he takes hits.  Below  are images of what his hair looks like when it’s neat and messy.

This is the player’s hair at the start of the level.

3 or 4 hits later, the player’s hair becomes a mess.

The victory animations for the player has been changed.  The game will check if the player has messy hair and if so, it will play an animation to fix it before playing the normal victory animation.  I plan to add different hair styles and head pieces as free updates and they will probably require their own specific animations as well.

That’s all I’ll share for now.  My current work mostly involves final polish.  This includes adding missing sound effects and replacing temporary artwork.  I made some pretty big changes to enemy characters that I would like to share but maybe that will come in the next update.

Steam and Sound

Things have been really busy since the beta release.  I don’t have a lot of testers but the ones that did try it out gave me very similar feedback.  So the last few months I’ve been working on addressing those issues.  The bulk of the work was adding tutorials to walk you through the basics of combat as well as tutorials to help you understand the GUIs.  It’s the first time I’ve implemented a proper tutorial system and I’m happy with the results.  But it’s not very interesting or blog worthy so I’ll write about other items I’ve been working on.

One item I finally had a chance to go back and fix was the effect used for the tea steam.  It originally started as an effect using Unity’s built-in particle system.  But I just wasn’t able to create a good enough effect so I ended up implementing it myself.  This isn’t to say that the particle system in Unity is lacking, I’m just  not very good at creating good effects with it.  For my own solution, I ended up using a vertically scrolling texture mapped to a cluster of vertical planes that taper towards the top.  I use 4 planes that are rotated around the Y-axis (Z-axis in Blender).  I added vertex colours and this is used in the shader to apply more transparency towards the top of the mesh where I want the tea steam to dissipate. Then I parent this mesh to a simple armature with 2 bones.  One at the bottom, and one at the top.

I wrote a script component in Unity to scroll the texture coordinates vertically over time.  It also repositions the root bone to a specified GameObject on each frame.  The top bone is loosely coupled to the root bone using a spring damping function.  I’ve used this same function countless times on other projects.  I believe I learned about it in the very first Game Programming Gems book.  Anyways, after some parameter tweaking I was able to achieve an effect that’s fairly close to what I desired.  I believe using more bones would result in some pretty big visual improvements so I’ll see if I have time to implement this later on.  This is what the latest tea steam effect looks like in the test scene.  Excuse the low quality of the video.

A buddy of mine that I used to work with saw my beta post and asked to do sound design on my game.  He did sound design for 3 games I created when we worked together at another company so I was excited that he might be able to help me out with this project.  He works at different company now that specializes in sound design for games.  He has worked with clients that use Unity but the workflow involved him having full access to the Unity project and he would only make changes in dedicated folders reserved for sound design.  It also required the use of an audio toolkit plugin that can be purchased through the asset store.  The plugin only supported Unity 4 and I was still using Unity 3.5.  I had no intentions of upgrading to the latest engine at this point so I suggested that I spend one week to create my own audio toolkit that would provide roughly the same set of tools he was used to.  But it would work with Unity 3.5 and would also not require him to have full access to my Unity project.  Instead, I could provide for him a standalone build for OSX and he could access the audio toolkit in-game from a GUI that would allow him to assign audio clips to audio events and tweak the various parameters.  The toolkit actually took me about 9 days to complete but I was really happy with the results.  It was a fun little side project to work on and reminded me how much I love developing tools.  I defined all the audio events that the game would require and used public domain sound effects as examples he could work off of.  Unfortunately, the build I provided would not run on his system.  It ran fine on my system and my test machine (wife’s iMac) with no issues.  Sadly, I will probably have to work with him on a future project instead since I have no time to try and figure out what the issue could be and I’m sure he’s very busy himself.  But on a good note, the audio toolkit was very easy to use and allowed me to add new sound effects very quickly compared to the old system.  I never realized how beneficial such a toolkit could be.  Being  able to assign multiple audio clips to an event and tweak the various parameters (volume, pitch, fade-in/out, randomness, etc) while playing the game can have tremendous results.  I actually have a lot of fun creating the sound effects now.  I will probably have to do some research for royalty free music I can purchase online.

Below is a video of how I would use the audio toolkit and assign some audio clips for the Attack_Hit audio event.  Some parts of gameplay will appear chuggy from recording.  At least I don’t notice any of this when testing on my iPad 2.

If you watched until the end of the video, you probably saw the last Power Move I implemented.  The last week has been focussed on creating new animations for all the Power Moves and creating specific hit reaction animations that correspond to them.  I’m having a lot of fun doing these.  Maybe I’ll post more on these the next time.  For now, I will be making final adjustments to the enemy attack sequences.  Back into my cave I go!

Game Play Videos

Up until now, I have been blogging more about the tasks I have been working on.  I realize I haven’t really explained what my game is about.  It’s a 2D style fighting game where you control a martial arts master who uses the power of tea to fight.  You fight while holding a tea cup and taking sips of tea buffs various stats depending on the tea spices you use to brew your tea.  Additionally, drinking tea builds up your Tea Meter which allows you to execute various Power Moves during battle.  These are strong attacks that cannot be blocked by enemies.  The amount of tea your cup can hold is finite so you can only take so many sips of tea each round.  Each time you get hit, a certain amount of tea also spills out of your cup.  Here is some gameplay footage of the current beta.

This was a fun attack that I added early in the game.  If you’re getting desperate and still have some tea left in your cup, you can throw your tea in your opponents face and bash him with your cup!  Fun times!


Character Updates

I finally finished the new head for the player.  This is something I started a while back and worked on it on and off.  It was a real learning experience since I’ve never really modelled a fully animated head before. I’m pretty happy with the results though.  What I did differently this time around was to draw the topology lines on the front and side images of my concepts.  This really helped with modelling.  With the other heads, I wasted hours tweaking my edge loops to try and get a good topology.  I spent a long time painting the texture with cartoony details.  They looked good in Blender but I found that it didn’t fit too well in the game.  I noticed the same issue when I painted some details for the armor pieces.  I put lots of shading and surface details but it just looked out of place.  I ended up having to adjust the contrast and brightness settings heavily to mute the details.  So I started a new texture for the head and kept it very simple.  This looked much better in the game, especially on a mobile device.  The simple texture also allowed me to compress it down in size a lot with no visible compression artefacts!

I wasn’t too happy with the hair from my previous models.  I decided to model more details in the hair this time and use a very simple texture.  Most of the details would come from the light source and shader.  I was really happy with the way this turned out.  I may go back and redo some of the enemy hair meshes later on.

Here is how the head looks in Blender.  I used more bones this time around for better facial animations.

This is what the player looks like in the game, a huge improvement!

I also dedicated some time to finalize the look for the enemies in the game.  There are 6 so far, I hope to have at least 7 or 8.  If the game does well, I plan to add future updates that opens up new areas with new enemies with other abilities (elemental?).

This last week I spent most of my time preparing the game for another beta release.  This required lots of coding with spare time being used to tweak and polish animations.  Now that the beta is out the door, I’d like to prepare some things so I can start posting my game on development forums for feedback.  This is something completely new to me, I follow quite a few development forums but never participated myself.  But it’s something I should try to do regularly.

Environment Upgrade

The last few weeks I’ve been trying to follow my latest project schedule for a beta release in mid-April (hopefully).  Up until now, I’ve been loosely following schedules that I revise every few weeks.  I always stray off to focus on additional tasks that reveal themselves as I’m working on my current tasks.  This totally wreaks havoc on my schedule but it’s also quite fun to work this way.  Now that the game is near complete, I hope I can finally set a schedule and stick to it.

Last week, I focussed completely on environmental artwork.  The last time I did any work on the environment must have been over a year ago so this was long overdue.  I only allowed myself one week to work on this and I completed pretty much what I wanted to get done.  But I do want to put in another week of changes sometime after beta release.  I’ve been playing a lot of Rayman Legends with my boys and I really like the artwork.  You just don’t see many games like this anymore.  Half of the times we were playing, I was actually just focussing on the artwork and observing how they created such amazing environments.  I used that as inspiration as I created new textures and meshes for my background.  I actually played Rayman Legends and moved my character to some locations that I really enjoyed and left it running for hours as I painted textures for my game.  Here are some of the textures I was able to create.

Here are images of the new environments in action.

The bamboo clusters turned out far better than I expected! They animate too!

The rock textures are used for floating islands in the background. They’re organized in different parallax layers. You’ll noticed the effect when you ascend up to the next platform.

I’m very happy with the results, not bad for programmer art.  After looking at these screens, I find the lighting in the scene is too flat though.  I will try to add some subtle shading to add more depth.

For comparison, here are how the same levels looked like with the old environments

The new environment artwork also makes the mountain texture used in the background stick out.  It just looks horrible plain and simple.  I think this texture was done a year ago and I actually spent a whole day on it before giving up and settling for this monstrosity.  It’s good to see how much my digital artwork has improved.  I will definitely replace this eye-sore before release.

Performance Issues

After adding the new environment artwork, I loaded up Unity on my Mac and made all my usual tweaks to the texture import settings to compress them with minimal visual artefacts.  I deployed my game on my iPad 2 and noticed a significant drop in performance for levels that used the bamboo clusters.  For the first time ever, I was hitting below 30 fps and animations definitely looked jerky.  I changed the project settings in the XCode project to view some profiling information and found the draw calls had grown substantially.  Each frame was now making around 350 draw calls.  Clearly this wasn’t optimal and I went back to see what I could do with the bamboo clusters.  They were originally modelled in Blender as separate objects with their own animations.  I typically use a vertex shader for swaying objects but I decided to animate the bamboo directly so I could create more interesting animations.  I tried a combination of different things but in the end, I combined the entire bamboo cluster (of about 10 bamboo) into a single mesh and used an armature to do the animations.  This cluster is then instanced a few times and scattered in the background.  The texture for the bamboo is very minimal, just a single bamboo texture that can be tiled vertically.  The leaves are also part of the texture but occupy another side so that it does not affect tiling.  I achieve different looking bamboo by using vertex colors.  With my new changes, draw calls were back down to about 150 and I’m getting around 45-50 fps.

Beware of Point Lights?

While investigating the performance issues related to the bamboo clusters, I noticed the rendered triangle count reported by Unity was abnormally high.  I was close to 30K triangles per frame!  The only objects in the scene with fairly dense meshes would be the characters but there’s no way it should have been so high.  I tried disabling one of the body parts during gameplay and noticed that the rendered triangle count would decrease by double the triangle count of the mesh itself.  So it turned out the characters were rendering in 2 passes.  I looked at the shaders I have written and found they were all Unity surface shaders.  I rewrote one of the shaders as vertex and fragment programs using CG and tested it out.  It was still rendering in 2 passes.  So I checked the one an only light source in the game.  It was set to a point light so I tried changing it to a directional light.  That was it, changing to a directional light made every body part render in a single pass and my render triangle count was back down to under 20K.  I didn’t really notice any hard evidence of performance increase though.  So I wonder if the reported triangle count might be buggy in Unity (version 3.5.7f6).  But just to play it safe, I’ll keep it as a directional light.  When I have time, I may try and track down the cause of this issue.


I’ll be focussing on the player mesh this week.  You can already see some of the changes I’ve made in the latest screenshots.  The head I have been using is very old and it’s about time I replaced it.  I’m only giving myself one week to work on this, hopefully I can get enough done in that time to move on to my next tasks.  But it has been while since I have done character modelling and animation.  I always stumble badly when it comes to rigging and this is the first project I’ve done using facial animations.  The player character will use a more elaborate rig than the enemy heads.  I’ve been reading through a lot of online tutorials for modelling and rigging and I’m trying to create a cleaner topology that is more suitable for animating.  Ok, back to work!

Finalizing Character Models

With the core game play elements mostly complete, I decided to dedicate a whole week finalizing the visuals for the characters.  As usual, I greatly underestimated the amount of time and effort required to do this.  I will likely spend many more weeks on this until it can be considered done.

It’s been a while since I’ve used my pen tablet (Wacom Intuos).  I generally try and do all related work together in bulk.  So the last few weeks was mainly small coding work to tweak the game and add any minor features.  Now I’m doing texture work and modelling.  It took me a while to get used to digital painting again, it always does after not doing it for a couple months.  But I find that my skills improve (slightly) every time I come back to doing art.  The results are pretty good for programmer art.  It’s not at a professional level but maybe with enough time, I’ll get close.  I mainly used Blender to do all my texture painting but touch up the images with Photoshop Elements and Paint Tool SAI.

Below are images to briefly describe the work involved in completing texture work for the Guard character.

The final look of the Guard character in Unity. The color scheme will probably change. I’m pretty bad at picking colors and often make changes once I realize how bad they look.

All textures were painted using projection/texture painting in Blender. Because I’m not very good at choosing colors, I painted all textures in gray scale and used shaders to apply color (more on that later). This allows quick iteration but it limits the visuals you can achieve since you’re just multiplying colors with a grayscale image.

Projection painting in Blender works well. But I had difficulties painting smooth seamless bands for the upper arms and lower legs. I ended up using Blender to rough in the lines and then used Paint Tool SAI to do final line work. I’m so glad I bought this program. I will use this tool more often. It’s unfortunate that there is no native support for TIFF files. It lacks some layer options and filters that would make this my default tool for texture painting.

As I mentioned before, all colors are applied using a fairly simple shader. It also does toon ramp and subtle rim lighting. To apply the colors, I use a separate image to define masks for 4 different color values using the RGBA channels. Here is the texture and corresponding mask texture for the boots. As you can see, I’m using Photoshop Elements that came free with my Wacom tablet. It has some issues but it’s usable. Maybe I’ll get an Adobe Creative Cloud license after releasing this game. I’m sure Photoshop would have some added features that would make texture work more efficient.

That’s all for now, back to crunching.

A long overdue update

Over a year has past since I’ve started working as an indie developer and I guess now is a good time to post an update to show what I’ve been working on.  It’s a 2D style fighter for mobile platforms.  The current title is “Master of Tea” but it may change as I get closer to release.  I wanted to make a fighting game with a more zany style and so far I’ve come pretty close to what I’ve achieved.  It’s a fighting game where you take the role of a kung-fu master who drinks tea.  Spices can be used to brew your tea to give you special abilities and power moves.  You fight while holding your favorite tea cup and must choose the right time to sip your tea.  Doing so will ensure the special abilities of the spices you added will take effect.  In addition, drinking tea builds up a meter that allows you to perform various power moves.  I would say the game is probably closer to final beta as all game play mechanics are complete minus tweaks to animation and timing.  The bulk of my time is now play testing and making adjustments to effects, timing and animation.  I have a long list of artwork that needs replacing but everyday I’m making steady progress.

It’s been an exhaustive year but a great learning experience.  I learned an incredible amount during this time.  If I ever decide to do another project after this, I will do many things differently.  But this first project was about learning all the hard lessons early so that future projects will come together faster and with better results.

It’s getting late so I won’t write too much.  But here are some of the latest screens of the game in it’s current state.

A lot of the art is still rough work and will be redone.  The player is still using a very old mesh for the head.  A new one is being developed but it’s taking me a long time since I want to properly model and animate the face for better facial expressions.

For anyone that’s interested, here is a very early screenshot of the game running with prototype artwork.  The game has really changed a lot in the last year.