Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
avatar image
0
Question by The-Little-Guy · Sep 08, 2014 at 11:00 PM · pathfindingsimulationpathfollowingstrategy

Follow Dynamic Path At Runtime

I would really like to make a city builder type of game, but one thing holding me back from doing this is making objects such as cars/trains/etc follow a path that is defined by the player with roads/rails/etc. So I can't really use the editor to make a path, as it needs to be done as the player is playing the game.

What do I need to do to accomplish this type of pathfinding/following?

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

3 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by Kiwasi · Sep 08, 2014 at 11:31 PM

A* is one solution

Waypoints and set paths is another

Comment
Add comment · Show 2 · 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 The-Little-Guy · Sep 09, 2014 at 02:13 PM 0
Share

I looked at a waypoint video, it seems like a good idea. Which solution would you suggest to use? Isn't A* more for finding the shortest way between point A and point B though? For some reason I don't see it being useful in a city builder game. $$anonymous$$aybe it would for finding the shortest path using the waypoints though...

avatar image Kiwasi · Sep 09, 2014 at 07:32 PM 0
Share

You don't really have a good description of your game, so I gave you both options that would work. If your AI needs to choose its path between specific points in your city then A* is your friend. You could easily programme an agent to choose between walking, car, train ect.

If you want a generic train to run up and down the tracks then just set a bunch of way points.

avatar image
1

Answer by Godfather-Games · Sep 09, 2014 at 02:29 PM

A* is a pretty bad solution. A* creates almost perfect paths, that's something you don't want for an AI which behaves like a citizen, car, or whatever. And it isn't a really good solution for calculating dynamic paths.

And yea, don't forget, it needs a lot of memory and can cause CPU problems pretty pretty fast !

You should have a look at recursive backtracking, just google it, there are some articles about it.

But so far, I would recommend you to start using simple waypoints and use their positions for setting up paths.

Comment
Add comment · 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
0

Answer by Reinholdt · Sep 10, 2014 at 07:12 AM

Hi Regarding dynamic paths you might want o take a look at Apex Path it might be a solution you can use for this! https://www.assetstore.unity3d.com/en/#!/content/17943

Comment
Add comment · 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

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

25 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

Related Questions

A* Formations 1 Answer

My "Smooth Rotation" Jerks around randomly when switching between points. 0 Answers

Follow curved path plus also swipes 1 Answer

Movement and animation 1 Answer

When the development team will implement 2D Navmesh? 0 Answers


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