What would be the best way to do this / How to do this [Procedural Generation]

Hello, I’m currently making a procedurally generated top down shooter. I generate my levels using tiles. For example a tile will hold enemies and structures in 100*100 area. I think the best way to do this would be to have a grid graph pre-rendered for each tile (All tiles are prefabs). But I don’t know how to do this, or if this is the best way, my games is made for mobile so performance has to be at the maximum, thank you.

Hi

Have you checked out the example scene called “Procedural”? Will that solution work for you?

Hello Aron,
I have tried the way you do it in the Procedural scene but the performance is unfortunately not going to work. I need something a bit faster. Because I use tiles that are pre-made would it be better to save grid data in tiles? I don’t need them to be dynamic and I’m not exactly sure how to do this.

Thanks,
Jake

Hi

There is unfortunately no faster out of the box solution. To do it faster you would have to change the Walkable flag on all nodes manually using code and then recalculate their connections (see GridGraph class) and finally use AstarPath.FloodFill to make sure that the graph data is up to date.