Tile Map collisions on wrong tiles (when tile map is too large ?) (DEF-3687) (SOLVED)

Hey everyone,

I got some weird collision issues today while I was working on a new Tile Map.

There is one plain blue tile I selected as an obstacle within the collision group (painted as red on the editor) of the associated Tile Source.

Now my character is colliding with every tiles (the ground itself, anything…) unless I move this blue tile outside of the collision group !

It might be something related to Tile Map layers, as no collision works for any tile in the lowest layer…

Do someone knows if there might be an issue with the collision group ?

Thank you!

How strange… are you able to zip the project up and share it here? Hard to diagnose otherwise.

1 Like

As it is a very big multiplayer project, I just created a new Defold project with a few tiles but the same tilemap layout to reproduce it, but I didn’t had the issue.

I told myself the issue could only happen because of the tilemap… so I recreated the map from scratch on Tiled (I use it and then export maps to .tilemaps with the Tiled Defold plugin), and exported it again.

I no longer have the issue now. Maybe I messed up with tilesources or something, I don’t know…

Sorry for that !

EDIT: This is no longer relevant, I managed to reproduce the issue, please check the answer below.

2 Likes

Hey, I’m back and I managed to reproduce the issue!
It looks like to happen when the Tile Map is very large or the tile is widely used.

You can test it by loading the attached project. Right from starting the game, the character collides with a tile that it should not collide with.
If you just remove the blue tile from the blocker collision on the Tile Source, it’s not colliding anymore.
(note: Moving the character is possible with the arrow keys.)

I had to modify a tutorial project to test it quicky, but it is enough to see the issue (I printed a message on collision):
RPG map sample.zip (3.4 MB)

I’ll take a look and get back to you.

3 Likes

Yup, that does indeed look like a bug. Created DEF-3687 and added it to our sprint planning session today. I can’t promise that this will be included in the current sprint though.

4 Likes

Thanks for the heads up!

1 Like

Am seeing similar behavior:

Collisions incorrect when my tilemap exceeds approx. size 100x100.

  • Tilemap has (static) collision shape set to a tilesheet, where one of the tile types is not in the collision mask.
  • After increasing the size (say 150x150) a kinematic collision object starts colliding in tile regions
    containing non-collision tiles.

Aside, what is Defold’s performance SLO for handling collisions with large tilemaps (i.e. any upper bound on tilemap size)?
Are there performance differences using multiple small tilemaps positioned adjacently, or using one large tilemap?

Thanks

This issue will be fixed in the release on Monday.

1 Like

Released in 1.2.146

2 Likes

Re-downloaded Defold and reproduced issue in 1.2.146.

1 Like

@0xfe Could you setup a simple repro case and share with us?

1 Like

@sven Toy example attached.

Try moving the white block around, falling down gaps, etc. Scene has gravity.
Brown tiles collide. Black tiles should not.
Initial load uses a smaller map with no collision issues.
Press ‘2’ to switch to a larger map. ‘1’ to switch back.

defold-prototype - Copy.zip (667.8 KB)

1 Like

@sven any issues with repro?

Sorry for the lack of communication! I think @jhonny.goransson took a quick look at it while he was investigating another tile map issue, not sure if it was related?

Nah, those issues seemed unrelated. Need to dedicate more time to it I think. We had a similar issue recently but this is something else :frowning:

1 Like