I am a Blizzard fan boy. There I’ve said it. I’ve tried almost (if not all) of Blizzard’s games at some point or another. I admire Blizzard as a game company. Back in the day they stood right next to Westwood and Bullfrog as my 3 most favourite game companies. Now the latter two are dead. Somehow Blizzard has stayed and grown, and grown, into the great powerhouse it is now. Thankfully it seems it is here to stay. With Overwatch and an actual movie looming up on the horizon, I’d say (and hope) that things are looking good for Blizzard for the next decade or so. Now back to why I actually bothered to write a post at 11.44 pm on a work-day: Hearthstone.


Hearthstone In-Game Screenshot – Landing Screen – Copyright Blizzard Entertainment

I started to play Hearthstone very recently because a friend of mine suggested that I give it another go. I had attempted it a number of times but I never really got into fully. Until now. I decided to start playing some of its adventures and got a “couple” of Old Gods Expansion card packs. I ended up hooked. I am now doing dailies almost … well… daily. If it were not for the occasional Overwatch game that’s all I would be playing at the moment. *my Steam library is looking at me like a jealous ex-girlfriend*. Anyway, I love this game. It gives you some amazing highs. The exhilarating feeling of a card drawn and played at the right moment is a feeling I never knew existed. Especially when said card wins you the game. Moreso, when the opponent has been battering you to bits all game. Old Gods capitalizes on this by means of the C’Thun card. I think Blizzard designers are really good at what they do and I love the fact that they get to try new mechanics through Hearthstone. I am quite sure that they are collecting analytics with the aim of understanding what makes people play and pay more.


Hearthstone In-Game Screenshot – C’Thun Mage Deck – Copyright Blizzard Entertainment

So yes, Hearthstone gives you some interesting highs – but also some interesting lows. Just now I came across this Druid deck. I don’t know for the life of me how anyone could beat this one:

Hearthstone Druid Deck Massacre

Hearthstone In-Game Screenshot – Druid Deck Massacre – Copyright Blizzard Entertainment

For all of you who never played this game: I am royally done (for lack of a better term I wish I could use but have not for the sake of decency). In the next turn my opponent can do a total of (12+10+5+3+5+5+5) 45 damage. I have 23 health which means that with just the first 3 minions attacking me in the next turn I have already lost. That is not counting any spells my opponent might have available (doubtful given the deck I guess, but possible nonetheless). This is a low, a terrible low, because I was playing the game confidently with quite an initial lead. Now I know that this guy was probably very lucky but damn does this feel like the game is punishing me for not spending more money to find more legendaries! If you don’t know how that part of Hearthstone works: the minions on the board with the dragon-like outline are legendary ones. They are extremely rare to come by and can be found either by buying a ton of card packs or by crafting (which also requires you to have a number of extra cards).


Hearthstone In-Game Screenshot – My Collection – Copyright Blizzard Entertainment

Bottom-line, getting those cards is expensive and requires either a ton of time and dedication playing dailies or throwing a ton of money at the game. I personally maintain that legendaries win the game and this is how Blizzard make money – they want you to find them or craft them since this means you have to spend money in the game. Since most of us cannot spend so much time playing the game they know we will eventually cough up the money and pay and this is what they bank upon. I have no numbers to prove this and this is just what my gut tells me so I might be completely wrong but to me it does add up somewhat.

All the negatives (perceived or real) aside, I’ll probably still go back to playing the game again and again as I find it quite enjoyable. Even if I know that I might loose more than half of the games I play, the fun factor is there. I think Blizzard did it again. GG Blizzard, you magnificent bastards! 9/10

Risk of Rain

Risk of Rain is a rogue-like 2D indie platformer that ran the risk of being yet another game I bought and added to my Steam library and never played due to lack of time. Thankfully that was not the case! I bought a couple of copies for my friends and we decided to give it a go during lunch break at work. And. I. Was. Hooked.


Risk of Rain In-Game Screenshot – Copyright Hopoo Games

We died. Oh how we died. This game is a bit hard for a newbie. At first the game lulls you into feeling safe. A few enemy spawns here and there. You’re like: Ok I can do this. You kill them easily at first. However, after a few minutes of fighting you realize that there isn’t really a point to standing still and fighting everything that spawns on screen as they keep coming at you relentlessly. Soon you are no longer killing them easily. Soon you’re running around trying to survive being decimated by the myriad different types of enemies and their painful attacks. And then one of you realizes. Guys we need to find a portal. Huh? It says so at the bottom of the screen. Oh! That’s the kind of game Risk of Rain. Old school. No tutorials. You learn by exploring or you die and try again. Back to the good old days where games were challenging instead of the current trend to have everything explained with a million screens or endless text. Just one sentence and you have your mission.

Once you find the level’s portal, which by the way, is never in the same place because every level is randomly generated, you think to yourself. On to the next level. But no. The game decides to punish you for your minor achievement. You survived this long? Let’s see if you really deserve to proceed. With that it starts spawning a number of enemies at a faster rate near where you and your team-mates are. Since that is not enough it also spawns one of a number of boss enemies. Cause: Hey! Why! Not! Each boss enemy is a b**ch to kill and downing them is an achievement in itself. Once the timer expires no more enemies spawn and finally you have earned a bit of respite. You get to clear all the enemies and then using the portal you get to do this again on an another level. Only this time it’s harder and harder. Risk of Rain punishes you the longer you play. Enemy spawns happen more often, have more hitpoints and often become more advanced versions of themselves the longer you play. Just to give you an example, the first enemy you are bound to meet in a game is called a Lemurian. A Lemurian is your height and is relatively easy to fight and kill. An Elder Lemurian in comparison is more than 3 times your height and shooting it feels like you are tickling it. Either way, if you think you are going to blast your way through and survive you are wrong. You have to keep moving and shooting until finally you say to yourself: Are they really all dead? At which point the game starts spawning enemies again…


Risk of Rain In-Game Screenshot – Copyright Hopoo Games

Not all is doom and gloom however. As you kill enemies they drop some coins and experience for you. The latter helps you level up and with that you become a bit stronger. Not enough to survive, however, but your odds are, if ever so slightly, a bit more in your favour. The coins on the other hand can be used to open chests/trigger statues and repair drones. Once opened or triggered, the former two drop items which you can collect. Items give you a slight advantage such as enabling you to jump higher or faster regen. You get the idea. They are not going to win the game for you but no player, in their rightful mind, would decline collecting them after they have played the game for a few minutes. Some items are use items which are equipped in your action bar and allow you to trigger an effect such as firing a powerful weapon or spawning a ghost of some of the dead creatures in the level to help you in your fight… Drones are … well… drones which follow you around and help you in various ways. Either by helping you increase your damage output or by healing you up. They do get damaged however by the enemy spawns so moving is imperative to keep them going for longer. If they do get destroyed you can repair them but this often takes more coins each time it happens.


Risk of Rain In-Game Screenshot – Copyright Hopoo Games

Once you run through a number of levels you are greeted with the final level and boss. I won’t spoil the final fight but if you manage to defeat the final boss the adrenaline kick you get is amazing. So much so that, if you are like me, you’ll end up wanting to do it again. And why not? Risk of Rain is not a long game but it’s replay value is great. Every run is guaranteed to feel like a new experience not only because of the different layouts, different items you can collect in a run or the different enemies that spawn. You also get to play it with different characters you can unlock and which change the game completely. Each of the characters in-game has 4 different abilities. I personally believe which one you choose says a lot about you as a player. When my friends and I started to play the game we immediately found a character we liked – often when you unlock a new character you end up either never going back or quickly realizing that you prefer the previous favourite’s style of fighting.


Risk of Rain In-Game Screenshot – Copyright Hopoo Games

Another cool feature of the game, which also adds to its replay value, are the hidden areas. These sometimes spawn in the map and if the level aligns itself properly you can collect an artifact item. Artifact items are special items which enable you to change the game in a subtle way before you start a run. One of them for example removes the RNG of the items which drop from chests/statues and allows the player to pick the item they prefer allowing for a more customized experience. Me myself? I usually end up puttiny my fate in the hands of the RNG gods.

Some other things which are worth mentioning: its atmospheric music gets stuck in your head. It’s that good. More than I expected for an indie game of its price to be honest. And if you like pixel art you are in for a treat. The environments, characters, enemy spawns, biographies (which you can collect by the way) and effects are really amazing as well. Currently my desktop background is one of the environments in fact. It’s that good. Finally the game has challenges and achievements too if you are into that kind of thing.


Risk of Rain In-Game Screenshot – Copyright Hopoo Games

There are only two minor things I can mention as negatives: the game only updates your stats if you play on normal mode (not on easy). I didn’t understand this at first and thought the game was buggy. The other one is that sometimes the character you are playing with clips through the level. This usually happens at the very beginning of the game and then it is usually fine for the rest of your run so no biggie.


Risk of Rain In-Game Screenshot – Copyright Hopoo Games

Risk of rain is a game worth every dollar/euro/pound/yen/etc you pay for. The small team that made it deserves what they get from you because they produced a solid product with an unlimited amount of enjoyment. 10/10

The Masterplan

I got The Masterplan (by SharkPunch) as a surprise game in the December (or is it January?) Humble Monthly Bundle. I must admit, I had never heard of it but one of my new year resolutions was to try to play more games and blog more about gaming in-general so well… here I am! I’ve only played the first few missions but I can already see that this game has lots of potential.


The MasterPlan In-Game Screenshot – Copyright Shark Punch

The game consists of you controlling Joey and his ‘colleagues’/goons on a number of heists with the aim of making money in order to fund even bigger heists. You have a number of actions at your disposal with more becoming available as you pick up more items from the environments. Some items can be found lying around others have to be extorted from a number of NPCs which you come across. The NPCs themselves exhibit scripted but intelligent behaviour. In one mission I had to wait for a mini market clerk to visit the toilet in order for me to hold him at gunpoint while Joey’s brother punched him relentlessly in order to knock him unconscious. This happened in the toilet so that the mini market customers could not see what happening and notify the police from the phone boot outside. All this happened after Joey’s brother sneaked in one of the backrooms and disabled all the cameras by bashing the camera panel… and so on and so forth.I guess the game can be described as a tactical real-time strategy game where your resources are limited and every action counts. The view is top-down and is similar to games such as the original GTAs and the Hotline Miamis. What differs from these latter two is that you can take control of more than one character in The Masterplan and sometimes even force NPCs to do actions for you while they are held at gunpoint. In this respect this game is more similar to games such as Commandos and Frozen Synapse.


The MasterPlan In-Game Screenshot – Copyright Shark Punch

A nice feature of The Masterplan which I have to yet learn how to use properly is Slow-Mo mode. The game has two speeds: Slow-Mo and Normal speed. In Slow-Mo you can issue commands and the NPCs move at a more manageable speed. That said they do still move so you can get punched even while in this mode. This is something I need to explore more as it gives you more time to execute the perfect heist.


The MasterPlan In-Game Screenshot – Copyright Shark Punch

Each mission has a total number of cash you can obtain from the establishment you are trying to rob. If a heist fails or you fail to obtain all of the cash you can try again. The game attempts to be ‘politically correct’ by giving you an incentive not to murder people unnecessarily: an unconscious shop keeper is better than a dead one!

Now for a few faults: I found the controls a bit clunky but that can be attributed to me not having learned the hotkeys yet. I also saw a number of UI-related bugs but these were minor and did not break the game. Finally, I encountered a crash when I attempted to replay a heist but no progress was lost.

All in all an enjoyable game you should definitely try if you like tactical games. 9/10


Using Unity’s Postprocessor to “compile” strings

Tl;dr: String parameters are not type-safe. Using Unity’s Postprocessor replace them with automatically generated enums and detect errors at compile-time instead of run-time.

Recently, while working with a Unity plugin, I came across an API which makes use of string parameters. Personally, I am not a huge fan of them but I must admit that they are sometimes a necessary evil. This happens when an item is not available at compile-time but rather is determined at run-time. Their positive aspect is that since they are untyped they allow you to pass in virtually anything you want and it would allow you to compile without any problems. The caveat? If that string refers to a resource that is not found you have no way of knowing this until you happen to do a call to that API. If that happens the results could be unpleasant or even worse they could go through testing undetected until they are in the hands of a player possibly causing unwanted behaviour. So the questions are: Is there a way one can make one’s code a bit more strict by somehow introducing types in strings without losing the flexibility that the latter provide? Can we know at compile time whether our resource is well-referenced so that no (possibly hidden) problems crop up later on at run-time?  As it turns out in my specific case: yes! To be completely honest I am not sure it would work out in more cases and whether it can be in fact generalised but I am sharing it here just in case someone else finds it useful.

In my specific case the plugin is an audio one which, via a string parameter in their API calls, allows me to play a sound clip. In this case the string parameter refers to the sound clip name. Since this is a string which might be used in multiple places a common good practice is to make it a constant string. This latter constant string is then used instead of the actual string literal. In this way we gain a very small but useful advantage: if, for some reason, the sound clip name changes I have to change only one central place instead of having to potentially change more than one file. During development change is the only constant as they say, so being able to do quick changes like this significantly aids development by reducing the number of manual changes one has to do and preventing programmer errors which cannot be detected by the compiler.

So OK: I can actually now do the change manually in one place and my strings are a bit safer, however:

  1. I can still make a mistake in the new name I enter which error won’t be detected until possibly much later on. Moreover, someone might decide to change a sound clip’s name for whatever reason and inadvertently cause havoc in the game.
  2. I have to actually manually change/add/remove different constants for every sound file I rename/add to/remove from the project. We already automated one aspect by using constants. Can we improve upon this so that we automatically update the code?

Fixing the first problem above, the one related to detection, can be achieved by means of Unity’s own asset post-processor methods. More specifically in our case we can make use of:


This static method is called by Unity when changes are done in the project’s Asset folder. Therefore, adding/removing/renaming sound files would cause a call to this method to be made by Unity. This is the perfect place to do what we want to do, that is: detect what sound clips we have available when a change is made to the Asset folder. This can be achieved by means of the following code:

var filesPath = string.Format(
var filePaths = Directory
    .GetFiles(filesPath, "*.*", SearchOption.AllDirectories)
    .Where(file =>
        file.ToLower().EndsWith("wav") || 
var soundFileNames = filePaths
    .Select(filePath => 

The first line simply generates the path where our sound files are. By using Unity’s dataPath we are simply generating the path “<ProjectPath><ProjectName>/Assets/Sounds”. The second line does a search for all the file paths in this directory and its subdirectories which end with “wav” or “mp3”. In this way we obtain a list of all the file paths we care about. (Other formats can be added with ease in a similar way.)  The third and final line iterates through all the file paths and obtains just their name.

Having now detected all of the file names one might ask: what are we going to do with them? My answer is to use the file names to generate an enumeration which represents the sound file names and hence “typify” our strings! Basically, we are going to do a very simplistic form of code-generation within Unity! This will allow us to automatically update our code without our intervention. We can achieve this simply as follows:

var enumValueSB = new StringBuilder();
foreach (var soundFileName in soundFileNames)
    enumValueSB.AppendFormat("\t{0},\n", soundFileName);
var fileContents = string.Format(
    "public enum SoundNames\n{{\n{0}}}", 

Here we are basically iterating through all of the file names and generating their corresponding enumeration member. (We are also adding some tabs in order to preserve some code indentation.) Once we have done this we encapsulate all of these into our “SoundNames” enumeration. All of this generates our code which is then dumped into a sound file in the path of our choice. In my case they will go under “Scripts/Sounds/” which I have created forehand. (Of course, generating these folders automatically through code can be done too if required.)

Now all we need to do is actually call the two code snippets above from within “OnPostProcessAllAssets”. From now whenever we do an asset change, Unity will check whether the files in our “Sound” folder have changed and if so it will generate the required enumeration for us automatically! In my case if I add “sound_file_001.mp3”, “sound_file_002.mp3” and “sound_file_003.mp3” the generated script is:

public enum SoundNames

Now whenever I need to use a particular sound name I can do, for example:


I sincerely believe that while adding ToString() looks a bit ugly at least we are now sure that our code is safer and less prone to human errors by leveraging the compiler’s power. Something to note is that now whenever someone makes a change to our sound files, our project might not even compile. Let us say I rename “sound_file_001” to “sound_file_001b”. Now wherever we have the above code example becomes invalid since our code regenerates the enumeration accordingly. Ideally this is automated as well but for now at least our code is more safe because the compiler will from now on take care of any sound file changes for us.

I have attached the above code in its most basic form here (zip format):


Unzip it, drop it into your Unity project, create the relevant folders and you are good to go. Feel free to improve upon this code (there are a million ways it can be improved). I hope that this post helps someone speed up their development or think of new ways of exploiting Unity’s PostProcessor. Feel free to share any mistakes and/or improvements by adding comments below.

The Pagan Lord by Bernard Cornwell

If you like historical fiction based in the medieval England this is a must read. While a work of fiction based on actual facts this book opened my eyes to what England must have been a thousand years ago. A beautiful brutal land in constant conflict between the Saxons and the Danes. The book recounts how at one point England almost become Daneland, had it not been for the tireless and ingenious maneuverings done by one lord. This lord decides to side with the overwhelmingly Christian Saxons despite his legacy and faith in the old Norse gods. Initially outcast by the Christians for killing a priest who dared oppose him the tables turn when the former realize that prayer alone is not enough to cull the Danish horde. What I find incredibly compelling about Cornwell’s writing in this book is his ability to transport you into the fighting scenes. He recounts in intricate detail the lord’s sword-fights which elevate his persona from that of simple hardened general to that of a legendary warrior who fights for what he believes is right.

Rating: 5/5

The Alchemist by Paulo Coelho

A very good book which contains a few insightful gems. It is a bit over-the-top with its mysticism/religious elements for my liking but it really does make you think and question the way you look at your life. In the end what got me to like it was its main message: get out of your comfort-zone and follow your dreams because if you do not you might live a life of what-ifs.

Rating: 5/5

The Land of Painted Caves by Jean M. Auel

If you like the Earth’s Children series this is a recommended read. Note that I didn’t say “must read”. The reason I do not recommend this book like its predecessors is that it is a bit too long-winded at times. In fact, there were many times when I had stopped reading it altogether. However, due to the fact that is the last book in the saga (probably the last from Auel), my love of pre-historical fiction, the well developed characters and the “epic”-ness of the story I found myself being drawn back. All in all it is a decent book but mostly one for the fans.

Rating: 3/5

Working with C++ and Cocos2dx

Recently I’ve started my foray into the C++ world proper. I have always toyed a bit with the language and its predecessor C but I never really got into it fully, preferring instead languages such as C# and Haskell. However, due to the nature of the industry I work in, and due to how C and C++ make you think more about memory-efficient implementations, I thought it was high time I delved deeper into it. So far, personally I prefer the simpler C and languages such as C# and Haskell but hopefully this will change as I gather more knowledge about the language itself.

Just reading C++ tutorials and books is a bit boring though and learning is often more ‘fun’ when it is applied. Especially when it is applied to games! Hence, I’ve decided once again to try re-writing Space Generals. (Yes, yes, I’ve said this before). This time I opted for mobile and using the Cocos2dx engine.

Setting up Cocos2dx was not that hard but finding good up-to-date information online is hard since the engine is going through constant iterations. I am hoping the following set of steps help anyone who is looking to setup their Windows environment to be able to develop for Windows and for the Android platforms. They are very terse on purpose but should work. Let me know if you need more information and I’ll try dig it out for you.

Disclaimer 1: Cocos2d and Cocos2dx are in constant development so bear in mind that the information I have below might have already become outdated. Let me know and if I have some time I’ll update it accordingly.

Disclaimer 2: I work with a combination of Visual Studio 2013 and Eclipse Juno. If your target is simply Android, Eclipse should be enough. I assume you have some basic knowledge of how these two IDEs work. Having some knowledge of Android development would also be an asset.

Creating a Cocos2d-x project for Windows

Download and install

  1. Download latest v2.0 python 2.7.9. (Not 3.0): https://www.python.org/downloads/release/python-279/
  2. Download latest Cocos2dx (at the time of writing this is Cocos2d-x-3.4.zip): http://www.cocos2d-x.org/
  3. Install Python to your drive, e.g.: C:\Program Files\Python\2.7.9
  4. Make sure you add Python to your PATH environment variable.
  5. Unzip Cocos2dx to your hard-drive. For the sake of these steps I will use: C:\SDKs

Creating the project

  1. In command-line:
    1. Goto to the Cocos2dx folder: C:\SDKs\Cocos2d-x-3.4\tools\cocos2d-console\bin
    2. Create the project via> cocos.py new AwesomeGame -p com.awesomestudio.awesomegame -l cpp -d C:\GameDevelopment
    3. Run the project for the first time via> cocos run -s “C:\GameDevelopment\AwesomeGame” -p win32

Creating a Cocos2d-x project for Android

The steps below assume the above section has been completed successfully.

Download and extract

  1. Download and install JRE
  2. Download the Android NDK: https://developer.android.com/tools/sdk/ndk/index.html
  3. Download the Android SDK: http://developer.android.com/sdk/installing/index.html
  4. Download Apache ANT: http://ant.apache.org/bindownload.cgi
  5. Unzip Android NDK to C:\SDKs
  6. Unzip Android SDK to C:\SDKs
  7. Unzip Apache AND to C:\SDKs

Setup for deployment

  1. Run setup.py found in C:\SDKs\Cocos2d-x-3.4
  2. Supply path for NDK_ROOT, e.g.: C:\SDKs\android-ndk-r10d
  3. Supply path for ANDROID_SDK_ROOT, e.g.: C:\SDKs\adt-bundle-windows-x86_64-20140702\sdk
  4. Supply path for ANT_ROOT, e.g.: C:\SDKs\apache-ant-1.9.4-bin\apache-ant-1.9.4\bin
  5. A restart of the machine might be necessary at this point.

Compiling and running the solution

  1. In command-line:
    1. Goto to your android project folder, e.g.: C:\GameDevelopment\AwesomeGame\proj.android
    2. Run build_native.py.
  2. In SDKManager, update to latest toolkit.
  3. Open eclipse:
    1. Use any workspace. I used: C:\EclipseWorkspace
    2. Import solution into workspace, no need to copy in. You need to import cocos2dxlib and your game project.
    3. Remove libcocos2dx as a dependency. This was one of my major headaches while trying to configure my setup.
    4. Remove the default project dependencies (again something I didn’t know I had to do).
    5. Another problem I encountered was with my .cproject file. If that happens try recreating the project via cocos.py and then build_native.py.

Running and debugging

In Eclipse, assuming you have an Android virtual device setup, hitting run should make your game work using the default Cocos2dx-generated application. Unfortunately I had some problems with this due to a known issue related to my system configuration. Sometimes you cannot debug your application due to your graphics card not supporting a particular version of OpenGL which android supports. I am not a 100% sure why as I only did a quick Google search. There is help out there though if you encounter this problem. I hope you have more luck than me with this. If so feel free to comment.

In the end I resorted to coding and debugging my game in Visual Studio and then building it in Eclipse to create the apk which I then manually move to my Android device.

Hope that helps anyone trying their hand with Cocos2dx!

Diablo 3 and Starcraft II Heart of The Swarm

Blizzard you had me sorely disappointed when I played Diablo 3. You had re-hashed Diablo 2 but forgot what the nice things about it were. I basically played it once through on Normal and forgot the game completely. Don’t get me wrong it is still a good game but the only reason it was decent for me was because of the story and cinematics. The gameplay mechanics from the 2000 game did not live up to the expectations and hype in 2012. Maybe it felt too similar to World of Warcraft in some ways. Anyways I hope that the upcoming expansion will restore my faith. Blizzard, the Diablo universe has too much potential. Don’t let it go to waste! 6.5/10

Now to the real reason why I decided to actually update this blog at 1am: SC2: HoTS. I am still feeling psyched! I haven’t felt this good about finishing a game since forever. The gameplay mechanics are a testament to a true old-school real-time strategy game and the graphics are incredibly detailed and polished. However, for me, the actual magic comes from the story, the cinematics, the characters, the sound: everything here screams EPIC. Everything blends seamlessly. The final cinematic… wow. Thank you Blizzard for keeping that star-struck, magical feeling alive and for the gentle reminder of why I’ve always wanted to create games. I don’t think there is any other medium that is able to achieve this level of immersion when all the aspects are done properly. Kudos to Blizzard for managing this yet again. 10/10