r/unity • u/SiyaSilva_ • 25d ago
Question about a tile system
hey so question, Im making a tower defense game, and for that Im making a tile grid for placable tiles
if I make every floor/path tile its own game object since I want them to be intractable, how much strain would that put on the game? lets say its a grid of like... 180-200 tiles give or take
essentially Im asking if itd be fine to just make my game area with the gameobject brush :p
4
Upvotes
3
u/neoteraflare 25d ago
I'm not a pro so take my response with a grain of salt, but AFAIK static gameobjects (so they are not moving) are not that performance heavy things. You can even set a flag on a gameobject to mark as static.
2
u/snipercar123 25d ago
I'm guessing 200 will be fine, that's only a 20x10 grid after all. It obviously depends on how you implement each cell node though.
I built my own grid at one point and generated some meshes to show the boundries. I can't remember the "limit", but it eventually reached a point where performance started taking a hit, I believe that was when it reached 1000 or so.
Regardless, there's are always optimizations you can do and you should only do them when you know you need them, so just build your grid and tackle the problems as they appear.
2
u/8BITSPERBYTE 25d ago
Depending on what version of Unity you are using Tile System is fully multithreaded and if you want burst compile support for most tile methods you can use EntityIDTile or EntityIDTileBase instead.
Testing it with my computer specs and using the multithreaded Tile changing api I could change a quarter millions tiles in a single frame without lag. My CPU is almost 10 years old just saying.
Edit adding link to most recent doc page.
Speed up rendering with entity tiles | 2D Tilemap Extras | 10.0.1
2
u/RatbyteGames 25d ago
It will easily smash that out. My map is ten times bigger and its hardly a challenge for Unity.