Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Removing contacts with state == MOVING will increase performance. Do you use them?

JohnJohn Admin Mod
edited December 2013 in Beta Posts: 616

I'm currently trying to improve the performance of physics in Codea. I've improved the collide() callback performance but I've noticed that the main issue when there are many collisions is moving contact callbacks. These are contacts where state == MOVING. I've found aren't very useful except for visualising the position of current contacts.

I've made it so cached contacts will continue to update over their lifetime so you can put contacts you want to observe in a table and then refer to them later until they are destroyed. This eliminates the need for moving contact callbacks and will result in better performance.

My question is, does anyone use these callbacks and would it be a problem if they were removed?

Comments

  • IgnatzIgnatz Mod
    Posts: 5,396

    No and no

  • Posts: 2,820

    @John - No, not really. That being said, I think that you should add a boolean value you can flip on each object to turn these options on.
    To tell you the truth, this might be one of the highlights of Codea v2 (or whatever). That also explains a common crash in my game. I've noticed that if you stack multiple planks on top of each other (about 5+), Codea slows down to about 1 FPS and eventually crashes, freezes, or you get lucky and the contacts release and you loose the game.
    Thanks a lot!

Sign In or Register to comment.