LANManager Supports UNET

Surprisingly, the plugin I made for Unity called LANManager supports UNET out of the box. The plugin was made in last year, before Unity rolling out their new networking system called UNET, which is a complete remake from scratch.

LANManager is a Unity plugin that helps to propagate your Unity-based game throughout the local network and allows other clients to discover the game server automatically without the need to manually insert the server’s IP address.

The plugin seems to work fine without any modification to the code, except a small change is required for the sample project to run on the latest Unity – replace the Network View component attached on the character prefab with the Network Transform component and that’s it.

The reason why it still work is mainly because Unity didn’t change much of the abstraction layer, except the underlying architecture which is not exposed to the users. Event names such as OnConnectedToServer, OnPlayerConnected, etc. remain the same so it didn’t break any of the functions in LANManager. Good job to the engineers at Unity Technologies!

Old Project – 3D Level Editor (2010)

Today I stumbled upon some old screenshots in my backup folder and I thought maybe I should post it here to remind myself how passionate I was.

This is a 3D level editor I did for my hobby game project back in 2010. The level editor was made using Qt 4 and Irrlicht engine. Some of the screenshots below are showing the editor which uses Irrlicht’s native GUI. Irrlicht’s GUI system was quite limited in term of types of widgets and functionality, which later on led me to switching all the GUI over to Qt.

Some of the features supported by the “game engine” I did back then include:
– Basic fixed function 3D rendering
– Basic collision (box collider and trigger)
– Spawn points
– Player camera and animated camera (for in-game cinematic)
– 3D sound (using irrKlang)
– Simple path finding

I made a simple game demo using the game engine and level editor I made. Unfortunately, the game wasn’t finished and I moved on doing something else. Below is the video recording I did back in 2010 showing how the game demo look like, for a competition. Spore Motions was the name of our team back then.

Hopefully I will be back into game development very soon.

Building a Game with Unity and Blender

I am proud to announce that I have published my very first book! The book is entitled “Building a Game with Unity and Blender” and it’s published by Packt Publishing, a well-known publisher based in Birmingham, UK.

You can get a copy of the book directly from Packt Publishing or you can also order one from Amazon.

I would like to thank all the people who helped to make this possible. Thanks again!

UPDATE: The source files are now available. Download it here.

Basic Random Number for Games

Random number is one of the most fundamental and important elements in video game programming. It’s being used in many different aspects such as AI (artificial intelligence), procedural content generation, unit stat, and so on which makes your game less predictable and thus increases the level of replayability of your game.

I first learned to use random numbers in one of my earliest game projects (circa 2006), a simple scissors-paper-stone game made in Macromedia Flash 8 (now known as Adobe Flash):

Random numbers were used for its AI, which basically a set of numbers ranging from 0 to 2, like so:

A random number will be generated at the beginning of each round to determine the AI’s selection and then an animation will be played according to the result. Winning or losing for each round will be determined by comparing the number generated by the AI with the number selected by player.

For example:

Player AI Result
0 (scissors) 1 (paper) Player wins
2 (stone) 0 (scissors) Player wins
1 (paper) 2 (stone) AI wins

This simple logic can be used in most games with minor iterations. Below I have included code snippets for random number generation in several different scripting languages so that you can copy and paste refer to it when needed. All it does is generates a pseudo random number between 0 to 2 with time seed. Happy coding!



int main()
    srand((unsigned)time(0)); //srand() only needs to call once
    int result;
    result = rand()%3; //this will generate a number between 0 to 2
   return 0;

Unity script:

var result : int = Random.Range(0, 2);

Action script:

function randRange(min:Number, max:Number):Number
    var randomNum:Number = Math.floor(Math.random() * (max - min + 1)) + min;
    return randomNum;
var result:Number = randRange(0, 2);


random.randint(1, 2)

Lastly, please allow me to share with you a comic about random numbers, illustrated by Scott Adams.