DAABBCC - Dynamic Tree(aka AABB Tree) native extension for fast AABB collision detection

I will check it, thanks for clarification! :wink:

1 Like

I had assumed (wrongly, I think) this would help me separate game objects from each other (similar to how dynamic collisions with a gravity of 0 would work). I’m guessing this is something I need to implement on my own, but I’m not sure how.

Can anyone point me in the right direction for how to do this?

I’m not 100% sure what you mean but this extension nothing to do with dynamic collisions. It is just a fast AABB test. You can just check if two(or more) AABBs collide or not. When they collide it is up to you how to separate them. If you are moving your objects by using velocity then you can change it when collision occur.

1 Like

I was referencing dynamic collisions as an example of the type of behavior I want to replicate.

I got the tests working and I think I know how to detect when there’s an overlap/collision. My goal now is to separate them, but I’m not sure how to do that. Changing by velocity is one way. I’m not committed to any specific type of movement yet.

I think this is the behaviour desired:

Taken from:

Note I haven’t tested this myself!

1 Like

Basically, yes. But I can recall this having a lot of jittering the last time I checked it out.

Not sure how it was implemented on @Alex_8BitSkull suggested project but if you want a crowd(flock) control, you can use steering behaviors(separation).

http://www.red3d.com/cwr/boids/

And there are other algorithms which you can implement for increasing performance.

4 Likes

Small update…
2.1.2

  • Internal Update Frequency added. Default value is set from game.project file (display.frequency).
    It is now possible to set a new internal(independent from Defold game loop) update frequency by using aabb.update_frequency().
  • Fixed #9
4 Likes

Since it is a national holiday here, I decided to develop a few more simple/basic examples for DAABBCC (what a terrible name this is!). The first one is Breakout. A stupid Flappy Bird clone is on the way…

Test it: breakout 1.0

Assets by Megacrash.

This is not a historically or logically accurate Breakout clone. It may also contain bugs. This is just a simple example of how to use DAABBCC.

12 Likes

Here is the Flappybird example using DAABBCC

Test it here: flappybird 1.0

I have time for a several more examples but don’t know what to do next yet. Any suggestions?

10 Likes

I made a very simple drag and drop example. DAABBCC is so cool!

6 Likes

Nice! :slight_smile:

2 Likes

Is it normal for this extension to not autocomplete in the editor?

The extension is working. I am getting group ids returned. But the editor is showing errors and it’s not showing the functions when typing aabb.

This project doesn’t have api definitions for Defold Editor. I’m not using the built-in editor and I’m not interesting in adding api definitions . Feel free to contribute and PR.
PS: this has nothing to do with extension itself. It is going to work as expected.

1 Like

Yes, it works great so far. Thank you. Getting used to it now.

I would contribute to the API if I could. A lack of time and skill with working with Defold APIs prevents me from doing so.

It is incredibly easy, just a YAML file.
Documentation is here: Adding editor auto-complete to a native extensions

2 Likes

Thanks. I can probably figure it out within a day or two. Seems simple enough.

1 Like

v3.0 released

Special thanks to 8BitSkull for his support with DAABBCC.

Discussions & Release Notes

Documentation

14 Likes

Wonderful work! Implemented in my current project and appears to be working great. :partying_face:

The migration document is missing one line:

Replace all aabb.query_sort() to daabbcc.query_aabb_sort()

I would have made the change myself but couldn’t see an edit button.

5 Likes

I got error:

Max Query Result Count reached: 32

I guess this means one single query yielded >32 results? Can this max limit be changed somehow? If no, or if it’s a bad idea, can I choose how it is handled perhaps? I can imagine some circumstances where I don’t want this to cause an error, but rather stop listing query results when it exceeds 32.