Archive

Posts Tagged ‘github’

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…

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.

Introducing Jenkins CI to my github projects

May 1, 2011 3 comments

On sunday morning I had an idea of introducing continuous integration (CI) tool for my projects to have one place to see how they are going.

Currently I’m forced to use CruiseControl at work, but I don’t like it much. I was looking for some more user friendly tool. From my teammates working on Java stuff I heard about Hudson. After searching a while, I found Jenkins. It’s fork of Hudson after Oracle claimed the right to Hudson’s trademark (you can read more about it at this wiki page).

It took me about 3 hours to download, install and configure Jenkins. It also includes preparing one of my current projects to run all test cases and builds configurations from command line. I thing it’s pretty easy and takes really small effort.

Now I have automatic builds with test cases execution after each change on my remote github repository. The project you see on the picture is iPhone application, but because I used GHUnit that is able to write tests results in JUnit xml format, I also can see results from all tests.

It’s just the beginning. I’ll try to find other useful features there.

GitHub Markdown Preview

February 14, 2011 2 comments

Today I was creating readme file for one of my projects located on GitHub and I found really nice github web page that allows you to see on the fly how will look your readme converted from makrdown notation to html one. You will also see the final result, what really increases speed of creating such markdown readmes. Take a look there if you are using or plan to use this type of readme files.

Categories: other Tags: ,