Quick answer: Godot 4 TileMap cells set via script not rendering until you move the camera? Quadrant update is deferred - call notify_runtime_tile_data_update or force_update_internals.
Procedural map generates 1000 cells via set_cell. They draw correctly only after the player walks past them.
Force the update
tilemap.notify_runtime_tile_data_update()
tilemap.update_internals()Quadrants rebuild lazily based on visibility. The forced call sets every quadrant dirty so the next draw includes them.
Set cells in batches
Each set_cell tags one quadrant dirty; the batched API is faster. Group changes by chunk size (16x16 default).
Check quadrant size
Quadrant size = 16 cells by default. For dense procedural maps, drop to 8 - smaller quadrants update faster on partial changes.
“TileMap is render-on-demand. Procedural generation has to ask explicitly.”
For runtime-generated maps, build a dedicated GenerationStep that batches all set_cells, then notifies once at the end. Frame-rate is steadier than per-cell.