Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Feb 16, 2018 at 11:49 AM by Pangamini for the following reason:

Too subjective and argumentative

avatar image
0
Question by Pangamini · Feb 15, 2018 at 11:22 AM · navigation

Pathfinding to unknown location

Is it possible to have a different goal than to reach certain point? For example, reach any point that matches some given criteria? For example, I might want my agent to find the nearest and most suitable resource point, nearest water etc

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

  • Sort: 
avatar image
0

Answer by Zodiarc · Feb 15, 2018 at 03:10 PM

You could hold a list of positions to each of the desired objects. Then if you command your agent to find for example the nearest resource point, you sort the resorce point array by distance to your agent and pick the first element.

Comment
Add comment · Show 6 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Pangamini · Feb 15, 2018 at 03:15 PM 0
Share

Well, there are no desired objects. $$anonymous$$aybe I just want to find a most favorable spot. When A* traverses the cells, it scores each cell. Usually that's based on the distance to the target, but this could be anything. The goal is usually to reach certain point, but again this could be anything. I want to avoid implementing my own finding algorithm, because I'd have to bake my own data, implement my own dynamic obstacles, etc..

avatar image Zodiarc Pangamini · Feb 15, 2018 at 03:25 PM 0
Share

A* does need a starting and an ending point. Of course you could let it calculate paths to all objects on the map and pick the shortest one, but this wouldn't be very fast. I made an implementation of A* which adjusts dynamically to terrain and obstacles (obstacles can be also added on runtime, but since the grid is pre-generated removing them will cause weird effects).

avatar image Pangamini Zodiarc · Feb 15, 2018 at 03:42 PM 0
Share

Well, the point of A* is basically floodfilling the grid, scoring each cell and optionally using some heuristics to guess how prioritize the floodfill. But the endpoint is just one option how to end the process. You could simply search for any cell that matches your criteria.

Show more comments
avatar image Cherno · Feb 16, 2018 at 11:39 AM 0
Share

Some pathfinding solutions implement a "cost" for each node, allowing for different terrain modifier etc. Astar Pathfinding Project is one example.

Follow this Question

Answers Answers and Comments

75 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

UI: Execute action instead of "Navigation" 0 Answers

How can I control UI navigations with Release only interaction with new input system ? 0 Answers

My NavMeshSurface appears as calculated, but seems unusable 1 Answer

Automatic nav mesh generation 2 Answers

Getting a navmeshagent back on a navmesh. 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges