Big Bad Robots is an indie game developer but we also do contract development. We have developed on all kinds of platforms (PC,Handheld,Consoles) but now primarily focus on iOS,Android and Unity. Contact us if you looking for developers with over 20 years experience in software and game development at biz -at- bigbadrobots.com

Tips on Unity3D (Top 10) I

April 3, 2011terence

I have been using Unity for a while and just my my sake I wanted to compile a list of Do’s and Don’ts that will save you a lot of time (or if you are like me stop from going Doh! and hitting your forehead a few hours later).

1. Importing from Blender to Unity. Make sure you set the import to calculate your normals again. At least in Blender 2.56a the exports product models with extremely dark Textures. So unless you want environments in your game to be a homage to 2001 Space Odyssey.

2. Work in 1 language, if possible work in C#. I know Javascript is there for web-heads and people like Javascript but it’s like giving a loaded gun to a child. Results can be un-pleasent. I have read that C# is faster somewhere but they all get compiled down to the same bytecode. The biggest reason is Javascript can include C# components but not vice-versa I suspect because of different compilation and linking times (well unless you move your javascript somewhere special). Also C# can be compiled to DLL’s. And finally coding in 1 language helps you stay good with the syntax. No fun at 2:00pm wondering your script won’t work.

3.Never use gravity a local variable name. In fact make sure if the editor highlight any variables that you aren’t using as a public or private variable. Bad things happen.

4. Always print out the gameobject you are acting against if you can’t find the components on it. I was trying to figure out why my projectiles wasn’t able to SendMessages or access components on a gameobject. The Tag was right. Made a fool of myself on Unity answers.

5. You CAN attach multiple scripts to a player. You can attach it to colliders on the bones that are hidden ONLY if you drag it to the scene and inspect it there. It won’t show up on the prefab.

6. Use the 80/20 rule of networking (well my 80/20 rule anyways)..If you think or findout that 80 percent of the time the variable needs to be updated, use state updates to do it versus RPC’s. I haven’t done a benchmark on Unity3D RPC’s but in my past experience with newtork coding RPC are slow, not timely and fat on network bandwidth. Easy to use again, but not to often.

7. Put something in your script name to help you find where it is. When inspecting a game object you can find scripts attached but have to hunt for the scripts. Putting all the scripts in 1 place and for me starting with a Prefix is a must. For example call player code ‘PlayerInputController’ and put it under a player folder in scripts. Good for you and good for any programmers that follow

8. Understand the code your write (or copy). There are alot of helpful scripts but the need to complete a project will drive you to cut and paste code. Soon you will have jumble of unoptimized code and if you don’t understand it a nightmare just waiting to happen.

9. The inspector can be useful to debug your game. If you select it during gameplay, you can check out public variables. It’s a quick and dirty way to do debugging rather then setting breakpoints which I haven’t done yet because it’s a pain to switch to the MonoDevelop (which is buggy, the scroll bars don’t respond to my mouse wheel and the folder ‘lock up’ so I can open it to click on scripts).

10. Beer and code don’t mix unless you have to re-write some particularly painful code. ;P

Announcing “Wendy’s Weddings”….

March 26, 2011terence

We got our first concept art today from Ivan, an artist we are working with on Wendy’s Weddings, a wedding themed casual title. He does some nice work as you can see with his first pass at some concept on some of Wendy and her little sister Molly.

You can take a look at more of his stuff at synergylab.com.my. We are still working on the characters so the are by no means final. Running comments on Wendy being a little too bossy looking have been noted and we are working on making her more fashionable and friendly.

The game revolves around helping Wendy build her Wedding Business and is being developed with assistance from Pretty In White. We have only been developing the game for about 2 weeks in total, but the basic gameplay is there and we are finishing off the Game Design documents before moving fully into production. Jordan from Zombie Gecko is helping with the Game Design. Still pretty early but the design and gameplay look exciting and we talk more about it in the future.

Our target is primarily on iOS and Mac as we are using the Cocos2D game framework. I have written in the past how I built a ‘component’ based system around this framework.

I know my 3 sisters and 2 nieces will be so happy I am finally making a game they will like to play. Maybe I can sneak in alien secret character;P

Unity3D networking Part 2, Making connections

March 18, 2011terence

This post is a follow up to my first one which gives you some concepts on working with networking. In this post, I will cover getting an a client/server connection going which is the first thing you have to do in building a multiplayer game. Your first point of reference is to make sure you are familiar with the Unity3D Network class which provide most the functionality you need to manage an initial network session.

I would like to cover some Unity3D specific topics on how networking is handled. Unity uses a Network View Component that is attached to every game object who’s state you want to synchronize with. It also allows you to send messages directly to those objects because each one is issued a network ID. The following picture should make things clearer:

Let’s also cover the ‘responsibilities’ in networking between the Client and Server.

  • The Server’s primary responsibility is managing the network session and propagating/validating state changes to connecting clients. It is also responsible for control of non-player game objects(i.e. enemies) by creating them when needed, running the AI routines which tell them to move. There are 2 modes that the server can operate under, authoritative and non. Authoritative servers have more work because they have to validate state changes from the client rather than merely passing it along to other clients. This is usually a slower way to operate as each move, action needs to be checked. If found to be invalid then the client that sent this original state changes need to be ‘brought in line’ with the way the server is thinking. A non-authoritative server on the other hand is more of a delivery person who simply relies information over to connected clients
  • The Client is responsible for the view of the world a player sees and for receiving input and forwarding it over to the server. In a non-authoritative mode, the client can also process game logic (i.e. decrease health, move  the player, move other objects) and these are sent to the server to be relayed to the other clients.

Most of the information from this posting are taken from the Unity iPhone multiplayer and the Unity Networking Example.

The first step in getting a network session up and running is initialize a server, which should be done when a level in the game loads up. This is done using the method on the Network class called “IntializeServer“. The first parameter is the number of connections to take. The second the listening port for the server, which is used by the clients to determine which application to connect on the server (as a server may be running multiple network applications). The last parameter if Network Address Translation should be used or not. All these except for the number of connections should be eventually made user configurable when you are writing your game.

Once the server is running, clients can connect using the Network.Connect method. The most important parameters for now is the ip address of the server and the remote port(which was the listening port specified earlier when the server was initialized).

That’s pretty much all there is for setting up a session. Be sure to check the Network class for more information on how to handle disconnects and network failures.

Unity3D networking Part 1, concepts

March 11, 2011terence

I have set about learning about networking on Unity3D in order to implement multiplayer support for Zombie Gecko’s Comrade In Arms. I have a fair amount of experience with networking, having first cut my teeth writing real-time transactional system allowing Unix hosts to update banking details to a IBM Mainframe using XNA, then working on early Internet credit card authorizations system and finally developing the server/networking code for Fung Wan Online MMOG. Well enough about me ;P

Unity3D uses RakNet for standard networking and who ever is implementing things will have a lot of plumbing to take care of inorder to get things working. Unity uses a “Networking View” component which must be attached to all objects which in turn Network State Synchronization  and Remote Procedure Calls(RPC’s) to occur. You can set specific spatial components to be observed by a network view but usually you will implement a script that will pre/post process network information sent. This was something I missed  when I first started out tinkering with networking on Unity

Let’s go back a bit and talk about the 2 different methods of communicating in Unity:

  • State synchronization – this is basically a method of  setting the network view to observe a script component that processes changes in states that can be sent to the server which in turn are transmitted to all listening clients.
  • Remote Procedure Calls – This is a common enough networking concept that allows you send invoke functions on the server or all clients with parameters being passed.

You can do some additional reading on networking by looking up the following resource:

In a follow up posting, I will go through making connections,extrapolation,interpolation and hooking RigidBody objects.

Components, Draw Calls and performance….

March 8, 2011terence

Although an component system is the basis for most modern game engines and considered as the better(if not the best) way to put together a game. One of the biggest drawbacks is that when you create an architecture that is modular  and loosely coupled, you introduce performance overheads.

On PC and other higher end devices, the tradeoff is smaller in exchange for elegancy of design and implementation. On the iPhone, especially older ones you have to to be care about how to implement things. The most common discussion on most game dev sites on the iphone is to watch your draw calls. On older 3G devices, 20-30 is a bandied around number…well that obviously and how many polys you are using plus if your code is running native or script…where is all this leading too….Ah yes the component system I was building on top of Cocos2D.

Here are some of potential performance overheads I ran into while implement it:

  • One of design limitation you have to work on cocos2d uses a SpriteBatchNode to allow ‘sprites’ using the same texture to be drawn in a single draw. In a component system, everything is based around composition which means there is a lightweight ‘entity’ class with ‘components’ attached to it. So 1 entity = 1 draw call at the very minimum. With the older 3G devices, you are restricted to 25-30 draw calls (as a rule of thumb that is float on the Internet).
  • Sharing of properties between components. While I have allowed the position property to be stored on the entity itself, other functionality specific properties aren’t. In order to do so you will have to either incur a dictionary look up (i.e. component foo = entity.lookupComponentByName(Bar)). Or you could directly link it up be assigning it to a pointer. Doing that however breaks a design principle of trying to make components loosely coupled for modularity
  • Inter component communications. Besides directly looking up a component, a better way to talk to between components is to use ‘events’. For my component system, I built a addEventListerner,dispatchEventListener system similar to what Flash has. Like all events though everything is unidirectional and has a limited data payload of a single object.

In conclusion, I think for most of the newer games going  with component system makes sense because once you get started you will be amazed at how everything clicks into place. If you are writing some more performance intensive, you will find components losing some of its appeal.

Honor and Mac…

February 27, 2011terence

I just started porting Honor and Money to the Mac yesterday. Having not used Torque for almost a year, there have been tons of WTF moments trying to get the it working. Initially I wanted to do a straight port, but I figure I should also fix a lot problems while adding a few more features:

  • Potential for Multi-player support. Right now the codebase makes many single player assumptions. I need to re-thinking and rework some of the scripts and engine code to make it ‘work’ again with networking support
  • Move save system to something better the script files, probably sqlite.
  • Cleanup the script. While I will never be free of it, much of the scripts have alot of junk in it. Same with the assets
  • Migrate from 1.4 to 1.5.2 Torque Game Engine. I’m not even thinking of getting it on iOS at all, well unless people ask for it and it makes sense business wise. It’s a old engine, but the game itself has great art and graphics so shouldn’t need to do much but find a high quality splash screen logo;P

Working with Honor and Money has given me flashbacks on how Garage Games killed their own goose though but releasing multiple engine versions on the same platform. There was seldom an upgrade path(or it had a lot of fine print) and the convenient excuse of ‘You have source’ doesn’t go well while plowing through the code. A Game Engine is a cumbersome beasty even if you have written yourself already.I tried using Torque Game Engine Advanced, the Advance Engine they promised to develop for the longest time then they dropped it and started selling Torque3D which was their ‘new engine’. That was the last straw for me. I am sure they comforted themselves by saying that other people shipped stuff before on it which is OK if you can get support rather than step trace debugging through code to try to understand it.

Enough with the ranting…Here is the moment of Zen…1 level loaded…working but horrible hacked camera….

To Components with Cocos2D with love…

February 21, 2011terence

Components are being used in most modern game engines. My favorite (because of it makes sense to me is the PushButton Game Framework). I like the design behind it. So when faced with developing a game using Cocos2D, I tried figuring out how to approach it architecturally.

Cocos2D is a fairly mature framework and you might as why put something on top of that. I had the choice between choosing a Model View Controller Architecture and a Component (Composition Approach). I chose Components easily. I’ve only been working with the framework for a few days but I have already got that “wow” that makes more sense now feeling.

For example, here is some code to add a entity with a sprite renderer:

_entity = [[BBREntity node] retain];
BBRImageRenderComponent *renderComponent = [BBRImageRenderComponent node];
[renderComponent loadImageFromFile:@"test_image.png"];
[_entity addComponent:renderComponent name:@"Render"];
_entity.position = ccp(100,100);
[self addChild:_entity];

And then here is how you add a touch component to it to make it do something when you click on it:

_entity = [[BBREntity node] retain];
_entity.name = @"Entity 1";

BBRImageRenderComponent *renderComponent = [BBRImageRenderComponent node];
[renderComponent loadImageFromFile:@"test_image.png"];
[_entity addComponent:renderComponent name:@"Render"];

BBRTouchEntityComponent *touch = [BBRTouchEntityComponent node];
[_entity addComponent:touch name:@"touch"];

_entity.position = ccp(100,100);

[self addChild:_entity];

Simple huh. Each entity is added to the layer and that added to the scene. You can see the similarities to the PushButton Game Framework ;P

I have also implemented a way to add/remove/dispatch events inside of components plus a hash lookup system to manage entities.

Next on my list is to implement some audio components then I can start using it to build my game. Unfortunately no physics components yet because the game I am working on doesn’t need it.

Back to Game Development…Cocos2D…packaging games…

February 18, 2011terence

After a fair brief stint of working on a Native Objective C App (A Non-Game…Shock and Horror), I am finally back to working on games. The 2 or so months I spent ‘learning’ Objective C was actually a nice break from normal development and gave me a greater sense of confidence in being able to add/extend functionality when need to on  iOS devices. Prior to that I was very much looking at things purely from a C++ point of view and trying to ‘avoid’ using any Objective C.

The best big of strangeness was making sure I got my head wrapped around Objective C memory management. With C++ it was new/delete and life was easy or you could use Boost to smart ptrs and so on. With Objective C, I couldn’t figure out why my memory was going out of scope (Oh you do a retain), the way it handles private instance variables  and a hours of going “Oh that’s what you want me to do”.

Some cheesy fries with please

Now i’m back to Game Development, I am using Cocos2D for development. The biggest reason is to keep the footprint small because I am looking at how games instead of strictly always running stand alone can be packaged with other Non-Game Apps.

What I learnt from Last Call, is that there is just too many games out there on the iTunes. They are all fighting for space and customers simply don’t have the time to try them all. With this is mind (and being the new year and all), I thought a more prudent approach was to look at what customers are interested in first of all. You know real people, you want to reach with your games. For example interests such as food, fashion, cars, sports etc all need Apps done. With In-App purchase you could package a game with a clothing theme in a Fashion App.

Well that’s what I think anyways. I’ll let you know how this new company strategy when the Apps come out.

Designing an Achievement system for Last Call

October 16, 2010terence

After I got all the technical “bits” of Game Center working for the Leaderboard and Achievement System for Last Call, it came time to design an achievement system for the game. As soon as I started with it, I found out that it was a lot more complex then what I initially imagined.

From the technical standpoint, an achievement system gets into all parts of your code from the scoring system and level progression to the power-ups. It’s bewildering everywhere and QA testing it is going to be a bitch.

From the design standpoint, I can’t wrap my head around what other than ‘wow! I finished that” you get from an achievement system. Other games give you a virtual reward but right now I balancing out my potential rewards with what additional content I can scrape together (or beg borrow and steal). Here are some examples of some achievement I am thinking of implementing:

Story Mode:

  • Finish story mode
  • Clear 10,20,40,80 customers
  • Purchase all bar upgrades
  • Purchase all flair upgrades
  • Purchase all drink upgrades
  • 3FER 1,5,10,20,40,80 (3 same drinks in a row)
  • 4FER 1,5,10,20,40,80 (4 same drinks in a row)
  • 5FER 1,5,10,20,40,80 (5 same drinks in a row)
  • Money Achievement (200,400,800,1600,3200)
  • Flairless finish (Don’t use any special powerups)


  • Time achievements (1 minutes, 2 minutes, 5 minutest 8 minutes, 10 minutes, 30 minutes, 60 minutes)
  • Play X minutes without losing a customer (30 seconds, 60 seconds, 2 minutes, 4 minutes)

There are a mind-boggling more that I could implement. Yikes! There must be a dancing monkey in this some where.

Indie Game Development Life…

October 6, 2010terence

Game development is a lot of work, more so if you are the designer, programmer and sometimes artist on your games. For now, I have 3 projects that are active at the moment and sometimes I wonder where I find the time to sleep. I try to make lists of things I would to accomplish and try to finish as many as possible but sometimes you can get too obsessed with one project and forget about the rest.

My week usually breaks down into:

  • Monday to Wednesdays – Work on the “main” project. Right now my main project is adding Game Center features to our game Last Call.
  • Thursday to Friday – Secondary project (usually the next game that we are working on). Right now mostly focused on “Adventure”, an online game creation system.
  • Saturday & Sunday – A break and research. Right research, design, prototyping of a HTML5 Game Engine and our next iPhone game. Also I do some marketing, write some blogs or do some reading.

My day usually start around 7:00-8:00 or so. I try to go out for a walk/run in the morning, back by 9:00. Then it’s work until Lunch and a game. Work till Dinner…watch some TV until about 7 or 8 and then working till 11 or 12. There are off days and days where I take a break and try to do something else but that pretty much the routine. I also try to ‘work outside’ at Starbuck once or twice a week to see other people.

Have a productive day eh! Hmmm..that reminds me I forgot update my own blog…

« Newer PostsOlder Posts »