better-terrain icon indicating copy to clipboard operation
better-terrain copied to clipboard

TileMap is deprecated in Godot 4.3

Open Renari opened this issue 1 year ago • 9 comments

It looks like this is being moved to TileMapLayer

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

Renari avatar May 04 '24 00:05 Renari

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 avatar May 05 '24 00:05 Portponky

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 avatar May 09 '24 08:05 Portponky

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 avatar May 11 '24 23:05 Portponky

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.

Portponky avatar May 13 '24 22:05 Portponky

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

Renari avatar May 14 '24 09:05 Renari

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.

Portponky avatar May 14 '24 10:05 Portponky

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.

Renari avatar May 14 '24 10:05 Renari

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

nihiluis avatar May 20 '24 11:05 nihiluis

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

Portponky avatar May 20 '24 12:05 Portponky

Hi, 4.3 has been released. Has anyone done an upgrade from 4.2 to 4.3? Did you have to make any manual changes or can the migration path be used?

nihiluis avatar Aug 15 '24 14:08 nihiluis

I'll update the plugin branches tonight and the asset library versions. I'm not sure how updating will go, but it should be reasonably painless (I hope).

Portponky avatar Aug 15 '24 15:08 Portponky

Thank you very much! I thought the update was already done in the dev branch, that's why I asked already.

nihiluis avatar Aug 15 '24 15:08 nihiluis

Just wanna say thanks! I saw 4.3 got released officially this morning, crazy impressive you're already on updating this plugin.

As a side note, if you can update the Readme to note the supported versions of Godot that'd be great -- the terrain tab wasn't showing up on my 4.1.3 build, but upgrading to either 4.2 or 4.3 fixed the issue.

tlifke avatar Aug 15 '24 16:08 tlifke

Hi, 4.3 has been released. Has anyone done an upgrade from 4.2 to 4.3? Did you have to make any manual changes or can the migration path be used?

I did update from 4.2 to 4.3 and I had to recreate my tilesets but this was well before to official release, hopefully that is no longer required and simply opening the project in 4.3 does that migration.

Renari avatar Aug 15 '24 16:08 Renari

The main branch has been updated to work with TileMapLayers now that Godot 4.3 is released. The 4.2 branch has the TileMap code for maintenance. This is updated in the Godot Asset Library which has the main plugin (TileMapLayers) and a 4.2 version (TileMaps).

Portponky avatar Aug 16 '24 18:08 Portponky