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 Abdulaziz · Jun 17, 2013 at 10:24 PM · terrainmobilerunninggenerateendless

Endless Running game random generator ?

Hello i am working on mobile game and it's endless running game and it's about trying avoid traps as far as you can .. and i have problem about how i can make the terrain generate to become endless ?

Photo from the terrain :

alt text

...

example.png (180.3 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

3 Replies

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

Answer by Jamora · Jun 17, 2013 at 10:50 PM

The following would be my approach to making a game like this:

1) Setting the camera culling distance to however far I want the player to see ahead.
2) At each level start, I would instantiate a pre-generated level stub (possibly a prefab) that consists of parts.

3) Grow the stub by adding pieces to the end of the level. My initial approach would be to instantiate a piece at the end when the player steps on a new piece.

The hardest part is probably getting the piece generation logic implemented so that the levels 'make sense'.

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 Korayementality · Aug 12, 2013 at 07:30 PM

You'll have to Instantiate() the ground/platforms/terrain/land as the player goes forward. Depending on the platforms' size and gameplay nature you can choose to:

  • Instantiate platform prefabs already created but randomly placed, ordered, and repeated. (Take Subway Surfers as an example) OR

  • Instantiate smaller platform blocks like in Minecraft, also randomly placed, ordered, and repeated but it would be trickier.

These are the two ways I can think of atm.

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 0bliter8or · Dec 09, 2013 at 06:34 AM

You have probably worked this out by now, but in case some one else comes to look at this.

  1. Endless running games like this take a slightly different view of the world, instead of moving the player, move the terrain. What the player sees as moving forward is actually the world moving backward (this avoids issues with floats getting too large).

  2. Once you wrap your head around that you will need to create an empty game object write up a level segment generating script and attach it. line up a enough of these to exceed the players viewing distance.

  3. Now to create the illusion of never ending terrain. In the update method of the level segment generating script have a condition that detects when the player is sufficiently in front of the segment, when this happens it must remake itself into a new random section of track and move itself to the front of the track. This is both effective and efficient. (I'm only new to Unity3D so I cant give any specific technical details but I have used this method in other games development environments.)

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

17 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

Related Questions

procedure generate terrain using a Jpg 1 Answer

Using bump maps on a terrain on mobile platforms. 0 Answers

Terrain scaling at runtime 0 Answers

big terrain performance && mobile 1 Answer

Terrain into Model 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