Create random tunnels

What methods could we use to create a random tunnel similar to the one in this classic helicopter game ? In addition, it should be smooth and allow you to move around it, while looking as natural as possible (not too symmetrical, but not too distorted), it should also:

  • The most important thing is to be infinite and let me control its thickness over time - to make it narrower or wider, as I consider it necessary, when I consider it necessary;
  • Ideally, it should be possible to efficiently generate it with smooth curves rather than rectangles, as in the above game;
  • I need to know in advance what its boundaries are, so I can detect collisions and generate bonuses in the tunnel;
  • Any other properties that allow you to control it or offer optimization options are welcome.

Note: I do not ask which one is better or what this game uses, which could cause an extended discussion and be subjective, I just ask about some methods that others know or have used before or even think that they can work. That's all, I can take it from there.

Also asked a gamedeva . I think it is suitable in both places, since it is a matter of algorithm, since it is a matter of gamedev, IMO.

+5
source share
2 answers

, , , . , , , , . . , .

Béziers, 4 . , ; , - , , 2 ; , , ; , , . ( 1- 4- , " ".)

Béziers 2 , :

  • , , .
  • Bézier , 2 -Béziers. /.

EDIT: " " " ".

+3

(, , ), 2 , , . :

     _  
_         _    _

     _         _
_         _    

. , , , . , JavaScript: http://explored.tk/experiments/monotone/

UPD: ​​, .

+2

All Articles