Posts

MonoDevelop plugin

After a lot of researching I finally managed to write a plugin for MonoDevelop the right way.  You will find the source in the link below. The plugin does the following functions 1) Checkout from perforce using command 2) Fix line endings - Extra space added in a file due to line ending issues between windows and unix. Hope you like it. https://drive.google.com/file/d/0B_8vwjDBEtcqMjU5Wmg1X2FsSHc/view?usp=sharing

Why are iPhones so expensive?

Check out this link. It is beautifully detailed and makes a lot of sense. http://www.techarp.com/showarticle.aspx?artno=831

Null Object Pattern

Want to avoid the crazy if conditions in your application and ensure that it does not crash and yet provide a good logging mechanism? Use the Null Object Pattern. You will end up writing in more classes but it will help you make a good stable app. Imagine you are trying to find something in a hierarchy; lets say a game object. Lets say the method used to find this gameobject is FindGameObject("Avatar") which returns either null or a valid game object. You cannot guarantee that this method will always return a valid game object. So you end up adding a condition like this GameObject obj = FindGameObject("Avatar"); if(obj != null) Printf("Do something"); Imagine if the hierarchy is long and you end up nesting the conditions like this GameObject objRoot = FindGameObject("Avatar"); if(objRoot != null) GameObject objParent =objRoot.FindGameObject("AvatarMain"); if(objParent != null) GameObject objChild = objParent.FindGameObjec...

A good logging mechanism

Nostalgia: Sometimes I tend to feel nostalgic thinking about the phase of development for Nintendo Wii, 3DS, GameBoy and J2ME. Things are so different now. Mobile is the mantra. Every damn game has to be on the device. iOS, Google play, Amazon, Windows and what not. After all, it is the bread and butter for most gaming companies. Realization: What is scary is the competition and the need to develop and roll out something quick. The speed of development has increased, thanks to amazing game engines like Unity. So, we had rolled out so many games for different platforms very quick; the scale of the games became bigger and bigger and we realized we were missing one crucial element in the framework. A good logging mechanism. Situation : QA reports a crash issue.The log uploaded is clean. Development team concludes that its not the game and most probably a crash due to low memory. Issue is marked as good to go and a release is done. Users playing the game start complai...

Code dependencies

Are you struggling to make a given set of scripts from a project compile error free? If that is true, then you are in the same boat as I am right now. I have come across projects where logic is scattered around to get a functionality out of the pipeline with limited value to object oriented programming, and the most valuable and time saving of all is the plugin architecture. This is as best as it can get. Let me explain.. A producer has an idea and wants to make a quick prototype. He opens a new project, drags and drops the packages he needs and boom the game runs. Obviously you don't expect a producer to code (unless he is from development). The game would not be perfect, but at least it would get the ball rolling and you don't need a developer to assist the producer. Now, to do this, you would want the packages to follow a common rule. You can do this using an interface and have classes implement them. For example, the avatar package and the pet package can implement the...

Meetings reduce productivity

Image
A meeting because of some idiot not having the brains!!! Not all, but some.

Simple Prediction System

Suppose you have an incoming packet which has velocity, position and rotation details with it then you could extrapolation using the velocity in this manner Vector3 pos = mPacket._Pos; Vector3 vel = mPacket._Velocity; float timeStamp = mPacket._TimeStamp; float timeDelta = (NetworkManager.CurrentTime - timeStamp) / 1000; Vector3 predictedPos = pos + (vel * timeDelta); newPosition = Vector3.Lerp(newPosition, predictedPos, 0.2f);

Authoritative Server - MMO

Latency, Authoritative Server, Lag Compensation, Course Correction, Packet Drops and Client Side Prediction. These are things you would worry about when attempting to build a MMO game. For companies where the delay matters these logics are a must. This post is on setting up an Authoritative Server. There are different ways of setting up the authoritative server. Some of them is mentioned here. You have N clients and one client acts as the authoritative server: Imagine N clients with different machine configurations. The server would need to decide the best possible machine and have the physics simulation run in that. We then have issues with client disconnecting in which case we need to swap the authoritative client to another machine. This means we have to maintain all the state the game was in and move it to the new authoritative client. In an online environment this is simple nothing but nonsense. There is a dedicated server which simulates everything including physics and ...

Apple - What is wrong with you?

Image
Seriously! what the heck is wrong with Apple? Its fighting over a rectangle and rounded rectangle? Why is it battling out on the shape of a product? I mean rectangle - isn't this universal to everyone? What is wrong with someone imitating it? It’s not that they developed a technology that would make the phone invisible. Anyways I feel it’s a bigger gamble than the size or shape of the product. It’s all to do with money and sales. For every one apple product there are three android products sold. This means there is more non-apple phones and operating systems out there. Honestly Google and other companies are benefitting a lot more than Apple. Apple has the pressure and it looks like if they don't do something it would be the doom very soon. Recently Apple won it's battle over Samsung, and what is even surprising is Apple is Samsung's biggest customer. It really commendable that these technology giants are able to keep relationships together and yet battl...

Unity3D 4 Game Engine - New GUI

Image
We all know that Unity3D is an amazing game engine. We also know that its existing GUI system sucks. However Unity 4 promises to resolve this issue by introducing an all new GUI system. Yes! Finally we can breathe easy and gain those frame rates we struggle with on the mobile devices. The following link gives a demonstration of this new GUI system. http://blogs.unity3d.com/2012/06/29/the-new-gui/ . It is however not clear when it shall be available to the end user. It is also not clear whether they would completely eliminate the OnGUI calls or retain them for backward compatibility. Sometimes I feel Unity has been unfair in setting its priorities right. Honestly, optimizing the GUI system should have been their first priority and its sad that they had to wait so long to address this.  Anyways the good news is they have finally heard us. I wish they had acted earlier and I could have saved loads of time figuring out ways to get to a descent FPS with the existing GUI o...

Game Analytics

Image
I have been wanting to move from our custom logging process to an analytics tool specific to gaming for quiet sometime now. The main reason being maintenance and interpretation of the data. After some research looks like Playtomic is the only game analytics tool that gives more than you can ask for. I played around with other tools but nothing so interesting. Lumos for example is new and has a long way to go and most of them use google analytics to get their job done. What we need was much more than that. Heatmaps supported by Playtomic is simply awesome. Who would not want it. I am surprised nobody else thought of it; maybe because it seemed more of an overhead than a good feature to have.   Unfortunately it also looks like Playtomic is dangling right now. It claims to be recording several billion events a day and for that amount and the price I wonder how they are able to sustain. A good product like this should never end. I hope they continue their support and I hope they ...

Interpolation, Extrapolation - My life is still moving around...

Image
I needed a good interpolation system for my cars in the mmo world. I tried a few in the internet but nothing served its purpose. The logic used server time and current network time to figure out how old the packets were to based on which it would interpolate or extrapolate or simply snap. For most part the logic worked fine and so I don't blame all the wonderful articles I found in the internet. The problem I had was lag, frequent snapping, and sometimes slow and quick acceleration of the car. There wasn't a smooth movement. It would move smooth as long as the packets arrived fine and once they delay it would begin doing all crazy things. After dumping all logs it was evident that the problem was with the packets arriving very late. This is because over the wire through UDP there were lots of packets being dropped. This means on a high speed racing game where I collect and do a lot of things I definitely have a great deal of this loss and this magnifies where there are mo...

Smarfox 2x Compression Error

The smartfox 2x compression error has now been resolved. Very soon there shall be a patch released with the fix. Phew! finally some relief and the 2X server will now continue rocking!

SmartfoxServer 2X

The compression error in SmartFox 2x is probably due to the client side getting choked with a lot of incoming messages. The only solution as of now is to limit how much a client processes incoming messages. The client sends data to the server, the server maintains a queue of information and on a periodic interval keeps dispatching this data. This way we can control how much data is processed by the client. Though it looks like a smart fox issue, the solution above is temporary, but should work.

Unity 4

Unity 4 features comes with load of new stuff. Its good, but coming up with something that would re-write the GUI system would just be a blow to most of the companies out there who have all their projects working around it.