Page 1 of 1

Collision detection performance

Posted: Wed Oct 22, 2014 6:25 pm
by calebkemper
Hi all, new to LOVE and Lua, looking to start some cool gaming projects. :)

Before I start, can anybody tell me what algorithms LOVE uses for collision detection? and how about performance?

This has always been the major roadblock when I have worked on previous projects, so I want to get this information up-front.

Cheers,

Caleb

Re: Collision detection performance

Posted: Wed Oct 22, 2014 6:46 pm
by Tjakka5
Hubo is currently writing a blog about how to make a physics engine, which of course covers collision detection and handling.
Link: http://hugobdesigner.blogspot.com.br/20 ... ngine.html

For performane it's best to try and optimize the collision detection as much as possible, and try to not have it even try to detect it if it's not possible.

Re: Collision detection performance

Posted: Wed Oct 22, 2014 7:33 pm
by calebkemper
Thanks for the link!

But did I misinterpret what functionality LOVE has? I understand it implements collision callbacks, but it must be using some algorithm for deciding which entities to check against each other for possible collision?

EDIT: If someone could point me to the code that implements the above, I could definitely do a complexity analysis myself.

Cheers

Re: Collision detection performance

Posted: Thu Oct 23, 2014 5:25 am
by ivan
The physics module in Love is Box2D: http://box2d.org/
Box2D uses space partitioning to reduce the number of collision checks.
I'm not sure but you can set collision filters which MIGHT improve performance a little bit.
For example you can set collision filters that will ignore collisions between bullets in your game.

Re: Collision detection performance

Posted: Thu Oct 23, 2014 5:27 am
by micha
LOVE has the love.physics module, which implements Box2d. This module can be used for collision detection. However, if you are going for a really simple game, then you should rather implement collision detection yourself or use one of the libraries made by community members (HardonCollider and bump). These libraries have less overhead and can be expected to be faster, if they fit your needs.