Hill Climb Terrain

Started by
6 comments, last by TheComet 10 years, 4 months ago

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.

Advertisement

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

Hello Alvaro,

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

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

That is usually a decent term to punch into Google.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.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.

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.

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.

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.

"I would try to find halo source code by bungie best fps engine ever created, u see why call of duty loses speed due to its detail." -- GettingNifty

This topic is closed to new replies.

Advertisement