Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8614817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:12:48+00:00 2026-06-12T05:12:48+00:00

What methods could we use to generate a random tunnel, similar to the one

  • 0

What methods could we use to generate a random tunnel, similar to the one in this classic helicopter game? Other than that it should be smooth and allow you to navigate through it, while looking as natural as possible (not too symmetric but not overly distorted either), it should also:

  1. Most importantly – be infinite and allow me to control its thickness in time – make it narrower or wider as I see fit, when I see fit;
  2. Ideally, it should be possible to efficiently generate it with smooth curves, not rectangles as in the above game;
  3. I should be able to know in advance what its bounds are, so I can detect collisions and generate powerups inside the tunnel;
  4. Any other properties that let you have more control over it or offer optimization possibilities are welcome.

Note:
I’m not asking for which is best or what that game uses, which could spark extended discussion and would be subjective, I’m just asking for some methods that others know about or have used before or even think they might work. That is all, I can take it from there.

Also asked on gamedev. I think it fits in both places, since it’s as much an algorithm question as it is a gamedev question, IMO.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T05:12:49+00:00Added an answer on June 12, 2026 at 5:12 am

    I think you could use Bézier curves for the tunnel walls, because they have the property that each end of the curve is tangent to the line segment between the last two control points at that end. This means it’s possible to generate curves lazily, appending them as you go, without creating sharp corners. You only ever need to buffer one off-screen segment. As soon as its leftmost edge appears on-screen, create the next off-screen segment.

    If you use cubic Béziers, you need 4 control points. The 1st will necessarily be the same as the last control point of the previous segment; to preserve smoothness at the junction, the 2nd will need to be somewhere on the line containing the previous segment’s last 2 control points; the 4th will be where you want this curve to end; and the 3rd can probably be chosen freely. (You may want to keep it horizontally between the 1st and 4th points, to avoid the possibility of the curve “doubling back”.)

    Béziers have 2 other properties that will simplify your implementation:

    • The curve is completely contained within the convex hull defined by the control points, so it’s easy to ensure there’s a gap between the top and the bottom curves.
    • You can split a Bézier at any point to produce 2 sub-Béziers. This is handy for rasterising/linearising.

    EDIT: Replaced “bounding box” with “convex hull”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this method call I have to use... financial_document.assets.length But financial_document.assets could be
I remember seeing somewhere that you could call python methods from inside C using
I find myself wishing an interface could be composed of methods that are fulfilled
I want to use the <operation>Asnyc methods rather than the Begin<operation>/End<operation> on my WCF
Suppose I wish to have 2 functions, one that generates a random integer within
Normally in an ASP.NET view one could use the following function to obtain a
I certainly can't use the random generator for that. Currently I'm creating a CRC32
In my application, I require a function to generate (unpredictably) random values that differ
I need to generate a random number, now this number needs to be somewhere
I've inherited a rather large application that really could use some cleanup. There is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.