Player count , the holy grail of all Multiplayer online matches for Turn-based and Realtime Games has a few gotcha’s when it comes to Google Game Services ( GPG ) and Apple Game Center.
Before we go into details , some abbreviations i cooked up to make it cleaner to read 😉
GPG – GooglePlayGame Services GC – Game Center TB – Turnbased Match RT – Realtime Match minPlayers – the minimum player count to kickstart a match maxPlayers – the maximum players allowed for a match API – just a sample , please see the GPG and GC documentation online
As you can see the two API’s from Google and Apple do the same thing but can actually trip you if not careful!! The problem is that if you pass in for example
// one on one match for GPG would work fine for the same call
CreateMatch(1,1);// minPlayers = 1 & maxPlayers = 1 , for Game Center , WONT WORK
You are in for a treat..
GPG would go ahead and create a 2 player match ( does not count you ) , while Game Center would silently fail ( you cant play with yourself naughty boy , we control everything 😀 ) or in our case saw the matchmaker dialog do a fancy appear and hide . I was in for a surprise because i had experience creating TB and RT matches for GPG but GC was my first attempt.
So the right way for a 2 player match for GC would be
// One on One match for GC
CreateMatch(2,2);// minPlayers=2 and maxPlayer=2 for Game Center , WORKS
Spent several hours trying to figure out what was going on and turned out to be the player count dilemma that the 2 API’s have . Not sure who is correct , but surely can trip you.
p.s: There are other API’s in GC that fetch the players in a game excluding current player. Be wary of them too ;).
Hope this post helps the brave souls getting into Multiplayer using Google Play or Game Center services.
The title has nothing to do with Unity 5 as a whole but for the fact that Unity 5 no more supports Beast Lightmapping :-/ .
What does this mean ?
Imagine upgrading a project created in Unity 4.x using beast lightmapping and happily running on devices ( yeah runs very smooth compared to the new hard to understand and crazy baking time of GI voodoo magic in Unity 5 ) . Now that you have that imagined ( you might have such projects :p ) , add say around 50 scenes to the project.
Following are the observations :
First thing that you notice when you upgrade is that the lightmapping for your scenes are no longer read. Everything looks horrible as there no more shadows in your scenes.
You think, hey that’s ok… let me hit the bake button real quick ( only to find that you have no clue where it is .. aha after some search Window-> Lighting ) . A window with lots of controls pops up in your face ( not being new to Global illumination and Final gather knowing a fair bit of Maya ) with whole plethora of controls.
Easy peasy , just hit the bake button . So it begins … you stare at the monitor expecting it to be done ( go take a leak and come back ) , but its still going on and on… Finally its done ! As the results are dark patches and what not everywhere. That just means you need to tweak the setting
Now for the crazy part.
If each scene takes say around 10 mins ( which it did not !! ) and we have an average of 50 scenes ( in my case ) . I would be spending 10 x 50 = 500 mins =~ 9hours of my life doing lightmapping :O !!
Screw the whole thing.. Delete the project ( Yes you cant go back after you upgraded the project ), Do a fresh checkout and continue with your work ( started downloading Unity 4.6.5 which is 1.7 gb !! There is something called patch update right ? ) .
Deadlines to catch ? Hell ya !! Stay away from Unity 5 for existing projects ( Also to the fact that lot of great assets are not compatible with Unity 5 ) .
Love the new Google Play Services (GPG ) plugin ( has a few bugs , but liveable ) for Unity3D . Has the following features:
Login to Game Services on both iOS and Android
TurnBased and Realtime Multiplayer support
Achievements and Leaderboards
Latest release supports quests and gifts too ( have not tried while writing this post)
Works well on Android without any issues, not that it does not work on iOS. The really sad part is the Apple Rejection process for App’s using the GPG plugin reason being it opens Safari to login the user into G+ services.
Lot of workaround mentioned on forums , the new one being creating a custom webview for your app . ( more here ) . Don’t have a lot of patience doing all this and getting rejected for the second time. Saying bye to GPG on iOS for now . GameCenter for Unity3D is another tough cookie to crack , but better than getting bluntly rejected by Apple …
Unity 3D is a powerful engine but can get hard to maintain on your local machine. ( A small game can easily run into a gb or more of data ) . The best solution would be to check it into a revision system. yay ! Simple !! ( Bazinga !! , no it aint simple ) .
The whole of Unity project is made of lot of binary files and we all know while we can checkin the files into git ( yes thats what I love to use ) , it can get nearly impossible to diff between 2 revisions. So what do we do now ?
Welcome the .meta files
Meta files convert or rather keep all the important data related to your prefabs, scenes etc in the form of text files. This helps the process of maintaining it on git easy ( easy to diff , see the idea ? ) .
Some changes to your projects needed.
Go to Edit -> Project Settings -> Editor , launches Editor Settings dialog and make changes as shown.
SourceTree application maintained by bitbucket that provides a visual tool for git ( aah the bliss )
Free for upto 5 members ( have a bigger team ? easy to upgrade )
Has a wiki and bug tracker part of repo ( wow ! )
Get checkin mails
Use it to create builds on Unity Cloud
Some roadblocks ahead !!
Though we have a repo and meta file issues sorted out , the biggest concern is the gazillion files that Unity generates for your project. They are need only to make your project work faster ( the Library folder for example with its huuuuuge cache ). We dont wanna check that in do we ?
.ignore file to the rescue. git allows the creation of a file called ( .ignore ) which allows one to mention what should not go into a project.
Checkin this file and you are all set. You now have a lean mean project folder that gets checked in to git.
Install SourceTree , clone your repo , RTFM and have a peaceful life with all your code backed up safe !
When Android Gingerbread ( 2.3 ) was launched and to the fact that got my hands on HTC Desire HD ( a phone on steroids back then ) …
Organize life ( have smart phone damn it! )
I decided to organise my life with a todo manager that would be fast , remind me with alerts on what i needed to do and when. Searched Google Play Store , installed a bunch of them and all came short of my expectation. Like all geeks, I decided to write my own .
Was it a good idea ?
Was not sure when I started… Installed Eclipse , re-learnt Java , installed Android SDK ( still remember it had a crazy bug which would not allow one to install correctly if you were not an administrator , some permission issues ). Learnt a hell lot about Android and its crazy xml based UI ( still gives me creeps , it would just crash on u giving some random dump) .
Spent several months learning and hacking away at the code running it on device, showing it to my friends ( my wife felt I had to name the App after her )
Klick Todo was born ( Initially was named KTodo , K being first letter from my wife’s name ) . Became decent enough hit with fan mails asking for features ( some real hate mails too when design was changed ) .
Later got into lot of gamedev projects and felt I needed categories ( as I told earlier wrote the app for my own consumption ) and Launched KlickTodoX which has a side bar etc.. pretty limited but works for my gamedev work :D.
Was it worth it ? ( i hardly made any money out of it )
Every bit of it. Gave me great confidence that I could write a full fledged App on my own and do the design frameworks, UX , marketing ( showing/writing to whoever had a smartphone those days 😛 ) and what not.
One thing lead to another and started doing freelance work for games and Apps… Was fun and if time permits would like to create a few more 😉 .
First thing when you start writing games using Gamecenter for iOS platform ( Sadly Apple bluntly rejects all the apps that make use of Google Game Services ) is the sandbox mode for testing your leaderboards,achievements etc…
Several posts on forums and blogs talk about creating a testing account and doing crazy voodoo stuff to get into sandbox mode. Read all that for a while and the ever increasing frustration writing games for the iOS platform was @#$@#$ ..
And yeah, finally went to the Apple site ( a plain and hard to read page which has no styling what so ever to make life harder ) , found out it was easy !
So here are the steps:
Uninstall your development build on iOS device
Go to Settings -> GameCenter and log out of your exiting account ( click on the email-id and a popup will appear to logout )
A small slider below show “sandbox” , enable that !
DONOT login on the settings tab , instead install your development app and login through it when asked for authentication using your normal Apple account ( the one you use for buying apps will do just fine )
We are doing some house cleaning and realized we needed to move things around a bit :). As a good start we are pushing all the old content ( close to obsolete in today’s context) to git.
Find the links to all the scripts and projects related to Adobe Shockwave 3D in a separate post.
We also plan to make some changes to the content we post and mostly talk about game development in general ( our experiences planning and building game for Android and iOS platforms ). See some detailed posts on the same soon.
Its been close to 8 years and counting for Coderecipe ! Thats something cool too 😉 . Hang around and follow us on twitter and facebook .