Categories: Uncategorized Posted on December 24th, 2009 by Bino

Categories: Bullet Physics Engine, BulletML, iphone/ipod Touch Posted on December 23rd, 2009 by Bino
Rewrote and reworked the prototype code for use on the iPhone. My initial implementation could only handle roughly 20 bullets at < 20 frames per second. What made things worse, there was no collision detection being done! So there was no chance of building a game with things in this state. I know the iPhone isn’t a work horse like my PC but surely it’s capable of more than this!
I initially thought the culprit was BulletML. However my basic profiling didn’t produce evidence to support this. Further profiling using instruments showed unusually long spikes in drawing. It then dawned on me a really obvious bottleneck…
I originally setup the prototype to store a bullet per scenegraph node. With this setup, each bullet sends a new draw command to OpenGl. Clearly what was needed was to batch the bullet drawing.
After reworking the code to accommodate this, the prototype was handling complex bullet scripts with a cache of 300 bullets quite easily. I’m sure there are further optimizations to be had by delving into BulletML… But as it stands that’s going to be a time sink.
There are a few posts on the Internet saying that BulletML is too slow to be used on the iPhone. I disagree. Clearly you’re still limited compared to a PC but it’s possible to get a good amount of bullets at a decent frame rate. Additionally, you’re working on a small screen so you don’t really need 3000 bullets?
My next task was to incorporate the Bullet physics engine. I planned on moving the bullets by applying impulses. However this took a fair bit of CPU processing and the final results seemed like a souless version of BulletML. It felt wrong and looked wrong. So I opted to use the bullets as kinematic objects thus letting BulletML control the movement entirely. In hindsight, this makes even more sense as the bullet movement patterns are only calculated once.
Still a fair bit to do. No doubt I’ll run into a few more perf issues. Looking forward to it!
Bino
Categories: Bullet Physics Engine, BulletML, Technology Posted on December 17th, 2009 by Bino
Decided to take a break from the XNA development I had planned and do a prototype implementation of BulletML. I’ll show the screenshots first for those that prefer instant gratification.
As you can see it’s pretty much a particle system for Shmup Bullet Hell patterns.
The original Java version can be found here and the C++ port (which I’m using) here.
I’m somewhat concerned with a design decision regarding memory allocation and deletion during gametime. To re-design it would take more time than I’m willing to spend on this. (if I get hassled enough I’ll write an implementation tutorial and further explain where my concerns are)
I’m currently implementing the prototype into my iPhone framework (I prefer to prototype in Windows) and will see how much this affects the actual gameplay. In addition I’ll be coupling my implementation with the Bullet physics engine for physical simulation and collision dynamics. Should be fun!
This implementation prototype was originally just to get my head around BulletML for my Towerless Tower defence game. But I’ve decided to put that particular game on hold for a game I’m currently naming Bullet Dance. Bullet Dance will be a game in its own right but with the auxiliary purpose of getting a solid BulletML implementation.
The next technology that I plan on playing with is Verse. That on the iPhone would just be cool.
Bino
Got anything nice to say?
Suggestions? Questions?
Email us on:
contact [AT] fallenfeathersoftware.com.au
OR
You can simply fill out the contact form.