Demystifying Unity iOS Crash Logs

March 21, 2014 8 comments

Someone who never ported Unity game to mobile (iOS / Android) can tell that it’s pretty easy. If you think so, you are very wrong. When running i.e. WebPlayer version of your game it allows you throwing exceptions that are not caught and sometimes the game runs without any crash, only in the log file you can read note about it. Mobile version is less forgiving. Unhandled exception will crash your app.

Reading iOS crash logs helps a lot while debugging, but if they are still mystery for you, you can read great article about them here: Demystifying iOS Application Crash Logs. The problem is, that sometimes Unity creates crash on your iOS device that will not tell you much:

...
6 mygame 0x002328f4 ___lldb_unnamed_function7016$$mygame + 268
7 mygame 0x0122597c ___lldb_unnamed_function93440$$mygame + 200
8 mygame 0x01964224 ___lldb_unnamed_function136404$$mygame + 2152
9 mygame 0x01a06274 ___lldb_unnamed_function138276$$mygame + 132
10 mygame 0x015a08cc MonoBehaviour::InvokeMethodOrCoroutineChecked(ScriptingMethod*, MonoObject*, MonoException**) (MonoUtility.h:452)
11 mygame 0x015a0918 MonoBehaviour::InvokeMethodOrCoroutineChecked(ScriptingMethod*, MonoObject*) (MonoBehaviour.cpp:975)
...

It will tell you nothing because of ___lldb_unnamed_function (sometimes there is only memory address if automatic symbolication went totally crazy). Instead of this unnamed function you would like to see name of your method in your C# scripts. The problem is wrong calculation of method address by default Xcode symbolication tool (more details about these calculations you can find here). To ease you life I created a script that will symbolicate crash log for you. All you need is the archive from which you created your binary, name of the application and crash log itself.

Usage is as follows:

symbolicate_crash.sh <archive> <app_name> <crash_log> [<output_file>]

Read more…

Dev Diary: Lokomotywa – Julian Tuwim

February 8, 2013 Leave a comment

Kids always says the truth. Creating application for kids is simple from one point of view but really hard from the other one. They will not tell you that animation lost couple of frames, but will tell you that this character is ugly and don’t want to play any more.



Peaple outside Poland probably hadn’t heard about Lokomotywa poem by Julian Tuwim, but in my country it’s one of the best know children’s poem ever. Big Rabbit made a marvelous job exploring it again in a completely new way. You can notice wonderful ilustrations, exclusive soundtrack composed especially for this book and narration made by Piotr Fronczewski (famous polish actor). Big Rabbit is a group on nice peaple who want to make things that are just outstanding.

Read more…

Dev Diary: Bridgy Jones

February 5, 2013 Leave a comment

People who say, that making games is easy, they don’t know anything about gamedev. I was working at different companies on variety of projects, but only game programming pushed my mind and skills to the next level. Maybe its passion? It doesn’t really matter now. Bridgy Jones is almost here!

Meet Bridgy and Bonner

From the idea through the prototype to the final product. Looks simple. Idea was simple – bridge builder. We decided to go with cocos2d framework for graphics, Box2D library for physics and Level Helper application for level design. Prototype was ready after two weeks. Final product planned in four months, worst case scenario – six months. Piece of cake! Really?

Read more…

One Game A Month

January 2, 2013 Leave a comment

One Game A Month logo
Following couple of game developers on twitter lead me to fantastic game development initiative called One Game A Month (1GAM). Generally you create a game each month. It’s not for the community, not to be reach, it’s just for yourself and just for fun. By creating game I mean not creating proof of concept, but whole working game. It’s really hard, because I already have couple unfinished game projects and I know that the road between idea with couple lines of code to the final product is rough. This topic is great covered by @McFunkypants (the initiative founder) in his keynote below.

.

.

So, my plan is to create games! Currently, I’m motivated to create all 12 of them, but the time will show how it gonna end. I chose to make iOS games. My little game development experience told me, that one month is hell small amount of time when you have family and normal job, and 1GAM is only your hobby shared among other in spear time. Because of time and my will to learn new technologies, I plan to create games in Unity game engine. Some time ago I got free license for iOS platform, so it fits perfectly.

According to games, I will try to create as simple games as possible, but simple doesn’t mean boring. The game should bring lot of fun and joy, so in reality it’s damn hard to create simple and interesting game.

I’m pretty excited and curious how it’ll end up. All games I will create I will describe here on my blog. I hope to write 12 posts till end of 2013. I wish luck to all people taking part in 1GAM.

Perforce with Git

August 7, 2012 Leave a comment

I wanted to publish this post couple of months earlier, but forgot about it :) I hope that informations below are not very outdated and you can use it for something.

When I started using git, I was just unable to use other source version control system, because of their lack of functionality or performance (comparing to other I used to work with during my professional career: svn, cvs, cmvc, perforce). At one of my previous companies I used to work for, they have all projects configured under perforce system. I just had to find the way to use git as my local repository. After reading couple of blog posts and searching through forums I found really simple method to do this.

First of all, you have to install p4 command line tools (I assume, you already have p4 gui client installed). You can find them here: http://www.perforce.com/downloads/complete_list
For Mac OSX, you can also use MacPort or Homebrew.

Next step is to configure environment variables (I assume again, that you already have access to p4 server and you have configured your workspace). Place following variables (with values matching your settings) within your ~/.bashrc file, or similar if you are using shell different than bash:

export P4CLIENT=my.cool.workspace #workspace name
export P4PORT=10.0.0.5:1666 #p4 server ip and port
export P4USER=user.name #p4 user name
#export P4PASSWD= #your p4 password
export P4EDITOR=vim #command line text editor you like

It’s better not to place password here. Without P4PASSWD variable, from time to time you have to use “p4 login” command to authenticate to p4 server. It’s more secure.

Use command:

p4 client

to verify if the workspace mapping is correct. For other settings verification use this command:

p4 info

You have p4 command line client configured, now it’s time to install p4-git. It’s located in git repository on github, so clone latest git repository to your favourite location with command:

git clone https://github.com/git/git.git

One more step. create symbolic link to the git-p4.py script:

sudo ln -s <cloned_git_repository_location>/git-p4.py /use/bin/git-p4

Now it’s time to get p4 repo and start using it! To clone p4 repository, use command:

git p4 clone //path/to/project/at/p4

of course using your path to project. Adding “@all” at the end of the path will get all the project’s history into your local git repository:

 git p4 clone //path/to/project/at/p4@all

That’s it! You have full featured local git repository and you can do all that nice rebase, stash, merge, branch things.

To download latest changes from the p4 server (like git pull), you have to run command:

 git p4 rebase

Pushing your commits (like git push) to p4 server its done with:

 git p4 submit

Have a nice giting! :)

Categories: source control Tags: , , ,

My GameDay 2012 Conference Remarks

May 15, 2012 Leave a comment

It’s been my second GameDay conference and I want to share my feelings about this one and also compare with the previous one. Remarks about GameDay 2011 conference you can find in my other post.

This time, the conference took place at Expo Silesia. Pretty big place for such a tiny event. Last time, it was at Silesian University and the number of participants was able to cover most part of the seats. This time, lots of empty seats were looking a bit strange. I think that the number of viewers comparing these two events was roughy even, but the feeling was much different.

After trailers and press news I thought that the whole Expo Silesia building will be covered by gamedev companies and tens of new and unreleased game shows. It was not true. There were only couple of stands:

  • Artifex Mundi with their games and Spark CE games editor
  • Microsoft with couple of XBox 360 consoles and Kinect
  • Reality Pump with Two World 2 game
  • iMad Apple Reseller with Apple devices
  • some company which I don’t know what they were doing, but surly nothing interesting
  • polish Imagine Cup team with their game
  • number of old computers :)

Read more…

Scripting iOS games with LUA (lua-wax)

April 6, 2012 Leave a comment

Creating game for iPhone/iPad is one thing, but making it enjoyable is way harder. Most of current games use physics for animation, to make scenes more realistic and not repeatable every time you start the same game level. You can teach your level designer Objective-C to code different behaviors for different things, but the simpler method is to script it in LUA. Lots of previous and today games use this scripting language to describe AI, events and many other things.

I wanted to implement LUA to my upcoming game and found pretty good library called wax. Its pretty impressive. All you have to do is:

#include
- (void) runLuaScript
{
    wax_start("your_script.lua", nil);
}

The problem was that you were unable to execute wax_start() function again (it was possible, but had no effect, script was not executed once again). It lead to big problem, how to load different scripts for different levels? To achieve it you have to clone/fork/download my forked version of wax that fixes that issue.

Steps to do:

  1. You can add my repository as submodule to your XCode workspace by executing command:
    git add submodule git@github.com:zbyhoo/wax.git
  2. Add libwax.a from your workspace to “Link Binary With Libraries” building phase
  3. Finally add “$(SRCROOT)”/wax/lib path (with recursive search) to your “User Header Search Paths” in Build Settings.

Now you will be able to do it this way in your application:

#include
- (void) runLuaScript
{
    wax_start("your_script.lua", nil);
    wax_end();
}

You can call runLuaScript method as many times you want.

Using you Objective-C classes in lua wax is really simple.

-- your_script.lua sample
local my_object = MyObjcClass:init
my_object:someMethod()
my_object:anotherMethodWithArgument("hello")
my_object:oneMoreMethodWithArgument_secondArgument("hello", "lua world")

For more details for lua wax take a look at Wiki page.

UPDATE:
My commits have been pulled to the original repo, so now you can use it instead of my fork.

Follow

Get every new post delivered to your Inbox.

Join 268 other followers