Disabling Density, Friction, Bounciness and Movable of background actors.
3absh
Member Posts: 601
I have some Background illustration actors that don't interact with gameplay at all.
I went through them one by one and disabled all their physics attributes.
Will this result in a better frame-rate?
Comments
All you need to do is uncheck moveable. Once you uncheck moveable that actor is removed from the physics engine. So zeroing those other things out will do nothing as to performance.
Frame rate is best improved with slim and properly ordered logic.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
So unchecking movable makes the other physical attributes equal to zero, are you sure?
I have some blockers on the edge of the screen that have movable unchecked though during gameplay other actors collide with these blockers.
When 'moveable is switched off the other physics attributes still function as expected (they're not equal to zero), if - for example - you make bounciness a very high value (on the actor that has 'moveable' switched off) any actor colliding with it will be effected by this high bounciness value.
Yes. Since they become immovable objects you can still collide as the actor in the physics engine see's them as immovable objects. We did many tests some years ago on this. it has no measured result. this was also explained by the GS Staff to us. I wouldn't have said it if it wasn't true..lol
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
So doesn't equating all physical attributes to zero relieve the cpu from unnecessary calculations?
If the actor is moveable yes. Are we done now...lol
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
haha ok we're done, but I still believe equating the attributes to zero affects performance
you are misunderstanding how box2d works and I've been through this with the GS staff. you are mixing up the fact that an actor is made up of several parts in relation to the physics engine and you assume they are one object, they are not. You have the rigid body and the fixture and together, with moveable turned on, they are called a dynamic rigid body. Each element handles different attributes in Box2d. The rigid body, when moveable is checked off is a highly dense object in relation to physics. when you turn off moveable density and friction are disabled as these are handled by the fixture. so when you turn off moveable you remove the fixture from the rigid body and are left with just a rigid body.
Box2d manual http://box2d.org/manual.pdf
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
Just talked to GeorgeGS and he said what it will do is skip some LUA code if you set it to zero but not related to the physics engine. So depending on game size you could get a very slight advantage.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
@Lost_Oasis_Games said:
Good to know !