DAABBCC Tilemap Collisions?

Hullo Defold Forum,

So I’ve recently installed DAABBCC into my engine to improve processing with bullets for bullet hell.
I was disappointed to discover that it crashed upon launching the engine. To my surprise, the problem turned out to be tilemap-shaped collision objects.
image
It turns out that DAABBCC doesn’t like that, and spits out an error like so:

ERROR:CRASH: CALL STACK:

ERROR:CRASH:  0 0x7FF7610824C0 dmCrash::GenerateCallstack D:\a\defold\defold\engine\crash\src\backtrace_win32.cpp:144

ERROR:CRASH:  1 0x7FF761401DF4 raise /tmp/job364840798743129662/minkernel/crts/ucrt/src/appcrt/misc/signal.cpp:547

ERROR:CRASH:  2 0x7FF7613F4C6C abort /tmp/job364840798743129662/minkernel/crts/ucrt/src/appcrt/startup/abort.cpp:71

ERROR:CRASH:  3 0x7FF7613F3EB8 common_assert_to_stderr<wchar_t> /tmp/job364840798743129662/minkernel/crts/ucrt/src/appcrt/startup/assert.cpp:186

ERROR:CRASH:  4 0x7FF7613F39DC _wassert /tmp/job364840798743129662/minkernel/crts/ucrt/src/appcrt/startup/assert.cpp:443

ERROR:CRASH:  5 0x7FF76100CCA0 b2DynamicTree::InsertLeaf /tmp/job364840798743129662/upload/daabbcc/src/DynamicTree/b2DynamicTree.cpp:384

ERROR:CRASH:  6 0x7FF76100CC00 b2DynamicTree::CreateProxy /tmp/job364840798743129662/upload/daabbcc/src/DynamicTree/b2DynamicTree.cpp:117

ERROR:CRASH:  7 0x7FF76132D2D0 b2BroadPhase::CreateProxy D:\a\defold\defold\engine\physics\src\box2d\Box2D\Collision\b2BroadPhase.cpp:45

ERROR:CRASH:  8 0x7FF761260040 b2Fixture::CreateProxies D:\a\defold\defold\engine\physics\src\box2d\Box2D\Dynamics\b2Fixture.cpp:154

ERROR:CRASH:  9 0x7FF76125DD60 b2Body::SetActive D:\a\defold\defold\engine\physics\src\box2d\Box2D\Dynamics\b2Body.cpp:506

ERROR:CRASH: 10 0x7FF7611CD660 dmPhysics::SetEnabled2D D:\a\defold\defold\engine\physics\src\physics\physics_2d.cpp:1100

ERROR:CRASH: 11 0x7FF76118F760 dmGameSystem::CompCollisionObjectAddToUpdate D:\a\defold\defold\engine\gamesys\src\gamesys\components\comp_collision_object.cpp:881

ERROR:CRASH: 12 0x7FF7610D3790 dmGameObject::DoAddToUpdate D:\a\defold\defold\engine\gameobject\src\gameobject\gameobject.cpp:1068

ERROR:CRASH: 13 0x7FF7610D26F0 dmGameObject::InitCollection D:\a\defold\defold\engine\gameobject\src\gameobject\gameobject.cpp:1769

ERROR:CRASH: 14 0x7FF761055D30 dmGameObject::ResCollectionRecreate D:\a\defold\defold\engine\gameobject\src\gameobject\res_collection.cpp:316

ERROR:CRASH: 15 0x7FF7610C2F30 dmResource::DoReloadResource D:\a\defold\defold\engine\resource\src\resource.cpp:1404

ERROR:CRASH: 16 0x7FF7610C2040 dmResource::Dispatch D:\a\defold\defold\engine\resource\src\resource.cpp:731

ERROR:CRASH: 17 0x7FF761132BD0 dmMessage::InternalDispatch D:\a\defold\defold\engine\dlib\src\dlib\message.cpp:542

ERROR:CRASH: 18 0x7FF7610BE6C0 dmResource::UpdateFactory D:\a\defold\defold\engine\resource\src\resource.cpp:749

ERROR:CRASH: 19 0x7FF761139AC0 dmEngine::StepFrame D:\a\defold\defold\engine\engine\src\engine.cpp:1490

ERROR:CRASH: 20 0x7FF761134CF0 dmEngineUpdate D:\a\defold\defold\engine\engine\src\engine.cpp:2098

ERROR:CRASH: 21 0x7FF76113A4E0 dmEngine::RunLoop D:\a\defold\defold\engine\engine\src\engine_loop.cpp:83

ERROR:CRASH: 22 0x7FF761070320 engine_main D:\a\defold\defold\engine\engine\src\engine_main.cpp:148

ERROR:CRASH: 23 0x7FF7613B8174 __scrt_common_main_seh d:\agent\_work\4\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288

ERROR:CRASH: 24 0x7FF8102C7600 BaseThreadInitThunk <unknown>:0

ERROR:CRASH: 25 0x7FF810902680 RtlUserThreadStart <unknown>:0

ERROR:CRASH: 

Is this an issue that anyone else has had before? I would like to know.

-ZaTimou

I’m not sure what you did, but DAABBCC doesn’t support build-in components like ‘Collision Shape
It is not a physics engine!.
You can read more here: https://github.com/selimanac/DAABBCC

If you are looking for a fast tile raycast you can use this one: https://github.com/selimanac/defold-tile-raycast
Or if you want more advance box2D physics:
https://github.com/Lerg/extension-box2d
https://github.com/d954mas/defold-box2d

1 Like

Like Selim wrote the two things are unrelated. You’re using tilemaps as collision shapes? Anything else? Can you recreate the crash in a minimal project?

2 Likes

Yes this would be very helpful. I suspect that same box2D functions may collide with each other.

2 Likes

Yes, I believe if you just make a collection with a game object that has a collision object with the shape of a tileset, it will crash.

1 Like

No, I’m pretty sure that works, but I’d like to be proven wrong!

Well, that seems to be the only thing that crashes the engine. If I leave it in, it crashes, and as soon as I remove it, it works completely fine.
I wonder if it has to do with the file that actually holds the collision shapes…?

Could you please share a minimal repo case so I can take a look?

Okii, I went and did a little more testing, and discovered the problem.
It turns out DAABBCC doesn’t like it when there is multiple layers in different Z positions on the same tilemap, which was what was causing the crash in my project. Tiles don’t need to be placed to replicate the crash.

Since I don’t know how to work GitHub very well, I’ll just put the minimal project here:
aaaa.zip (13.5 KB)

2 Likes

I take a sneak peek to your project and I’m sure it is because the conflict between this extension’s header and Defold’s box2d header. I’m surprised see that header files from extensions registered before Defold’s headers. Since they are guarded with ifndef it will not define Defold’s header.

It is not possible to mix daabbcc with build-in Box2D right now. I’ll take a look as soon as I got free time.

1 Like

The idea behind the extension system is that you can override previous behavior (e.g. removing libraries, setting flags etc)
One way to solve it in DAABBCC, is for the extension to add namespaces around your classes. It’s tedious, but that way it won’t conflict with our version.

Another way is of course on the user side, to remove the build physics from the build via an app manifest.

5 Likes

Good idea, thank you

2 Likes