Autotiling extremely slow at runtime - alternatives?

Godot Version

4.2.1

Question

Hi. I’m trying to use Set_cell_terrain_connect at runtime to display tiles in a procedurally generated world, split into 3x3 chunks of 50x50 tiles.

Set_cell_terrain_connect() is the function used to do this, but as the performance is extremely slow, I’m looking for another alternative.

  • Not doing this at runtime is not an option
  • Building the tilemap on a separate thread apart from the scene tree then adding it later is not an option, as interacting with the scene tree from a thread is not safe, and neither is just editing a TileMap on a thread at all.
  • Performing the calculation work for the tiles on a thread, and then setting them on the main thread is not an option, as the actual function set_cell_terrain_connect is slow.

So I don’t really see any good options. I’d rather not switch to a different engine if I can avoid it.