-3
\$\begingroup\$

This a a weird question.

I'm making a game in unity. I have a grid of columns and the height of the columns is changing (lerping) randomly (just cus it looks cool!) I was wondering could I procedurally generate some sort of 2d contour map, then each column would take its height from the contour map, that way nearby columns would be similar in height. Also how would I then get this contour map to fluctuate and change randomly?

If my grid of columns is 10x10 that means this contour map can also be just a 10x10 array with only 100 data points. Can anyone think of a cheap way of achieving something like this?

\$\endgroup\$
1
  • 3
    \$\begingroup\$ Welcome to gamedev.stackexchange. This site's format prefers that you attempt to create the thing you are describing, and ask a question if you are having a specific technical problem. It is discouraged to ask questions that essentially ask other people to write your code for you. So, edit your question to include what you have already tried. \$\endgroup\$ Apr 22, 2013 at 1:18

1 Answer 1

0
\$\begingroup\$

Overlay a grid on every n'th cell horizontally and vertically, and initially assign each of theses a random value. Interpolate the remaining cells to get the smoothness you are after. On every m'th cycle assign a new random height to each overlay cell, but migrate to it over the full m cycles.

A refinement would be to "roll" the timing of assigning new target heights across the map, one row (or column) at a time.

This should give you a nice smooth "rolling" effect for your terrain. By tuning the parameters a bit the effect would give your characters time to react to changes, while having to remain alert

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .