6 ms·
Seems to me like it's trivial to detect that a hole is impossible/really hard.
by Jyaif 9y ago
Seems to me like it's trivial to detect that a hole is impossible/really hard.
- TillE 9y agoRight. I don't know how you would write a reasonable procedural generator in the first place without that kind of sanity check. With that heuristic in place you just generate mostly random stuff and throw out what doesn't work. Writing a generator that works about 99.9% of the time must require painful tweaking.
- gambiting 9y agoHow is it trivial?
- codeulike 9y agoHow would you do it then? Run every possible sequence of hits? That's not going to work, too many possibilities. Level 17509 was reckoned to be impossible for a long time but then someone did it.
- Simon_says 9y agoActually, I did this for a 3-D minigolf game I made about 20 years ago. The algorithm isn't hard. You have a rather small parameter space of possible hits (direction plus velocity). In my game it was a 3-dimensional parameter space. For his, it would be a 2-dimensional parameter space. The output is the distance from the hole to the ball when it stops moving. This is just a minimization problem. Try a bunch of experiments and refine the better ones. Worked for me. It is technically true that it's possible there might be a solution that your search won't find. But I never found an example of that occurring for my game. So if you follow this, you may inadvertently throw out a hard level that has a solution, but you'd never present the player with a level that has no solution.