Bullet under XBOX360 using XDK official SDK

Post Reply
tamat
Posts: 2
Joined: Thu Oct 15, 2009 5:25 pm

Bullet under XBOX360 using XDK official SDK

Post by tamat » Thu Oct 15, 2009 5:49 pm

Hi:

We are a young company of people willing to create a game for XBOX360. We finally got our XDK (the official SDK to code games under XBOX360) and we were thinking about using Bullet as our Physics Library.

But we are worried that Bullet will go slow under the XBOX Hardware because it wont use the optimized math functions from the XDK that used the hardware specific features on the XBOX360. I've been doing some research and I saw that the guys from Trials HD did their own port of Bullet to XBOX360, but obviously they haven't shared it.

So my question is if there is any info about how hard it would be to port the current math aspects of bullet (which I guess are 90% of the source code) to XDK. Is there any person here with experience? Any place to find tips?

If you are one of the guys involved in Trials HD we will appreciate to contact us.

Thanks a lot.

cobolt_dink
Posts: 72
Joined: Fri Apr 04, 2008 6:07 pm

Re: Bullet under XBOX360 using XDK official SDK

Post by cobolt_dink » Fri Oct 16, 2009 5:08 pm

Being as the workings of the XDK are under NDA I really doubt you are going to find anybody to publically talk about it.

tamat
Posts: 2
Joined: Thu Oct 15, 2009 5:25 pm

Re: Bullet under XBOX360 using XDK official SDK

Post by tamat » Tue Oct 20, 2009 1:58 pm

I don't expect the people to copy paste source code but what about tips or benchmarks? I don't think that would break the NDA (but Im going to check it right now).

Mattg
Posts: 12
Joined: Thu Oct 22, 2009 12:50 am

Re: Bullet under XBOX360 using XDK official SDK

Post by Mattg » Thu Oct 22, 2009 1:08 am

So my question is if there is any info about how hard it would be to port the current math aspects of bullet (which I guess are 90% of the source code) to XDK. Is there any person here with experience
There should be nothing to port for the maths, just compile the bullet math lib and it should work. You should get a good performance just doing that.

Then if you wanna go ahead to use specific XBOX hardware optimizations all you need to "port" would be the math functions themselves which isn't all that many files. For example to make bullet use vector unit you should in theory just need to update the btVector, btMatrix3x3 and a few other in bullet math. I'm guessing doing this would only give you a small performance improvement. This could be done at a later stage when bullet is integrate and working.

S.Lundmark
Posts: 50
Joined: Thu Jul 09, 2009 1:46 pm

Re: Bullet under XBOX360 using XDK official SDK

Post by S.Lundmark » Tue Oct 27, 2009 4:44 pm

Hi,

In my experience, Mattg is correct. The biggest performance issues for bullet is not those of the vector-maths. Each l2-cache miss on the 360 is roughly 610 cycles if I remember correctly. Missing a vtable lookup will cost 634 cycles just for a simple function call since you'll most likely end up with a branch prediction miss due to the l2 cache miss. Issues like that generally cause a lot more performance loss than what you could gain by implementing VMX in bullet. It's probably worth it in the long run though. But I'd also try to implement passing the vmx-vectors by register as much as possible to avoid load-store-hits, if you're aiming for optimal performance.

Cheers,
Simon.

rknoesel
Posts: 17
Joined: Wed Feb 25, 2009 2:18 am

Re: Bullet under XBOX360 using XDK official SDK

Post by rknoesel » Sat Oct 31, 2009 8:42 pm

We're using a 'pretty much vanilla' implementation of Bullet on the 360 with good (shippable) results. Here's what we did:

1. Enabled the native fsel intrinsic. To do this, we simply changed "#if WIN32" to "#if defined (WIN32) || defined (_XBOX)" in btScalar.h.

2. Parallelized execution by moving btDynamicsWorld::stepSimulation() to its own hardware thread. We wrote a custom stepSimulation() method which allows us to synchronize motion states when appropriate in our engine. We're also careful to only allow communication with bullet objects during this synchronization phase. This includes caching interesting contact callback events because our audio and particle systems are not thread-safe.

Hope this helps,

Ralf Knoesel
Vector Unit Inc

Post Reply