I’m currently working on a large open world game(map is 11000x14000 meters in game). The Unity built in navigation require every singel gameobject to be static, which might be bad, but what does static mean in terms of gameobjects ?
What’s the best solution for large open world games ?
A gameobject being static basically means that it doesn’t move. By marking a gameobject as ‘static’, you can have the Navmesh Agent to react to static gameobjects (walk around them, jump over them etc.). Also, marking gameobjects as static allows them to be affected by lightmapping. (It would also be best to mark any object that doesn’t move static, as it can improve your performance quite a bit.)
“Static batching is only available in Unity Pro for each platform.”
Taken from Unity - Manual: Draw call batching
You sure about static batching in indie?
Oh, scratch that, then. I thought I read somewhere it’s in Unity Free as well. So it’s the other way around; Static is Unity Pro, Dynamic is Unity Indie.
For really big games, you need some sort of hierarchical pathfinding, where you do a coarse path check and then refine it as you go. The idea is that if you are traveling from SF to NYC, you first see if it’s possible, then plan a route like SF->Denver->Chicago->New York and then you do detailed pathfinding to figure out exactly how to get from SF->Denver, Denver->Chicago, etc.
Implementing that can be quite tricky especially do to it in a manner than is performant and low memory. Unless you’ve written a lot of pathfinding code, you should probably buy a solution from the asset store.
ya unity navmesh flat doesn’t work for large worlds. I’m working with worlds that average 80 terrains of 1000x1000 per scene, unity won’t even bake that half the time.
But like jpthek9 said, grids are great for this. Just move the grid around with your player, recalc every now and then if needed. You have to work around issues such as 3d structures, but you can easily setup some of your own waypoint logic to handle the edge cases like moving through gates with ceilings, in and out of buildings, etc…
Aron Granberg’s grid graph works fairly well for this, it’s what I’m using now.