godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.17k stars 21.2k forks source link

2D: TileMap Autotiler Collissions #45873

Open SaffronStreams opened 3 years ago

SaffronStreams commented 3 years ago

This issue seems related to https://github.com/godotengine/godot/issues/24003, but still present (regression error?)

I'm running Godot 3.2.3.stable, on Windows 10.

I have set up a TileMap Autotiler, 3*3 Minimal, but run into an issue at the corners. At first my collisions were set up to use ConvexPolygonShape2Dss (the default), but I ran into the issue of my character not being able to stand in the corner. And if approached from above they would get stuck without getting an (on_floor).

AutotilerIssue4

After looking around for issues I found a partial solution in converting the respective tiles collision to ConcavePolygonSHape2Ds.

AutotilerIssue3

However, this seems to lead to another issue where the collision are no longer visible in debug mode, and with enough speed items / the player will just fall (partially) through and get stuck.

AutotilerIssue2

Calinou commented 3 years ago

@SaffronStreams Please upload a minimal reproduction project to make this easier to troubleshoot.

SaffronStreams commented 3 years ago

I did a minimal project. Left bottom corner has concave collision, which either seems to remove the collision or only make it 1px thick perhaps? When objects approach at high enough speed (here I put the rigid with 25 times gravity, in my game it triggered when my main character was at 4/5 max falling speed (a KinematicBody2D in the character's case)) they fall through. On the other side I left it on convex, but then the shape is probably altered to make it convex so the collision sticks out from the expected shape.

In my game I have "gotten around" the problem by making all my Tiles fill the whole tile, so I only ever need to use one type of collision. However, since the button is there I suspect this is not expected behavior?

TileMapMinimalReproduce.zip