How to display a tile map efficiently?

Hello everyone,

I have a pretty general question. I’m wondering what the most efficient way in Unity would be to display a tile map. I’m writing an online game and in my case, the client gets the tile data from the server after login, and then instantiates tiles based on that data.

I am aiming for a view distance of 500 tiles in any direction, so 1001x1001 concurrent tiles, over 1 million in total. Each tile has 4 vertices.

So I figured it would be better to make the tiles part of the scene and move them to wherever I want after the login and assign a material, instead of instantiating them by code. But even instantiating 20,000 tiles takes forever, and the Unity Editor is practically not responsive after I do that.

Does anyone have any hints how I should go about this?

Thanks for your help.

You can’t have that many objects - you need to build them in chunks. Make a 50x50 mesh, copy-paste it as necessary. You can build meshes at runtime or just assign their uvs at runtime, but Unity just can’t handle 20,000 objects being created at once.