Disabling Density, Friction, Bounciness and Movable of background actors.

3absh3absh Member Posts: 601
edited April 2016 in Working with GS (Mac)

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

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    edited April 2016

    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.

  • 3absh3absh Member Posts: 601

    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.

  • SocksSocks London, UK.Member Posts: 12,822

    @abuabed84 said:
    So unchecking movable makes the other physical attributes equal to zero, are you sure?

    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.

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    edited April 2016

    @abuabed84 said:
    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.

    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

  • 3absh3absh Member Posts: 601

    Yes. Since they become immovable objects you can still collide as the actor in the physics engine see's them as immovable objects.

    So doesn't equating all physical attributes to zero relieve the cpu from unnecessary calculations?

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    @abuabed84 said:

    Yes. Since they become immovable objects you can still collide as the actor in the physics engine see's them as immovable objects.

    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

  • 3absh3absh Member Posts: 601

    If the actor is moveable yes. Are we done now...lol

    haha ok we're done, but I still believe equating the attributes to zero affects performance

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    edited April 2016

    @abuabed84 said:

    If the actor is moveable yes. Are we done now...lol

    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

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    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.

  • SocksSocks London, UK.Member Posts: 12,822

    @Lost_Oasis_Games said:

    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.

    Good to know ! :)

Sign In or Register to comment.