Skip to main content
GameDev.net gamedev.net
🔒 Locked

iPhone animation system

Started by Voidward Nov 19, 2009 at 11:15 PM 1 replies 1.8k views
Original Post
Voidward
Voidward
Hi, I'm working on a 3D iPhone game and I'm posting on behalf of my programmer. We're approaching the end of the project and the last large thing on the list is an animation system. I was wondering if someone could direct me towards some good resources or give some advice as to which way would be the best to go. I have rigged models animated in Maya ready to go, but I'm wondering if a skeletal animation system would be asking too much of my programmer to implement. It would be ideal but it's the most complex solution. I'm wondering if vertex based keyframe animation is a better alternative and if there are major downfalls with either method. Would the iPhone be able to handle just straight up vertex animations? If I simply exported every frame of each animation and had it load them in as needed? Because that seems highly inefficient and like the iPhone would run out of memory far too quickly, but it's probably much easier to implement. If there are some opensource engines or code examples which we can rip apart and use the bits in a way that fit our game that would be great. My programmer is just dreading the idea of doing this all from scratch. Thanks in advance.
DonaldHays
DonaldHays
I hoped someone else would reply to this because it's something I'm dealing with myself, and I'm no expert on the topic.

As I understand things, the tradeoff is that vertex-based animations are cheaper on the processor, but skeleton-based animations consume less memory (though the processing cost of skeletal animations can be mitigated by doing the work in a shader instead of on the CPU (but then shaders are only usable on the most recent generations of iPhones and iPod touches)). Based on that, then, the best approach for you is based on what resource you have more of: processing time or memory. Again, that's how I understand it, and I could well be wrong on any point.

I'm slowly experimenting with different animation techniques, though I don't have any benchmarks yet. I'm currently trying a vertex-based format, with space costs reduced by using a fairly low animation framerate (8 fps) and storing the vertices as bytes instead of floats. I'm also minimizing the processor costs by not even lerping the animations, so to render a frame of animation I just have to point glVertexPointer at data that's just sitting in memory. This is essentially equivalent to how animations were handled in Quake 1. My plan is to move forward with more advanced techniques if I find that the iPhone is able to handle this technique easily while still pulling off a good framerate with the content I want displayed: lerping animations if I have the processor budget available, storing vertices in floats if I have the memory budget available, etc.

I still hope to see others reply, because I'm very much learning about all this myself.
SuperRad
SuperRad
You could try looking at the oolong engine ( http://code.google.com/p/oolongengine/ ) for some examples on skeletal animation on the iPhone.
You'll probably want to steer away from the keyframe based animation, as I believe memory bandwidth is more of a concern than processing on the iPhone, so you may find skeletal animation is just as fast as keyframe, as you have to transform it to world space anyhow, and you'll have more memory available too.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.