Random tilebased Dungeons - Best practice?

I’m working on a dungeon crawler game (like eye of the beholder) with tile based levels / movement, where i want to create random dungeons.

Currently i have created 2 prefabs (floor / wall tile) and i tried to create a 15 x 15 area out of these tiles via

GameObject.Instantiate( Resources.Load("prefabname"), ......) 

to load the prefabs, which is really slow…

What’s the best approach here? Create clones of existing tiles via Instantiate instead of loading them via Resources.Load ?

I doubt this would be fast enough to create bigger levels, especially on mobile devices…

I’ve also seen someone (youtube tutorial) creating meshes via script and texturing them, which seems to be really fast. Is this the best way to do this?

I don’t want to use an existing dungeon generator or something, much more fun figuring out everything myself. Just need a little push in the right direction :slight_smile:

How do other people create tile based levels (via script)?

I am too working on a Random tile-based dungeon game and just released a demo on the Asset store if you’re interested!

If you are interested in purchasing this I could also supply some tile based movement script! Good luck!

I did it the following way: 1. cut all map on squares, each square is a prefab, which store all containing gameobjects data 2. each visible square dynamically loaded using Resources.Load 3. when prefab is loaded, it immediately getting from pool all its gameobject and setting its data.

So basically saying square prefab contains only gameobjects data like position inside square\scale\rotation but not gameobject itself. That’s why each square is very lightweight and could be loaded very fast during runtime. When square become invisible it gets unloaded and all containing gameobjects return to pool. Consider splitting loading\unloading each square for different frames, for example you need to load 5 new squares and unload 5, then next 5 frames unloading one squre per frame and after loading new squares the same way.