1
\$\begingroup\$

I have a simple 2D version of Mini-golf. The goal is to manage to clear each level in the least amount of shots, the ball is bouncing at most 3 times (stops on the 4th hit) from a wall but not reducing in speed, there is no out of bounds and no obstacles that would remove the ball. Now I would like to add some water/ instant death obstacle at the most annoying places.

How do I find those places?

The player can aim in a 360 radius, if I set the goal of managing a given level in 2 shots, there are 129,600 ways of how the player could shoot the ball. While it should be possible to simulate all of those shots fairly easy, I don't want to add randomly water and check if the level is still possible to clear, rather simulate the level, record all places the ball went over and place on the spots with the most hits water.

What is the best strategy/ a good algorithm to blockade the most ways but to guaranty that at least one way stays clear?

Does the strategy change significantly if moving obstacles (on a fixed path, same rule for bouncing as normal wall) are included?

\$\endgroup\$
1
  • \$\begingroup\$ Choose x amount of random paths, and make sure, you don't place anything there. Decrease x over time \$\endgroup\$
    – Bálint
    Apr 22 '16 at 10:56
1
\$\begingroup\$

You could approach the problem from the opposite direction:

  1. Start with an empty level
  2. Generate a random path with n puts, where each put consists of m reflection points (the higher the difficulty, the larger the values for n and m)
  3. Generate an apropriate reflector at each of the reflection points.
  4. Place some random obstacles on the direct lines between the start/end-points of the puts, but not on the path itself.
\$\endgroup\$
1
  • \$\begingroup\$ This is close to what I said on the comments. \$\endgroup\$
    – Bálint
    Apr 22 '16 at 12:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.