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 timcommandeur · Mar 15, 2014 at 10:20 AM · randompathgenerationvoxel

Generating random paths

Hey all,

Im working on a voxel engine game and I want to generate random paths throughout the world. I already have random hills and mountains by using perlin noise. But is there some kind of standard algorithm for generating random paths / veins?

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

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by whydoidoit · Mar 15, 2014 at 11:26 AM

Hmmm, well there are algorithms but they can be pretty arduous to implement and slow performing.

For a quick solution your best bet might be to create an overlaid grid of waypoints and then connect them based on their reachability to their 8 immediate neighbours. If you modify the world you would update the connection points. After that you would use A* to find your route between them. When you are in the proximity of a waypoint you'd use some simple testing to reach a destination in that neighbourhood.

The other way of doing this is by overlaying a grid and creating full connectivity. Your A* algorithm then adds vertical height change as a cost when it finds a path which will drive your characters to follow level paths where possible - this leads to natural looking behaviour that you can actually prewarm to erode paths and play with textures. I describe a grid based A* here: http://unitygems.com/astar

I use "The Sims" style advertisments to provide my characters with random destinations. Basically you place objects in the world that advertise their ability to satisfy some need. The easiest of these being "something to do" which just has the character wander there.

You choose an advertisment based on the needs of the character (so if they're hungry then find food, if they're bored find something to do), the ability of a location to service that need (so if you're really hungry you visit a cafe rather than two dozen blueberry bushes) and the distance to the location (so if you are really hungry and next to a blueberry bush you would eat there first, then move on to the cafe).

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

21 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

Related Questions

Generate random path in grid 1 Answer

Unity Voxel Terrain and structures 0 Answers

Random Room Generator 1 Answer

Code to randomly generate a mesh? 0 Answers

how can i make randomly generated worlds with collectable resources 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