Since there isn’t a build-in culling in Defold, I need a way to detect offscreen objects for my game called No Nation. I found that the best way of doing this for large amount of moving and static objects is to use dynamic bounding volume hierarchy. So I decided to build my own native extension for this purpose. Right now, I’m using this lib for triggering camera events, general dialogs, activating rooms, culling offscreen objects. I believe it can be used for different purposes like puzzle game logic… It is totally up to your imagination.
Basically, it is a broad-phase collision library and it provides an efficient way of detecting potential overlap between objects of arbitrary shape and size. It is suitable for large amount of moving and static objects(AABBs). DAABBCC is build on Lester Hedges’s AABB.cc library. All credits goes to him.
These looks so technical I know. But in fact, when you understand the main principles it is easy to use. I build a simple platformer game with it. You can examine source of it on Github. Please keep in mind; this little example is not about the gameplay or design. I believe there can be much better ways of using this lib than my terrible example.
If you want to test it, you can find it on itch.io
DAABBCC is not battle tested yet. It may contain memory leaks, performance drops… Also I don’t have a change to test it on different computers/platforms. I roughly tested on iPad 3, i7 mac and a i3 Linux, it works quite well so far.