Jump to content

  • Log In with Google      Sign In   
  • Create Account


Hill Climb Terrain


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
7 replies to this topic

#1 anupgupta   Members   -  Reputation: 112

Like
0Likes
Like

Posted 11 November 2013 - 08:18 AM

Hello

 

Iam making a game similar to hill climb racing game for iOS and andriod. Below is the link.

 

 

I was kind of wondering how to make a endless terrain, keeping the terrain structure/pattern same everytime, even if the user resets the game and plays again. not like a random terrain generation..but generation one terrain with same pattern, but endless. similar to the game link above.

 

 

Any Suggestions. 



Sponsor:

#2 Álvaro   Crossbones+   -  Reputation: 10630

Like
0Likes
Like

Posted 11 November 2013 - 08:37 AM

Use pseudo-random numbers using always the same seed. That should do it.



#3 anupgupta   Members   -  Reputation: 112

Like
0Likes
Like

Posted 11 November 2013 - 09:25 AM

Hello Alvaro,

 

Please can you explain in a more detail way..with some samples. :)



#4 swiftcoder   Senior Moderators   -  Reputation: 8081

Like
0Likes
Like

Posted 11 November 2013 - 09:31 AM

The general term for what you are asking for is "procedural generation".

 

That is usually a decent term to punch into Google.


Tristam MacDonald - SDE II @ Amazon - swiftcoding        [Need to sync your files via the cloud? | Need affordable web hosting?]


#5 anupgupta   Members   -  Reputation: 112

Like
0Likes
Like

Posted 12 November 2013 - 08:03 AM

what i am keen on knowing is how do i generate a fixed patterned endless terrain. so, even if i reset the game, the pattern of the terrain is same as before and endless.


Edited by anupgupta, 12 November 2013 - 08:05 AM.


#6 Álvaro   Crossbones+   -  Reputation: 10630

Like
0Likes
Like

Posted 12 November 2013 - 08:31 AM

what i am keen on knowing is how do i generate a fixed patterned endless terrain. so, even if i reset the game, the pattern of the terrain is same as before and endless.

 

That's the part I answered. You figure out a way of transforming pseudo-random numbers into a patterned endless terrain. Then make sure you start your pseudo-random numbers with the same seed every time, and you'll get the same pattern.

 

If that's still not clear, try to ask the question differently.



#7 ferrous   Members   -  Reputation: 935

Like
0Likes
Like

Posted 19 November 2013 - 08:40 PM

Most random functions have a parameter for a seed.  Once seeded with that number, they will return the same sequence of numbers.  So for example, if you were calling rand() for the height for every x meters and then creating a line out of that (or a spline for curves, a catmull rom spline would work well for creating a curved line), as long as you always passed in the same seed, you'd get the same line.



#8 TheComet   Members   -  Reputation: 1141

Like
0Likes
Like

Posted 20 November 2013 - 05:51 AM

To give you an example of where this is used, have you ever seen this website?

http://www.minecraftseeds.info/

 

MineCraft uses procedural generation for its worlds. Every time you create a new world, you are given the option to enter a seed, or leave it blank. If you leave it blank, the seed is randomly generated. If you enter a number, the world generated from the number you enter will always be the same, so that's kind of a way of sharing worlds with your friends.


YOUR_OPINION >/dev/null





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS