Hi.
I'm playing with tile based 3D levels in Godot 4 alpha. I'm struggling with performance hits.
I tried to use GridMap node. It was very promising until I got a huge performance drop after making a place with bunch of trees. And what I noticed is that Performance is going down with when GridMap is getting bigger. Also I had issues with tile offsets, rotation and collisions. I read that GridMap is creating a new mesh(es) and does not work with transforms applied to tiles. Moreover, I cannot use visibility ranges nor bake occluders for GridMap.
Today I've created a prototype of custom importer for TMX files (Tiled Level Editor) and changed a way of generating a 3D level.

Instead of using GridMap my importer is creating a new scene with nodes placed in correct positions. Each node corresponds to a tile from TMX layer.

TileSet is a simple scene with childs, where each node acts as a tile by it's number. These tiles are duplicated during import, and placed on a new scene. Without duplication I cannot add objects to a new scene.

Advantages:
- rendering seems to by way faster than GridMap
- occluders can be baked with OccluderInstance3D (it does not work for GridMap)
- visibility ranges can be set per tile
- no problems with tile offsets, rotation, collisions; tiles can be positioned properly
- no issues with updating - just do reimport and reload a scene (GridMap seems to be buggy and can give strange results sometimes)
Disadvantages:
- this approach is memory consuming; map of size 256x256 is crashing Godot while loading due to out of system memory (16GB)
- for a map of size 128x128 baking occluders is crashing due to out of memory (but not all system memory is consumed; it probably hits some kind of internal heap limit)
- TileMap scene created by importer contains large amount of nodes, which can introduce a new class of performance issues
So as you can see I can't build a medium sized world, and I'm trying to find a way to optimize this. I have an ideas about splitting maps into smaller chunks (that's obvious), reducing polys, using portals and rooms (when they will be ported to 4.x), but I wonder is there anything else I can improve? I also thought about doing some clusering with MultiMeshInstance3D, as a tradeoff between flexibility and performance, somehow similar to GridMap's octants but preserving ability for baking occluders and apllying visibility ranges with fades.
I'll appreciate any ideas and hints.
Regards,
Marcin