Posts

NSArray, NSNumber, NSValue... What is 'NS'? What is 'IB'?

In Objective-C, NS stands for NeXTSTEP , the platform for which these classes of the Foundation Framework were originally designed. While it helps, but I like it when it is Number instead of NSNumber , and Array instead of NSArray .  Similarly, IB in IBOutlet and IBAction stands for Interface Builder which is the tool used for designing the user interface of your apps. The interface builder file has the extension .xib (originally .nib) NeXTStep was an object oriented operating system based on UNIX. Remember the story of Steve Jobs getting sacked from Apple, and then founding NeXT and then folks in Apple begging him to come back? Just makes you wonder how amazing Steve was. Something developed in the 1980s to 1990s becomes the building block for most of the apps built on iOS and OSX today. Simply brilliant!

Sentinel Value

In computer  programming , a  sentinel  value (also referred to as a flag value, trip value, rogue value, signal value, or dummy data) is a special value in the context of an algorithm which uses its presence as a condition of termination, typically in a loop or recursive algorithm. More info on the same here  https://en.wikipedia.org/wiki/Sentinel_value In Objective-C it looks something like this where 'nil' is the sentinel. NSArray *arrayElements = [ NSArray arrayWithObjects : @"One" , @"Two" , @"Three" , @"Four" , nil ];

JackOfAllThreads - First attempt

Image
My first attempt at JackOfAllThreads I know this blog is not for this.. but hey! a little marketing for my campaign does not hurt. You like it? You can buy it by clicking on the link below. http://jackofallthreads.co/Look-at-me

CISC vs RISC

Image
One of the best explanations on these two architectures.

Visual studio code

It would be nice to have visual studio on OSX too.. so here it is. https://code.visualstudio.com/  

Objective C on windows. OMG!!

So much to compile and run Objective C on windows?? http://www.gnustep.org/windows/installer.html But if you still want to go ahead then.. http://sweettutos.com/2012/08/11/objective-c-on-windows-yes-you-can/

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...