Do you want to work on this issue?
You can request for a bounty in order to promote it!
Use TileMapLayer for Godot exports as opposed to deprecated TileMap #4106
csueiras posted onGitHub
Describe the bug
Tiled exports to Godot using the TileMap
node which has been deprecated (https://docs.godotengine.org/en/stable/tutorials/migrating/upgrading_to_godot_4.3.html#id4).
I think the change on the plugin is small-ish, it currently produces this:
[node name="01" type="Node2D"]
[node name="TileMap" type="TileMap" parent="."]
tile_set = ExtResource("TileSet_0")
format = 2
layer_0/name = "Ground"
layer_0/tile_data = PackedInt32Array(...)
We want:
[node name="01" type="Node2D"]
[node name="Ground" type="TileMapLayer" parent="."]
tile_set = ExtResource("TileSet_0")
use_parent_material = true
tile_map_data = PackedByteArray(...)"
So the primary complexity is implementing the change from the int32 array into the data format in the byte array.
I'm not sure if the specs are documented anywhere, but the Godot code is easy enough to follow as a spec (https://github.com/godotengine/godot/blob/9aed9eca40127bcf21ecd71d25fe8809f345d9e3/scene/2d/tile_map_layer.cpp#L2844) and the marshaling functions are defined here https://github.com/godotengine/godot/blob/9aed9eca40127bcf21ecd71d25fe8809f345d9e3/core/io/marshalls.h.
To Reproduce Steps to reproduce the behavior:
- Export a map to Godot
- Open map in Godot
- See deprecation warning for the use of a
TileMap
node
Expected behavior The export should not produce a deprecation warning.
Specifications:
- OS: macOS
- Tiled Version: 1.11.0
Not exactly sure if this is a bug or a feature request, please feel free to re-label.