Portponky / better-terrain

Terrain plugin for Godot 4
The Unlicense
432 stars 21 forks source link

TileMap is deprecated in Godot 4.3 #86

Open Renari opened 2 months ago

Renari commented 2 months ago

It looks like this is being moved to TileMapLayer

https://docs.godotengine.org/en/latest/classes/class_tilemaplayer.html

Portponky commented 2 months ago

Correct, I have some plans to update the plugin, but I am rather busy right now. I hope to get something ready before 4.3's release.

Portponky commented 1 month ago

I'm progressing with 4.3 development on the tile-map-layers branch. My plan is to deprecate all use of TileMap node and move entirely to the new TileMapLayer, but create a new "Better Terrain 4.2" branch/plugin which maintains the TileMap node stuff on the 4.2 branch. There's no way to make it backwards compatible because of the new TileMapLayer type.

Some of the improvements for 4.3 include much easier access to the grid and layer highlight functions. I should be able to fully implement those for the new version, which is probably the no. 1 most requested feature.

Portponky commented 1 month ago

I've updated the branch with the layer highlight and grid buttons. The layer change buttons flicker a little, I couldn't quite figure out how to harness Godot's plugin logic to keep the plugin visible. All functional, though.

Portponky commented 1 month ago

I have done some work to reduce the flicker. If anyone wants to test the branch and give me feedback, it would be much appreciated. Otherwise, I will merge it back when 4.3 is released.

Renari commented 1 month ago

I tested the changes for my use case, unfortunately for me when I changed over some of my TileMap nodes to TileMapLayer I did lose all the level data, but my only hand-made map was fairly basic, my main use is generating terrain changesets and then applying them in chunks which continued to work with the new changes.

I opened up a PR updating the function signatures for the C# wrapper in https://github.com/Portponky/better-terrain/pull/87

Portponky commented 1 month ago

Thanks for the PR. The terrain info is stored in the TileSet, I guess that gets reconstructed when changing over to TileMapLayer nodes. It might be possible to avoid this by saving the TileSet as a resource.

Renari commented 1 month ago

I'm not sure if that would work, it seems the data is now being stored as a PackedByteArray instead of a PackedInt32Array. But that isn't a problem with better-terrain anyway, there's probably discussion over on the Godot GitHub about it or it'll be in the patch notes.

nihiluis commented 1 month ago

Does that mean that all tilemaps will have to be recreated? Will there be an automated migration path?

Portponky commented 1 month ago

If 4.3 invalidates all previous metadata, yes, but it's probably just a dev branch issue.