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 EscTheCtrl · May 27, 2015 at 01:26 AM · randomprocedural generationinfiniterunner

2d Random object placement help?

So, I have a game I'm working on that I want to be an endless runner, but I want the obsticles to be randomly placed... Basically the game is you going down a snowy slope and you have to avoid trees, Being an endless runner type of game, I want the obsticles to be Randomly placed only thing is, I'm not sure how I would do this, I tried making 3 different areas that stuff could spawn (Left and Right Edges that spawns very thick obsticles, then the Center that spawns very few.) But this caused basically a strait line of trees and rocks and looked very Linear.. I'm kind of hoping for something looks like the picture below.

alt text

If anyone has any ideas on how I could go about doing this, or any tutorials that would show/explain how to do something like that I would really appreciate it! Thanks!

screenshot-1.png (73.1 kB)
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
0

Answer by cjdev · May 27, 2015 at 02:12 AM

One method of generating a look of pseudo-randomness is to separate your random placement into segments to create a more distributed look that still preserves the feel of unpredictable variation. It's a little hard for me to describe so I made the following image to illustrate:

alt text

Basically, you create sections and populate those with your random points in order to control the density of points in any given area. In your application you could have areas in the middle of the lane have fewer points spawn but areas on the borders have greater points spawn. The edges of your course would be defined by the position of whatever shapes you chose to contain the portions with the highest density of points (the 'Many Random Points' boxes in the image above).

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

20 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

Related Questions

Spawning objects in infinite scroller game 0 Answers

Random instantiation endlessly? 1 Answer

Making a randomizer script for a basic "Runner" game... 1 Answer

Infinite Runner Tutorial - Destroyer Problem 2 Answers

Procedural runner level creation 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