- Home /
Procedural Tilemap Lag
I'm making a 2D game with a camera that focuses on a screen's worth of world space at a time. This camera smoothly slides over to an adjacent screen using linear interpolation when the player character leaves the "focus" area. The world itself is procedural, tilemap-based, and very bare-bones at the moment, with either nothing or a simple test tile in each square. The test tile is stored as a variable using Resources.Load when the game starts. Whenever the camera switches its focus to a new screen, old tiles are cleared and new tiles are generated in a radius around it using simple Perlin noise.
The problem comes when the camera flips to a new screen and a 192x144 range of terrain made up of 16x16 tiles is generated at once. I've confirmed that the math isn't the issue, because when most or all of the tiles are air or were already set to the solid test tile, the transition is smooth. However, when numerous empty tiles are set to the test tile, which is most of the time, there's a very noticeable lag spike between screens that completely ruins the look and feel of the camera movement. I have some ideas for a fix, but input and suggestions would be appreciated.
Your answer
Follow this Question
Related Questions
Best way to make a big 2D map as smooth as possible? 1 Answer
Why are tilemaps so bad ? 2 Answers
2D Tilemap Collisions 1 Answer
Some questions about the Tilemap API 1 Answer
Get position from Isometric TileMap 1 Answer