godotengine / godotengine/godot
Opening tilemap from godot 3 into 4 displays blank map due to not changing tile_data/layer correctly
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
Reproducible in 4.4.1.stable
### System information
Godot v4.4.1.stable - Pop!_OS 22.04 LTS on X11 - X11 display driver, Multi-window, 1 monitor - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 950 (nvidia; 515.65.01) - Intel(R) Core(TM) i5-2500 CPU @ 3.30GHz (4 threads)
### Issue description
I know tilemaps are deprecated from 3.x to 4.x, but they still work. However, I have just started this process and no matter what I do in Godot with my tilemap scenes it came out blank. I have tried a full conversion, project only conversion, and also tried the various 'convert to tilemap layer' options.
However, I found the problem being the tilemap tscn not being converted properly. To fix it I did this:
1. duplicated the scene file, opened it and added a new tile to the tilemap
2. saved it and noticed it removed all the old tile_data replacing it with a PackedInt32Array containing just three values and it changed tile_data = ... to be layer_0/tile_data = ...
So, I then:
1. opened my backup scene copied the raw vector data in PackedInt32Array into the new one and everything works
So, whatever is in my tilemap scene is causing issues with the godot conversion as compared to other tilemaps. Hopefully this can help pinpoint the issue with the Godot 4 import of TileMap data.
Find attached sample in the attached project.
### Steps to reproduce
1. open the project and open the original tilemaps and observe all tile data is there and valid but the references to the layer is invalid.
2. open the updated tilemap and observe it works just fine, all I did was as above, pasted in the vector data
### Minimal reproduction project (MRP)
Open and follow steps to reproduce, i.e. there are two tilemaps, one I copied and pasted the vector data.
[flipscreen-template2.zip](https://github.com/user-attachments/files/20273446/flipscreen-template2.zip)
Contributor guide
Research direction
Start with the attached flipscreen-template2.zip and reproduce the issue in Godot 4.4.1 by comparing the original and updated tilemap scenes. Inspect how the converted scene stores tile_data and layer_0/tile_data, then verify that conversion preserves the original tile data and displays the map without manual scene edits.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100