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 Noobyhead99 · Feb 24, 2015 at 01:32 PM · terrainperlin noise

How would one approach tile-by-tile terrain generation with Perlin Noise?

Recently a number of friends and I have been working on a top-down, 2D military company management game (think Rimworld, Prison Architect), and we've gotten to the point where we need to start on terrain generation and we're completely stumped.

After a bit of research I've decided that the most standard way to generate said terrain would be through Perlin Noise, which works well for us, however we can't seem to grasp how Mathf.PerlinNoise works, nor do we think the noise it generates looks very smooth, so instead we're looking more at the LibNoise.Unity library.

Almost all of the examples for this library are for heightmap generation and the like (with one exception, which was an unanswered topic of someone having this exact same question), nor have we been able to find any clear documentation on how we would implement the following basic terrain generation system:

(I know the term 'pixels' for a set of Perlin Noise values isn't strictly correct, bear with me)

  1. Generate a*a pixels of a random(!) sample of Perlin Noise, one for each tile in the game.

  2. If a value of a pixel is >0.75, for example, that tile becomes rubble/destroyed vehicles/impassable barriers. alt text

  3. Repeat step 1 for a new set of Perlin Noise, then for each value that is >0.75, that tile becomes water. alt text

  4. Repeat step 1 for a new set of Perlin Noise, for each value that is >0.75, that tile becomes solid rock. alt text

  5. Repeat these steps for however many different things you need to have.

  6. Anything else becomes grass. alt text

In the end, it would look something like this (rough drawing, technically the rocks and water and such should be uniformly offset but I didn't take the time to line them up with the grass) alt text

Could anyone point us to any examples that cover this sort of thing, or if not, any reasonably comprehensible documentation for someone new to terrain generation? Any snippets that might help us are highly appreciated, as are any tips on how we could improve this system.

Cheers!

Comment
Add comment · Show 1
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 maccabbe · Feb 24, 2015 at 01:50 PM 0
Share

To make perlin noise change at a slower rate, take samples from a smaller area. For instance, for location x,y try using $$anonymous$$athf.PerlinNoise(x/16, y/16) ins$$anonymous$$d of $$anonymous$$athf.PerlinNoise(x, y)

0 Replies

· Add your reply
  • Sort: 

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

2 People are following this question.

avatar image avatar image

Related Questions

2D Efficient Realtime Terrain Generation 0 Answers

How exactly is Perlin Noise implemented? 4 Answers

Terrain and PerlinNoise Glitch 0 Answers

How can I generate terrain as integers using perlin noise? 1 Answer

Procedural Island Terrain Generation 2 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