Question about Rigid body objects in BGE

I’ve been wondering about rigid objects and the performance when you use a lot of them.
My game is mainly focused on physics, where you can drive into physics objects or you can drop them from shelves by accident.
When the rigid body object is set to sleep, does it use a lot of memory or should I turn off the physics and turn them on only when necessary?

test it out. its not bad, but its not great either. the stability is really biggest issue. stuff glitching through things.

the most stable physics are box and sphere. triangle and convex are the worst. if you can, make floors and walls of box objects. set the visible mesh to no physics.

I get it that triangle and convex are the worst for memory. But for some reason box physics keep on sliding more than triangle mesh.
I just wanted to know if the rigid body in sleep mode, takes more memory in comparison to a static object. If I should turn off physics when I don’t need them at the moment.

like i said, test it. add 100s of objects to a test scene and find out.

as for sliding, just increase friction and that should do. be sure the margins are set approperiately

isn’t “no sleeping” unchecked by default?
it’s a boolean so it must take the same memory(by my reasoning).
my intuition says that when the rigid body velocity gets close to zero the engine turn it temporarily into a static object. so i think that it takes the same memory but its more performant.

if you are doing it with logic bricks, near sensors and dynamics actuators, i think it takes more memory.
in upbge however, there is this “activity culling” in object tab that natively turns off logics and physics based on distance from the camera.

yeah, memory usage of physics is pretty marginal. the object and mesh itself is whats using the memory, not so much the physics.

Maybe this thread helps:

Thank you, but what I wanted to know is what is the difference in memory usage between a sleeping rigid body and a static object. If I should turn off physics when I don’t need them or if that’s not necessary.

how are you turning off physics when you don’t need them? through logic bricks?

my post just in case:

and Daedalus_MDW …

Yes by logic bricks.
But based on your comment it seems to be unnecessary.
If sleeping is on and it turns the rigid body into a static object, then I don’t need to manually change it.

turn on physics visualization to debug…
green means static
white means moving
when the object stops it turns green.

I see that helps a lot. The weird thing is. I have a static construction made of blocks. This construction is green in its layer. but when I spawn it in the main layer, it’s white. Why is that?

instanced objects too… i don’t know.
i d say to not worry about it unless you are having frame rate slow downs.

It’s weird. When I just copy the construction straight to the main frame, it’s green. When I move the rigid body object on top of that construction, it turns green.
But, when I spawn the construction to the main frame, it’s white. And when I put the rigid body object on top of that, I can see the yellow sensors flickering. So it’s still active for some reason.
Are spawned objects no longer static?
Also, it seems everything I move turns white, except for the rigid body objects. Those turn green when they stop moving.

are you having low fps? (check “show Framerate and Profile”)
maybe they just runned out of colors to distinguish and white also means added. XD

when i said ‘green means static, white means moving’ i meant for you to see the transition to sleeping object, like that’s what it seems to be.

the yellow are the collisions that also happens on static green objects.

No fps is fine, it’s just weird. When I put the rigid object on a green static object, it turns green and the yellow collisions stop moving.
But when I put the same rigid object on a spawned static object, the yellow collisions keep on flickering, signifying, it keeps on calculating the collision.

it keep calculating the collisions either way. The flickering may has to do with differences in other attributes like friction and elasticity.

Ok, thank you.
The only things that move are the yellow collision sensors. The rigid body object is completely stationary.

I have tested it. If I have the construction object already there, it’s green and all the rigid body objects that I put on top of it or inside it turn green. This results in a flawless 60 fps.
But when I spawn the same object in-game, the construction object is white and all the rigid body objects I put there stay white and jitters. The frame rate drops a lot. I’ve put half of the objects here than before and the frame rate dropped below 20.
So it seems I can’t spawn in static objects as a scenery. They’ll keep on calculating the collision, or at least I have no idea how to turn them green.

why you need static objects to be spawned?