Support Forum

Performance: A* vs NavMesh for open-world building games like Minecraft

Hi, I’m currently making a game like Minecraft where players will be able to place a lot of blocks around the map, and I want the AI to avoid it. The problem is that the game is open-world and the map size is relatively large, there will be a very high number(10k and more) of placed objects that the AI needs to avoid.

For this scenario, would A* or Unity’s default path finding be faster performance-wise?

I don’t know if either navmesh will work very well as navmeshes take a lot of processing to edit, but A* has a layered grid graph in its pro version that might work well for this, but I don’t have the pro version so I can’t say for sure.
the recast graph might be simpler to edit than normal navmeshes, but I’m not sure as this is also a pro version feature

Yeah, a layered grid graph is probably the best approach. It should be fairly fast to update, but I wouldn’t recommend a grid size larger than say 400x400 (though people have used up to 1000x1000 in games, it ends up using a lot of memory for those sizes). A recast graph can work if you need even larger maps.