About this Archive

This page is a archive of entries in the expository coding category from March 2010.

expository coding: January 2010 is the previous archive.

expository coding: April 2010 is the next archive.

Find recent content on the main index or look in the archives to find all content.

expository coding: March 2010 Archives

This is our inaugural Old Testament Adventures podcast, which I hope may become a semi-regular feature discussing the ups-and-downs of developing our Old Testament graphic adventure game, "Ebenezer". We've none of us done this before, so it takes us a few minutes to warm up, but we tackle some really important and interesting issues that hopefully you will find thought-provoking.

Show Notes

Concept artwork

  • Andy is struggling with the question of how to set a budget and exactly what to spend it on
  • we discuss how to tap into the vastly under-served Christian market whilst battling the perception of "Christian naffness"
  • Dave asks if we can use the low budget as a strength rather than a weakness, by choosing a deliberately simple art style like South Park, or Time Gentlemen Please by Zombie Cow Studios.

Women in Bible games

  • our Bible passage is one of many that doesn't explicitly feature any women, meaning that any female characters are going to have to be ones that we create. We discuss some potential candidates
  • Monkey Island seems to have a disproportionately large number of female fans compared to other games/genres, so it seems to be an issue worth spending time on
  • all the actors we're mates with are actresses, so it's decidedly inconvenient that the cast of the game is balanced the other way
  • but that's okay, because Dave Hall (the narrator for my video "The OTHER Secret of Monkey Island") apparently sounds just like the actor Bill Nighy from Pirates of the Caribbean

Making God's involvement clear

  • the vital role of the narrator in Biblical narrative
  • how to get the Bible into the game itself without ramming it down the player's throat
  • Dave has no idea how great coffee is because he has no sense of smell
  • we discuss means of making God's involvement in the events clear without sending the wrong message about how he works in real life

What is the game teaching?

  • how do you avoid merely teaching a moral lesson about "treating God a certain way"?
  • how do you keep the focus on God: what do we learn about him through this passage?
  • what difference does Jesus make to the application? How do we avoid directly applying the OT to us as NT believers without considering the implications of Christ's coming
  • How do we draw out the ways the narrative points us forwards to Jesus?
  • Are there examples in non-interactive media that does this well?

Unity iPhone Capabilities

|

Some Initial Impressions of Using Unity iPhone

For a while now I've wanted to develop a version of my Old Testament adventure game for the iPhone / iPod Touch using the Unity game engine. But it requires so much initial upfront investment that I've been endlessly putting off the decision, particularly since I had no idea exactly what an iPhone was really capable of - would it be able to handle a bunch of animated 3D characters without grinding to a halt? Well, in the end I took the plunge, and here are my findings!

The True Cost of Unity iPhone

Firstly, though, let's just sum up exactly what an upfront investment we're really talking about here. It turned out to be rather more expensive than I'd anticipated!

  • Unity iPhone Basic License: $399 - this cost is pretty transparent, no surprises here.
  • Mac Mini: $599 - in case it wasn't clear, Unity iPhone requires a Mac development environment, since you need to be able to run Xcode from the Apple SDK. If you've already got one you can obviously discount this cost. The cheapest piece of Apple kit is probably the Mac Mini starting at $599, I personally got a discount on a 13" Macbook coming out at about $800.
  • iPod Touch: $199 - I'd hoped I could do all my development in the Unity development environment and then borrow my housemate's iPhone to do some occasional performance testing, but it turns out that a physical iPhone/iPod touch is essential for your ongoing development: all interaction takes place using an actual device which then sends signals back to your dev environment. For performance reasons you may be best off buying a second-hand 1st generation iTouch from eBay or something - mine set me back about $100.
  • Apple iPhone Developer Program: $99 per year - again, because of the way you need a physical device for development purposes, you can't leave signing up for the Apple dev program until the end. You have to pay the annual fee before you can even get started using Unity in earnest.
Total cost: $1,398 (minimum $498 if you already have a Mac and an iPhone).

The Software Itself

The first big surprise for me when firing up Unity iPhone was the extent to which it is an entirely separate product from the normal Unity. This may be a versioning thing - I've only ever seen the latest version of Unity - and the iPhone version may just be a version or two behind, perhaps. For now, at least, many of the interface elements are quite different if you're used to the standard Unity. For example, the widgets for rotating game objects work differently - not necessarily worse, just differently. The whole thing just looks a lot blockier and more old-fashioned, for some reason.

Secondly, as I've already hinted at in the costs section, the workflow isn't entirely what I'd expected. There's a great little summary of this on GameDev, but here's a brief outline:

  1. Rather than running an iPhone emulator on your Mac, you actually run a Unity emulator on your iPhone!
  2. All the code is then executed on your Mac during development, and Unity just streams low-quality images to your physical device. Touches / tilt readings are then fed from the device back to Unity. This means that (apart from GUI interaction) mouse clicks on your Mac are ignored - you really need a physical device if you're to test any kind of interaction with the user.
  3. When you're happy with your code, Unity builds an Xcode project which can then be compiled like any other iPhone app and downloaded to your device for testing. This can be done in a single click from within Unity, but takes a few minutes to happen.

In case you missed the small print, there are a number of important pieces of .NET (C#) functionality that are not available in Unity iPhone:

  • Anything that uses System.dll or System.Xml.dll. This includes reflection, but also things like System.Collections.Specialized - you'll have to stop using HybridDictionaries and things like that.
  • Anything from .NET 2.0, like generics

(Update: Unity 1.6 was released today that actually fixes all of that - you can now use .NET 2.1 functionality and System.dll)

Unity iPhone also has no support for programming in Boo, for reasons that I'm not sure of.

Hardware Capabilities

For me, at least, the million dollar question was regarding the hardware capabilities of the iPod Touch/iPhone - especially the first generation ones. The iPhone 3GS is a seriously powerful computer, but if you make your game so that it only runs on the latest hardware then you're ruling out a large proportion of your potential audience. I deliberately bought myself a first generation iPod Touch off eBay - apparently the first generation iPhone has very similar specs in terms of CPU speed.

I have to say, my expectations were not very high when I finally got to the point of being able to test. Since I'm developing an adventure game, I need to be able to have a good number of animated characters on screen at the same time, and I'd feared that the iTouch just wouldn't cope, particularly by the time you'd added in a few particle effects and background scenery.

But I was totally wrong - these devices are remarkably capable, and the guys from Unity have clearly done a great job of optimising their software to squeeze out every last drop of speed.

For testing purposes I used a character model with 738 vertices and 692 faces. The armature featured about 30 bones, and here you can see the frame rates I was getting as I added more and more of these characters on screen, all running the same animation but out of sync (just in case Unity tries to do any clever optimisations for characters at the same frame of the same animation):

Characters Total Faces Total Bones Frames Per Second
1 692 30 30
5 3,460 150 25
15 10,380 450 8.5

Even with 15 characters, running just above 8 FPS, it didn't look so jerky as to be unplayable - at least not for an adventure game like mine. Exactly what framerate you need probably depends on how important fast responses are to your game.

The scene below with 5 characters, a relatively simple environment mesh and a particle simulation ran quite happily at about 22 FPS.

UnityiPhoneTest1.png

Conclusion

All told I'm immensely positive about what Unity iPhone is capable of, and have high hopes for what I'm going to be able to achieve with it. The engine is a real joy to work with, and the capabilities of the hardware far exceed what I'd expected from it. The Unity community is incredible, and help is always available when you need it.

If you're thinking about taking the plunge, I hope you've found this article helpful. Feel free to Twitter me if you want to ask any further questions, or check out the UnityAnswers website.