How to symbolicate iOS crash dumps from Unity Cloud Build games

Disclaimer: this advice is provided without warranty, works on my machine, etc. Use it at your own risk.

We’ve been using Unity Cloud Build at Spry Fox for a soon-to-be-announced project. Since we’re a remote company, it’s great to be able to push and know that both Android and iOS builds will be soon available to everyone in the team with your new feature. It’s saving a lot of time every day.

This morning I pushed our new IAP back-end, which of course involved some low-level stuff on both platforms. Everything worked on local builds, but when I tried the iOS build from Unity Cloud, it crashed on start-up. Getting the callstack of the crash turned into a bit of an odyssey. I thought I’d document it here.

By default, Unity will not generate Xcode projects that produce useful debug info. We can fix this by adjusting the Xcode project after generation, but that’s no good for Unity Cloud Build where we have no control.

So, one time only, you should add this file https://gist.github.com/tenpn/f8da1b7df7352a1d50ff to your project (EDIT: in an editor subfolder; thanks Terry Paton). That will do the post-processing for you and for Unity Cloud Build. (There are conflicting reports as to if this increases build size, but you definitely want it while developing. It might still be worthwhile leaving it in for release, because it will be extremely helpful in chasing down crashes in the wild.)

Wait for Unity Cloud Build to produce a new build containing that change, install it, and repro the crash on your device. Then follow these steps:

  1. Go to the cloud build project for your game, and find the dSYM and ipa downloads for the build you installed. At the moment, you click Install on the build in the history list, then Share, then both Download to Desktop for the ipa and Download dSYM.
  2. Unzip the dSYM somewhere safe. I put it in a new folder named after the Cloud build number we are investigating. The location should be somewhere Spotlight can index.
  3. Rename the ipa extension to zip, and unzip the .app inside to the same folder as the dSYM.
  4. Attach your iOS device via USB to your OSX machine
  5. In Xcode (these steps are for Xcode 6.1.1), go to Windows->Devices
  6. Select your device in the left pane, and click View Device Logs
  7. There should be a crash dump for your game. Locate it by the process name and crash time columns and click on it.
  8. The right window should now have the crash dump with a named callstack. If not, right-click on the crash dump in the left pane and select Re-Symbolicate Log.

Hopefully this gets you enough info to start debugging your app.

Shameless plug: DecisionFlex is a new unity plugin to let your AI make human-like and emergent decisions.

Advertisements

DecisionFlex

DecisionFlex considerations

For a while I’ve been working on an AI plugin for Unity3D called DecisionFlex. It’s a decision-making tool for your games, based on Utility Theory. It’s great for when you have multiple actions to choose between, and lots of factors to take into consideration. For instance:

  • A soldier choosing its next target, based on target range, type and the soldier’s ammo count
  • A Sims-like human choosing to eat, drink, work or exercise based on hunger, thirst, wealth and fitness
  • A bot choosing to prioritise picking up a health pack, based on the bot’s HP and distance to the nearest pack
  • Any time you might find yourself writing highly nested or cascading if-then statements

DecisionFlex editor-based and data-driven, so you can construct new decisions and actions, and tweak considerations, without diving into code. The code to hook your game up to DecisionFlex is minimal and you don’t need to understand complex equations.

DecisionFlex isn’t quite ready to ship yet, but I’m ready to start talking about it. You can find more information and a web demo here:

http://www.tenpn.com/decisionflex.html

Innovating In Your Pants

The company I work for, Spry Fox, is known for its innovative games like Triple Town, Steambirds and Leap Day. In fact, it’s one of the reasons I was attracted to work there in the first place!

We do this by prototyping a lot of ideas, iterating quickly, and (ideally) killing readily. All as fully remote company. People in the company have talked about the details of this procedure publicly before, but I took a shot at it when asked to speak at Falmouth University the other week. The presentation (~30min) and Q&A (~20min) were filmed, and can be watched for free here:

http://onair.falmouth.ac.uk/Mediasite/Play/28dd23b44a3c43abbd60ecb6d49969bd1d?catalog=0a29d6d3-1b0b-405b-8976-0d080ce607e8

Here’s a direct link to the slides:
https://docs.google.com/presentation/d/1cCpuFpduP3NX2ZxJY_QaQ_eYxdwKug1tpkkiROI5Xyo/pub?start=false&loop=false&delayms=3000#slide=id.p

And here’s a similar (but longer) presentation by Daniel, David and Ryan at GDC 2013:
http://www.gdcvault.com/play/1018263/How-to-Make-an-Original ($)

Hope you find it interesting!

Practical Unit Tests, GDC 2014

I gave my talk yesterday on how bad unit tests can slow iteration, and how you can fix them. The turnout was fantastic, and we had a great roundtable afterwards in the wrap-up room. It was 8 years since the last test-focused GDC talk, and hopefully the organisers will now realise there’s an appetite for more on this topic.

I want to do a recording of the session next week (it’s only 25 minutes) and post it up here, but in the meantime the slides are below. Hopefully they make some sense without the audio.

Come see me speak at GDC 2014

Come see me speak at GDC 2014

That time of the year again, when I’m flip-flopping between wishing GDC was tomorrow, because I can’t wait to catch up with friends and colleagues, and just a few more weeks away, so I had just some more time to polish my talk.

This year I’m talking about unit testing, or more specifically how bad unit tests can ruin a project just as much as no unit tests. It’s aimed at devs who know what unit testing is – it’s not a tutorial session or a guide – but you don’t have to be an expert.

The talk is on Thursday, 11:30am in South Hall 304. See you there!

Your Favourite Free To Play Game Hasn’t Been Made Yet

There’s been a lot of criticism over the last few days of the new Dungeon Keeper free-to-play mobile game from EA. By all reports, it features some egregious and long countdown locks, that can be opened early with in-game currency, which can of course be topped up with real money in-app purchases. These types of IAPs are intended to both aid retention (as people come back to see their timers complete) and frustrate the players into spending.

Dungeon Keeper Ad

It’s a frequent pattern in high-grossing f2p games, and it’s not that weird to see it here, a high-profile title from a successful f2p publisher. The complaints haven’t been so much that this example is particularly bad, but coupled with a well-loved IP, it’s the straw that broke the camel’s back. I absolutely agree; as I mentioned above it’s a mechanic that has little to do with crafting an experience for the player. It’s a crutch for actually having a fun replayable game – if you make a good game, you don’t need to worry about retention mecahnics! I’m glad this kind of crap is being called out.

But let’s not go overboard. Here’s some quotes from the articles above:

“…if you are one of the very few developers who are still making real games (without the in-app purchase crap), I salute you. You are my heroes.”

“It’s greed, is all free-to-play games are.”

“Every interaction, mechanic, and screen must be expressly designed to convert scroungers into payers.”

We’re told that all f2p games are worthless, that any IAP is immoral, and that the designers of f2p games are borderline criminals.

Can everyone take a second and calm down?

There are design practices that we should shine a light on, and there are business practices we should frown upon, but we should not throw out a whole type of entertainment with the bath water.

Let’s ignore that there are high-profile f2p games on PC that always seem exempted from these arguments – maybe because they’re not aimed at the derided “casual” market? Let’s also ignore that there are successful but lower-profile f2p games on mobile that don’t use distasteful mechanics like countdown locks, despite me being lead developer for one. And finally let’s ignore the design reasons for creating a f2p game, like exploring the mechanics of large communities on a budget.

Instead, let’s explore an analogy.

CAUTION: ANALOGIES AHEAD

No one would argue that film and television are identical art forms. Many TV stations are free at the point of delivery, compared to the up-front cost of cinema, and are instead funded by ads. The individual episodes are shorter than films, yet have storylines that may last for years. Some shows, like soaps, essentially never stop. They both use sound and vision, but that’s about as much as TV and film have in common. The Sopranos is a very different masterpiece to Goodfellas.

You don’t think that ad funding affects how TV writers do their job? Do we stomp and scream at the writers of House because most ad breaks are prefixed by a mini cliffhanger? Aren’t they compromising their art for the sake of ad revenue? Why aren’t there blog posts decrying all television, ever, because Lost was designed to keep you watching week after week? Isn’t that as egregious as Dungeon Keeper’s countdown locks, which apparently condemn all other f2p games?

Actually I bet, if wordpress and medium had been around in the early 1940s, we would have seen posts complaining that television was nothing but a greedy cashgrab, compared to the “artistic purity” of cinema. But to shut down the medium then, when it was so young, would have robbed us of Cosmos, of West Wing, of the Simpsons, of Fraiser, of Monty Python, of Doctor Who, of Star Trek.

And is cinema really that artistically pure? Are the big releases not as commercially driven and “greedy” as any f2p game? Do they not compromise their vision for lower age ratings, or to include product placement? Let’s campaign to have them shut down as well!

In reality, upfront-cost video games and f2p games are different mediums, with different constraints. They’re both interactive entertainment, but don’t be fooled because they both have pixels and polygons. They serve different purposes, and have different potentials.

I must be clear I’m not arguing that Dungeon Keeper’s design is ok because TV has ads, nor that Dungeon Keeper should be given a free ride because f2p is a young medium. F2P is still finding its feet, and yes many of its baby steps have been in the wrong direction, but if we can bring it to a sensible maturity, we’ll have a richer world for all. Keep hating on bad f2p games, as well as on bad upfront-cost games, but don’t conflate them with the entire medium.

Edit: reworded conclusion slightly