Writing my own collision library, I found that both bump.lua and hc have "cells" in their implementations, what are cells for and how can cells improve efficiency or performance?
And are there any other best practices on implementing collisions?
Thanks!
Best practices on implementing collision detection?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- zorg
- Party member
- Posts: 3465
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Best practices on implementing collision detection?
Spatial partitioning basically helps you in one meaningful way: You define smaller areas where you need to test for less objects colliding with each other, instead of testing for all existing objects colliding with all other existing objects.
There is, of course, a tradeoff still; if the "cells" are too large and few, or too small and numerous, it won't have the desired effect; what works for one game is something one needs to experiment out.
There is, of course, a tradeoff still; if the "cells" are too large and few, or too small and numerous, it won't have the desired effect; what works for one game is something one needs to experiment out.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Re: Best practices on implementing collision detection?
The only good reason for writing your own collision system is for simplicity's sake.
You could probably write your own collisions code for something like Flappy bird.
It doesn't make sense for more sophisticated games.
If you want features/performance, you might as well use box2d/love.physics.
You could probably write your own collisions code for something like Flappy bird.
It doesn't make sense for more sophisticated games.
If you want features/performance, you might as well use box2d/love.physics.
Who is online
Users browsing this forum: Google [Bot], Semrush [Bot] and 1 guest