Jump to content

Per-object physics calculations


Recommended Posts

Currently we working with a game that requires some objects to have very precise physics, and hundreds of others (background objects)that do not need such precision. Is there a way to set how often some objects get updated vs. others? I feel that setting the background objects to update less would save a lot of performance on the physics thread.

Link to comment

All physical bodies are updated equally, each physics tick (Unigine Declaration of Independence).

Actually, it does not make much sense to update one physics node more often while other bodies are updated less frequent. Otherwise, problems with calculating collisions are imminent in the aftermath. Plus, non-frequently updated nodes will behave strangely as provided data would be not enough for smooth and convincing interpolation.

 

You can use Physics distance to turn off physical simulation of background nodes.

As a different variant, you can use pre-baked animation, set physical triggers to detect simulated bodies and adjust behaviour of background nodes accordingly. It all depends on what your objective is.

Link to comment

Those options will look good for our background nodes. We also have another smaller physics effect which does not need that much precision at all, and those are debris chunks spawned from destroyed gameplay objects. The gameplay objects should be updating as much as possible for realistic behavior, but the debris chunks are only for visuals, and are fairly small. The only thing this does is drop the amount of real gameplay objects we can have (given 3 debris chunks are just as expensive as 3 gameplay objects).

 

We have temporarily gotten around this by just spawning a lot less debris, but this is not the best looking option. We currently set the games physics FPS manually in code pretty high. It would be ideal if I could set the physics FPS of these chunks much lower.

 

But, if this isn't possible, then I will search for other options.

Link to comment
  • 3 weeks later...

Well, you could use sphere shapes for your debris chunks as they are the fastest (convex shapes are the slowest and in this situation they are no-go). That can provide some performance gain, of course, if you not using them already.

Link to comment

I've read through your documents about physics on mobile, and you say to use 1-3 objects max. We're currently up to 45-90 objects running at a good framerate :blink: We're just trying to squeeze as much performance out as possible, and setting our small/background objects to calculate less would help.

Link to comment
×
×
  • Create New...