Page 1 of 1

Need Optimization Tips

Posted: Fri Jul 13, 2012 2:37 am
by LostMachete
Hey Everyone,

I'd like to add 4 player co op to my Xbox game and I need to increase performance somewhere before that will run smoothly. Looking at some of the demos for Bepu I think my physics could be running faster but I'm not sure what to do to get it there. I made a short video to show what I'm doing (also to make sure its okay to use the bepu logo in my splash screens) which you can see here:
Null Battles Gameplay

The rooms are procedurally generated and then all the platforms are added to a static group. My players all have two sphere entities attached with a weld joint, 1 for normal collision and another slightly larger one that serves as a buffer space sensor to help ease players onto platforms and reorient them correctly. Players can occasionaly explode and get switched out with 5 free floating objects, but I haven't seen any significant performance impact with that. The room seen in the video has about and 130 platforms in 1 static group and 16 players (thats about the worst case senario for physics in my game) and the space is taking about 8ms to update.

I'm also using the Super Speedy settings from the demos and cut the iteration limit down to 3.

After looking at the static mesh and static group demos on the Xbox I was hoping I could cut the physics time down more but I'm not really sure what to do at this point. Any help would be appriciated!

Re: Need Optimization Tips

Posted: Fri Jul 13, 2012 3:25 am
by Norbo
It does sound like it should be going faster than 8 ms. One thing would be to get rid of the WeldJoint; if the other sphere's dynamics don't matter, it could just be teleported around to follow the 'real' sphere by setting the Position directly. Making it kinematic would prevent if from gaining any unwanted velocity or rotation from external sources. However, given that it sounds like there are no more than 16 such joints at any time, this is not likely contributing much cost to the simulation.

At this point, without other information, my recommendation would be to try to collect some data. Profile the PC version or insert finer timing between stages to see where time is being spent. Make sure the content of the space is only what is expected (e.g. no hiding duplicate objects).
I made a short video to show what I'm doing (also to make sure its okay to use the bepu logo in my splash screens) which you can see here:
Looks great :) It is indeed perfectly acceptable to use the logo- so long as you don't make us look bad or evil (e.g. "Powered by BEPUphysics: A library created by murderers of puppies and kittens, trust me, I watched them do it, they're horrible people") or use it to promote things that we wouldn't want to promote (e.g. "You should murder puppies and kittens; BEPUphysics agrees!").

In general, if you aren't sure if a particular use of the logo is okay, just ask. Given that the usage in the posted video does not appear to encourage any small-fuzzy-animal murdering or anything like that, I'd say it's fine :)