Better Debugging Android Unity Games When Deployed

There is something called the logcat, which is a combined message pipe from all applications. To read it you first need to locate the adb tool that comes with the Android SDK. Depending on which version you have of the SDK the adb is located either under <sdk>/tools or<sdk>/platform-tools.

Simply start it like this:

$ adb logcat

and it will start printing out everything that is going on on the device. To limit it to only show the output from inside Unity, you can try this:

$ adb logcat -s Unity

or, to get a little bit more info about what’s going on:

$ adb logcat -s Unity ActivityManager PackageManager dalvikvm DEBUG

If you wish to report a bug or otherwise ‘quote’ the logcat, you can dump the complete logcat to a file like this:

$ adb logcat -d > logcat.txt

My thoughts on Corona SDK vs. Unity 3D

corona vs unity

I’m using Corona SDK for my current project, Super Hungry Monsters for about  8 months now and 3.5 months of it was with Unity 3D. I wanted to give this as one of my workshops/speeches at Tehran Game Festival 2013 but I thought I can summarize it here and will help people Googling more than people attending such event in Iran. So without further due, here are my thoughts comparing these two engines/sdk’s for making games, mostly mobile 2D.

Some notes:

  • These are just my thoughts based on my experience, and would love to get them corrected on any of the matters I’ll inspect.
  • I try to be unbiased as possible and I think I will because I’m not 100% happy with either of products in the question here.
  • My experience is from Unity is from their version 3.5-ish.

So here are my thoughts on where Unity is better than Corona:

1- The package.

When I was working with Unity, I was working with a great level editor and had almost all the great things that a game developer or game designer wants at their finger tips, the fact that I could pause the game, see variables in inspector and even changing them on the fly without breaking the game was awesome.

They also bundled a modified MonoDevelop IDE that had Unity assemblies in which you could put breakpoints and do  debugging, had auto complete and it was not hard to do that because of the strongly typed C# that I was using. Also there was support for Visual Studio which was great.

(Please note that C# in Unity is a scripting version of C# language, which differs a bit from traditional Microsoft C#.)

When I moved to Corona, I instantly felt the need for such tools again. I’m not a good programmer yet, even thought I’m programming for almost 7 years now, so I rely to breakpoints and auto complete a lot. I had to test various packages and some of them are Mac only. And from the ones I tested, which I think I did what I could find, I have to say that none of them are mature enough yet.

I settled with the one I think is better than the others and try to make it better with giving constant feedback to it’s developers but it’s still not there as I want it. (Some of it is due to nature of Lua that makes it very hard to interpret code at IDE’s). And last but not least, I had to pay extra for such tool.

Beside IDE, the whole level editor that Unity has built in is great. I know I can achieve similar results with tools like LevelHelper but first they are not made by the company behind the engine/sdk so it may not be on latest updates of the engine/sdk, second you have to pay extra for it.

My first item in my Corona SDK wishlist is an integrated environment. I see that some competitors are started doing this, by licensing these third party tools and revising them and give them a feel and touch of first party development.

2- Language.

I knew C# from I think 2002-ish, before .net standards came out and worked with it on several projects and when I wanted to learn to make games with Unity I had to just learn how Unity works, not C#. But with Corona I had to learn Lua, which I’m still not familiar with with due to the facts that I’m learning a new language whilst making a game with it and it’s a weakly typed language, so it’s harder to structure your code, especially topics like OOP, which is mandatory in this day and age.

3- Offline build

Internet connection is not reliable in where I live, so I rather to download big SDK’s once and enjoy offline builds rather than hoping that Internet works, and available, on where and when I want to make a build.

There were times that I could not install a build I got from Corona servers only to later find out that it was not downloaded correctly and Simulator did not do a hash check to check it’s integrity.

4- More platforms other than mobile

If you make your game in Unity, you are not forced to do mobile only. There is a vast list of platforms that you can get build for, from AAA consoles to mobile devices and they are keeping up par with the current generation of gaming, so if a new console/platform comes along, it’s much likely that Unity will add it’s support whilst Corona is just mobile only, at least for now.

5- Finding team members

It’s much easier to find people, being artists or developers, that have experience with Unity than Corona, because of it’s larger user base, that’s why I have to work alone on my game because when I tell them that they have to learn a new language called Lua and there is no IDE that gives them reliability and facility of IDE’s like Visual Studio, they just scare away.

6- Assets store and plugins.

There are numerous and vast array of great plugins on their Asset store which one can get at reasonable prices to help their development. This helps great for things like doing 2D in Unity, which I’ll cover just a bit later.

Corona added plugin functionality a while ago and they are adding different types of plugins everyday as well but Unity’s library is way bigger, at least for now.

Also any one can put together a plugin or make an asset and upload it.

7- Company size!

This may seem odd but the size of the company and age of the product does impact the product you use greatly.

One of the things it will affect is the API you will use. Because the product will be tested with more people, the team behind it will get more feedback on not only features and requests to make it better and more stable also bug reports to make it more bug free. So you will get more general API’s to use and rely less on documentation rather then finding exceptions on what to do here or if you want to do that, you have to do this odd thing here.

I’m not sure but maybe since they have to support more platforms and devices, they may need to clean up the API more.

Also since the company is bigger, they have more manpower for small things like updating the documentation and doing regular tutorials and things like this, which helps newcomers more than versed ones. And I think the current battle and competition currently is here.

This also helps you to find more learning resources as the userbase is large, the educational companies are more willing to do packages and books on the matter so you will have wider window of choices.

Last thing that I can think of that is related to this is the destiny of the company. The bigger a company gets, it will have less chance of disappearing or getting bankrupt all of a sudden. Something that happened with a solution I was using years back which affected my game badly.

Where I think Corona shines is 2D.

1- Focus on 2D

Since Corona is focused on doing 2D, so it does a better job at keeping things simple. Making a 2D game in a 3D world is not an easy thing to do, even though there are notable examples that have done this, like Dungelot, but you have to learn how to control that “3D-ness” in your game.

This is a trade-off going on here. If you want something fast and simple, you have to lose some advanced functionality. For example in my game I want to do skeletal animations and Corona natively doesn’t support it. I’ve read that Spine does this but from their example, I can say that it does not do all the things I want, like skew/resize the object as they move, and I try to avoid putting 3rd party tools in my game as much as I can, since they are not tested enough.

It’s made for 2D, so you don’t pay for things you will not use and also a lot of 3D stuff will not get in your way.

Also, if I want to make a large 2D game, like those farm games like Farmville or Clash of Clans, I will probably consider other options as well, because I’m yet to see anything other than small arcade games done with Corona. I can be totally wrong on this as I was knee deep in development and didn’t test most of the games promoted as game of the week.

Update: Read David Rangel, COO of Corona SDK team, comment on this:

Hi – check out Throne Wars:

It is made with Corona SDK, and a worthy competitor to Clash of Clans. You can definitely do games like this in Corona!

2- Lua

I always wanted to find an excuse to learn Lua, which is standard scripting language nowadays and Corona made me do it.

I’m starting to like dynamic languages once again, it’s very faster to program in them and also much easier to shoot your foot with the shotgun if you do not know how to write them because compiler almost never warns you about anything, unlike more traditional programming languages like C-family languages. And I see lots of smart ways to program in them that I like and comes from the inherent dynamically facet of Lua. I’ve had very bad experiences with AS2/AS3 but since I’m more experienced now, I’m more fit to use it.

3- Price

There is element of money as well but since price model of these two are different, Corona using subscription based and Unity doing licensing, one has to decide for themselves, based on how long they want to stick with the engine/sdk and which features they want but generally speaking, Corona is cheaper but as I mentioned, has some little hidden costs.

4- Light weight

Whole project is your source code with your assets, no strange binary files created by engine that you have to store.

5- Initial vision

It was made for mobile in mind, like the number 1, there are lots of things that is more emphasized here because they know what you probably want to make but in Unity’s case since you may want to make God of War and next guy will want to make Doodle Jump clone, they have to make tools compatible to do all of them so you will end up with an abomination that wants to do both but I”m not sure how it can.


So these were my thoughts on the matter, based on the feedback I get, I will update this post in the future to reflect my more recent perspective on the matter.