Tonight I’ve finished the first pass at implementing the function to refresh the base shot, for use when you are landscaping your beautiful course. Right now it needs to be triggered manually via a button, but once I refine it a bit it will happen automatically if you place a tile in the “path” of the course. Time for pictures!
Here we have a first pass at refreshing the base shot of the course. The origin point of the red/blue/yellow lines are the end/begin point of every stroke. These lines are the directions we cast a ray when trying to find eligible tiles for the shot. It looks only for green/hole/fairway tiles at the moment, as that’s where the player would be regularly aiming for:
With 441m for a Par 5, this is slightly on the shorter end, so it could theoretically land on the green with 3 shots without a terrible amount of effort.
Next I tweaked the fairway a bit, and refreshed the course again:
The slight change in layout produced a slightly larger course in the same area, rising up to 450m. But this shows one limitation of the current system: If the angle of the yellow/red lines was smaller, we would have been able to hit the green in our third shot, instead of necessitating a fourth shot to be in a better range. Or even, upon finding the hole, exploring the nearby tiles to find the extent of the green, so that we could have a better decision. Maybe I could reduce the angle of the check/tweak number of rays based on distance to the hole. So further away strokes can explore the area better for possibilities, while nearby strokes need to be more specific towards the hole. Or even simply adding the neighbours of the tiles to the list would suffice. I’ll test this tomorrow!
Still, I didn’t really want the course to fall down that side, so I changed it once again:
This produced an even shorter course (potentially), much more straightforward, and easier. A very short Par 5, barely a Par 5 even. Extremely easy, but I like it, as it provides some good base to increase difficulty, specially on the first stroke. It barely lands on the fairway, so less confident golfers might instead burn a stroke on getting to the earlier fairway patch first, to get into a better position. And I could add a bunker at the entrance, like below:
Now this would really discourage less confident golfers, as the position of the bunkers ups the stake in case of a mistake, and would reward confident golfers who were able to land the shot, making them feel great and more willing to pay the price of membership. Capitalism, yo!
That’s it for today! Tomorrow I’ll automate the base shot generation process, to reduce clicking amount, and improve the function further so that it can make better decisions when mapping out the course. Afterwards, I’ll make it detect if there’s hazards on the way, so as to avoid and look for a better alternative. Maybe ace golfers would try the hazard shortcut, but the base shot isn’t for them anyway!
Til next time!