- Home /
Best pathfinding for large open world
Hey !
I'm working on a large open world game, where the player can set up shelter. If I'm correct, Unity requires all gameobjects to be static for the built in navigation to work ? If so, can I instantiate the shelter and then make it static, or do I need a dynamic alternative ?
And it needs to be suitable for a large open world, I've seen many examples on alternatives but only on 20x20 maps. Any ideas ?
im not entirely sure if i understand the question what is the particular use case for your pathfinding? do u want the player to be able to navigate to/from the shelter?, there are alot of methods of path finding and it would definitely help to know exactly what it is your trying to achieve.
Hey !
Sorry for the poor description. I want AIs to roam to certain waypoints with pathfinding, and when the user gets close to the AI I want the AI to follow the player also with pathfinding.
Answer by Anxo · Jan 13, 2015 at 08:52 PM
Objects do not all have to be static to block pathfinding. If you are talking about Nav Mesh, you can use NavMesh Obstticles to have AI avoid the objects. http://unity3d.com/learn/tutorials/modules/beginner/navigation/navmesh-obstacles
Alternatively, you can always just write your own AI using raycasts.
Answer by ROLLERROCK · Jun 08, 2015 at 03:11 PM
Hi,
actually i think that for an open world game pathfinding wouldn't be the best solution i recommend you experiment with waypoints(predefined or random) or random movement ie altering its path with the obstacles which come its way.
Answer by Cherno · Jan 13, 2015 at 10:25 PM
If you use Aron Granberg's Astar Pathfinding Project, you can assign any mesh, including procedurally generated ones, to it's NavMesh graph at runtime. You can also combine meshes beforehand to make a bigger one for that purpose.
Can you link or explain how A* Nav$$anonymous$$esh graph works ? I've checked A* site, but couldn't fully understand it ? Do you have to make the terrain in a 3D program and then export it to Unity ? Thanks for the suggestion !
It's "Astar", not A*. A* is just the general algorithm, the Astar Pathfindign Proejct is Granberg's implementation for Unity. As I wrote in m,y first comment, you can use any existing mesh for the a Nav$$anonymous$$esh graph, or create one at runtime and pass it to the graph, it doesn't matter as all graphs can be updated at runtime.
Answer by Reinholdt · Jan 14, 2015 at 12:58 PM
Hi AndreasC
Apex Path could be another solution https://www.assetstore.unity3d.com/en/#!/content/17943 it supports adding and removing dynamic obstacles and works with procedural worlds! plenty of tutorials to get started http://apexgametools.com/apex-path-tutorials/
Your answer
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
How can I access the scene's NavMesh in code? 0 Answers
How to build a custom shape NavMesh Area 1 Answer
Movement and animation 1 Answer
iPhone build doesn't copy existing files in Application.dataPath or .persistantDataPath?! 0 Answers