Saturday, June 7, 2014

Project "You Are A CEO"

It's my first project to do native integration. Have you played Mafia Wars ?  Its a point and click RPG. And mix this game with a little modern farmville. And what product you get out of it polish it and integrate this with android ios and web. That's my project. Its called "You Are A CEO".
       
                                               
                                And my part in this project was to make a "Estate" where the person can see his assets. Can see what level he has reached. And there are some perks which get unlocked when he gradually progress in game.
      A 2D isometric game scene, where the user can place the buildings. It's my first very successful attempt for a 2D isometric scene. Here are few steps I would like to share:
  • Use Orthographic camera projection. And make sure you have all the building assets as a 2D art(.PNG). Yeha! one more point make sure this art is created considering the isometric projection. If you get a good artist around you he will be aware of that. And what next ? 
  • As there is no depth of field. You have to use sorting order for overlapping. And yeah for rendering those building sprites use a Sprite Renderer component.   
  • And how are we suppose to detect the user touch/click ? We use a box collider which covers whole of the sprite and the sprite object is the child of the box collider object. See the picture. 

                             
Box Collider in the empty gameobject for User input detection




Sprite Renderer component in a child object of the parent. Note the rotation of the sprite.


  • Rotate the sprite accordingly. I rotated the sprite for 53 deg on y axis. Also rotate the camera 45, 45 on x, y axis.




After fixing up everything in place. The look of the game feels great. I coded some panning and pinch and zoom functions as well. So I can plan around the plain to see where I want my building to be placed. 


Now the user data will be coming from outside. (Web, IOS, Android) So I have to make a json script where I can save the information about user. I gone through forums researching about it. Got help from some of my friends as well. And here  I share my conclusion.

  • Json is a javascript object notion. Its a convention used to exchange data and its independent of the platform. In this project I was receiving json from android, ios and web. So I made a script which takes the json string as a parameter and parse it accordingly. 
  • I attach this script to one of the object, which will be called specifically from the Native end.
Lets see how I parse the Json string.  





  

  • Firstly, deserialize whole of the data. Use IDictionary data type for that. Always remember to deserialize the data in same order the elements in the json script are coming. 
  • Create a list for each element and add the data respectively. 
  • Here by, you can start the constructors to load the user information and his buildings , unlockables, accordingly. 
                                                      There is lot of other customization and optimization I've done. Due to shortage of time I can't put all the stuff here. Still if anyone have any questions ? Please shoot at pranavpaharia@gmail.com. Thanks Renuka for coordinating in the Web version of YAAC and Smriti and Saurav in IOS version and Harminder in Android version. 





Thursday, June 5, 2014

How to communicate with "Outer Game Elements"

Okay ! I've got my game running. Its showing Mr. lil' Ratcher jumping on the ledges. And shooting at enemies. Might be some chirping sound coming as well. But wait, I want to send a push notification on my phone/tablet so that I will be informed all time about my game happenings. So a good question comes to my mind !
         How do I communicate to device being inside Unity !
    Well. I looked out for it. And found some decent answers satisfying my queries. We do "NATIVE CALLING" inside Unity. You can see them as a event triggers. Yeah you can send these triggers to the platform on which Unity is running like IOS, Windows, Android , etc. Okay. Don't be impatient. Let me share a screenshot with you where i'm declaring all the functions related to native calling. They are written under device dependent condition. 


































Here its how i'm testing my native call to the device. I took a reference of the "nativecall" script and called the TestConnection function with the default parameter. 



Hence you can call the respective native side according to the parameters your have sent from Unity. And yeah Voila ! We did it ! :D 

Thursday, April 17, 2014

Cast it. Express it. VOTE

Last time when I was doing enquiry on the voters and how politicians are winning the elections I was brought down to the site of election commision of India. They used a term called "Voter Turn Outto calculate the effectiveness of voting in certain region. 
I was surprised to see the data. Most of the states have around 50% Voter Turn Out. After reviewing the details I had to admit the fact that India is still a developing country. Most of the people doesn't know the importance of their duty.  Let me explain this fact in a small scale


Let we have a 15 people community. Out of 15 only 10 are eligible to vote. And the voter turn out of the region comes 50% ie:- Only 50% of the eligible voters actually voted on the occasion. So here in this case out of 10 only 5 voted. So gradually a candidate has to get a majority of 3 people out of 5 to win the elections. If you see the whole story, that particular candidate won the elections and get to rule over 15 people by just winning the elections with 3 people "

If you analysis the scenario I explained you above, its possible to see how a normal election candidate can rule over a crowd my merely getting support from 1/4 of the crowd.

                                                             Your vote matters ! Please Vote !


 If you ask me, I would say its the science of how to gain the confidence of people. Now practically its not necessary that the person (candidate) will choose only good methods to attract the crowd especially if he has to get just a small portion of people on his side, he would definitely try to lure them with corruption. And that's the current case in India. Most of the politicians are playing this strategy. 



Change the switch ? 

Most of the indians(general crowd) have mentality of no change from inside. They seek the change outside. Hence the forces consisting these people have the "Ride Control" automated. And hence they are dictated by the politicians generally. But now I can say the time is different ! How ? Because, this time most of the Indian population consist a large portion of Youth(who are eligible to vote). And this youth can practically change the direction of India's political affairs. The elections which are currently going on will play a significant role in Indian Political history. 

As a individual I feel, we should vote even if the guy we vote doesn't win. Because it teaches us to follow our duty. We can always learn from our mistakes ! Its never late to learn from them no matter what our age is. And take care of spreading news to your friends and group about it. Broadcast the information , Use social media and participate in the process of selection of government. Don't let those uneducated Junkies hold grip over your country. Because its your country also after all ! 







What I love ...

I love nature. I love the diversity in it. I love passion for whatsoever it is. I love humanity. It doesn't matter to me how hard is something untill I have WILL to achieve it. I like creativity. It leads to thinking of subjects both rationally and irrationally. I have patience to watch a person getting close to me as a friend or getting away as an enemy. I would be the same  uneffected by karma. I love animals because they make you realisetaht you dont need your voice to communicate with someone. You just need you and your company. I dont kill emotions. I generate them through my work. I'm passionate on making video games. And I make myself busy with them.  

Monday, April 7, 2014

He that cannot reason is a fool.....

He that cannot reason is a fool. He that will not is a bigot. He that dare not is a slave !    Andrew Carnegie




                       When you are brought up in this world, nobody ask you question about it. No tell you whats the reason you here. And generally people don't even ask themselves why they are here. You see it a vital ability of human to reason, to question about the change happening around himself. Although the rest of the things like your friends, your enjoyment time, your work period , etc everything will keep on going around you (Of course you gotta manage that but that's something seems to be in control. Ain't it ?) Because if someone ask you why are you in this world you might feel clueless, deprived and out of your mind. But that doesn't means that you shouldn't reason ! Reason is the right you got. The power of atorney ! You mind needs your consent over a reason to assimilate it and produce an outcome in response to it. If you fail to provide a right consent over some reason , the chances are you might feel very awkward when you are expose to that situation , and that's the only reason some people ran from very generally and vital concerns of human civilization !  
                    Our universe is very diverse. You search for a particular type , you will find similar traits in number of patterns. That's the opulence you see! Sometimes these opulences go beyond human comprehension. Let's suppose the ability "To Reason" is something not liked by some individual. What can we comment about this. We can't control anyone except us ! But yeah we must advise someone of whatsoever out heart speaks out and for someone else we can do this only !  But what if the individual's self has lost the interest in the realization of importance of reason. He might have looked the 'reason' the same way just like a hungry and lustfully man see a pretty girl. A purpose to exploit ! He gets immersed in the self ego so much that he has lost the power to discriminate something which is for his own benefit or to destroy him. That kind of person never admits what they do and neither they care for reason. They just care for their self- praise and false public impressions. Their intelligence shrinks so small that they get sunk in the well made by there own mental speculation. What you think who you can count on with that certificate ? Well it seems to be tough to find these people. But if you see with the eye of simplicity, you will find that a soul asking for a reason is not a impure and cruel but a divine soul, he is asking for reason not because he was told to do so. But he wanted to understand for himself. He wanted to know how he can communicate to it, how he can find a better world consisting of him and the reason he as acquired. Hence he walks on the path of truth. Hence the people who doesn't mind to walk on paths other than truth can be said the ones who don't reason. You can see them a lot in number still the foundation of their ideals is not strong enough that they can withstand the waves of time. They eventually perish. For the Time ! its never the quantity .. its always the quality. 
       As we know there are unlimited faces to see same point in this world. We can encounter a type of person who is not asking the reason because his will has not powered him to stand up and ask that question. That person although is struggling in his heart itself with this question, but unfortunately he doesn't get enough will power to conquer his fear engulfing the question. Technically you can call that person a slave ! Reason is that he has lost the inner state of power, to fight for the reasons his heart calls. And what more that person can prosper on ? His heart is cold with the inactions he has done towards it. He has surrender his soul to someone, or merely following the decision of his master, without his own conscience. 

    


Tuesday, April 1, 2014

Isometric Style in Unity

Going ahead, adding few more projects in the list. The new part with this project is its isometric view. Yeah, all the assets are 2D. And we are placing them such that they look 3D. Well.. what else isometric projection gives ?



Isometric projection gives you perfect view to watch your 2D animated sprite in motion and giving you illusion of 3D. 
        So what I did for that ? Pretty much nothing.. :P. Some protocol you have to follow. Firstly ! Change your camera projection to Orthographic projection and then rotate the camera on X Axis and Y Axis by 45 Deg. Hence you got your camera showing isometric projection. 
         Now how to place your art with it ? Well good question, let me tell you the requirements of my game. I wanted to make something like Farmville or Hayday. User can put the buildings where ever he wants and then he has to upgrade them for the resource production. As the building upgrades its visuals and animation also changes. Hence giving the illusion of game progression.
        Secondly generate the platform and find out the position on platfrom where the user has clicked and place the gameobject(building) on it. The gameobject has two parts. The renderer and the collider and they are having relationship of parent and child with respect to each other.  Please keep in mind that you have to rotate the sprite in the correct orientation as well. 
    Now as for moving the buildings along a grid make a snapper function which holds the position of gameobject in real numbers only i.e: (1,0,4) or (12,12,10). Hence all the decimal values will filter out.
     I will be using NGUI plugin for keeping interactive buttons and pop up displays. This is all for now. Will post the further progress later.     
    

Tuesday, March 25, 2014

What Motivates You ?

Motivation is necessary for everyone. Its the driving force, it empowers strength in oneself. It gives a reason for the action. If you account each person who has ever lived on this earth. You will find there were many prominent personalities which walked far far away from what a ordinary person could have thought.
       Man is given intelligence by nature, though it depends solely on him how he use it. Intelligence will lead him to climb high up the ladder. Intelligence can lead one to experience the higher self of him. And if a person wants to endure the path towards gaining intelligence for the welfare of himself and the world, the nature which had gifted him that intelligence, helps the person to develop love with the environment which is sustaining him. That form of act or thought is the highest motivation a man achieve. Then he just walks towards his goal, striving for success,  endeavouring with enthusiasm and content with the self. His heart roars! Chanting the glories of goodness, of morales, of courage, of justice. Hence filled with all these thoughts their heart becomes one with the 'Superior'. Superior is something which not human, but he is far more capable then a human, he sustain whole of the universe with merely a thought of his own. Here if you try you can comprehend the power of thought, you will realize its importance. Superior can listening to anything , can see through anything. He is all prevailing. Yet he is invisible and in-affected by all the laws of the world. In short he is a good guy who's is very mysterious to understand. He is so powerful that he can end whole of the universe in a moment, yet he express his love to the people who love him. He gives then understanding by which they can come to him. He ask nothing else but love, dedication, determination and  self control. And in returns he gives you experience of higher self.
        Well lets see whatever great personalities you meet in your life or the one whom you talk about.

Henry Ford
      He was more interested in telling people the solutions to the problems he has encountered rather than moving around the problems. He called work is worship and insisted on keeping oneself busy with his work. You see he was trying to focus on oneself. Rather than asking people to know things around you.

Nikola Tesla
   One of the most humblest, respectful, intelligent personalities of the world. He contributed in most prominent discoveries of mordern science. He said ones "If the people of the world concentrate on the non physical phenomena they will do more improvement in a decade than they did in a century. " Meaning, he was acknowledge by the fact that there is more in the world to see, and accounts the non physical phenomenon like which are unable to understand but still you can experience. He didnt meant to keep an eye on your neighbour and his activities. He asked us to improve the overall quality of yourself and accept that you know nothing more than what you ought to know. Have a clear vision of your thoughts and be broad minded.

Swami Vivekananda
He was one of the most prominent personalities of India at the time, when it was ruled by britishers. He was a scholar who spread the value of education and emphasize on indian education/ its methods / practice. He helped much of the indian youth by giving them motivation, by enlightening them with a purpose of living. He said "Dare to be free, dare to go as far as your thought leads, and dare to carry that out in your life." You see even he emphasize on the thought process of oneself. And also he insist on the action of your thoughts. Because without actions you cant see the strength of truth inside you.
                   Trust me, the examples like these are endless. Once you acknowledge yourself about your ambitions and about the thoughts you want to pursue. You wont be caring of much what is going around. You will be concerned on what is going on inside you. And that's just the starting my friend. The real show is only viewed by the one who is actually watching it ! And he says it awesome , daring and challenging.