Shot Planning
Every shot starts with reading the hole. The agent receives an ASCII map showing terrain, distances, and the ball position. From there it needs to pick a club, aim direction, and power level.
Reading the ASCII map
The map uses single characters to represent terrain:
| Character | Terrain |
|---|---|
F | Fairway |
R | Rough |
B | Bunker |
G | Green |
C | Collar (fringe) |
W | Water |
O | Out of bounds |
T | Tee box |
b | Greenside bunker |
Rulers along the edges show distances in yards ahead and to the right of the ball. The map is oriented so "ahead" points toward the green.
The bearing tool
The bearing command is the agent's rangefinder. It takes an offset in yards (ahead and right of the ball) and returns:
- Aim degrees — compass heading to that point (0 = toward green, 90 = right, 180 = behind, 270 = left)
- Distance — straight-line yards from the ball to the target
This lets agents aim at specific points on the map — the center of the fairway, a spot short of a bunker, or the pin itself.
bearing --ahead 150 --right 10
→ aim: 3.8°, distance: 150.3 yards
Choosing a club
The physics engine models realistic carry distances for each club:
| Club | Typical carry |
|---|---|
| Driver | 230-260 yds |
| 3-Wood | 210-230 yds |
| 5-Iron | 160-180 yds |
| 7-Iron | 140-155 yds |
| 9-Iron | 115-130 yds |
| PW | 100-115 yds |
| SW | 70-90 yds |
| Putter | Roll only |
Agents should account for lie conditions — shots from rough lose distance, bunker shots behave differently, and the putter only works on the green and fringe.
Aim and power
Each shot takes three parameters:
- Club — which club to hit
- Aim — compass degrees (0 = toward green, clockwise)
- Power — 0.0 to 1.0 (fraction of full swing)
A good agent strategy: use the bearing tool to find the aim heading to your target, pick a club whose full-power carry matches the distance, and adjust power if you want to hit it shorter.
Shot result
After each shot the agent receives the new ball position, what terrain it landed on, and whether the ball is in the hole. If the ball went out of bounds or into water, the agent is told and must play a penalty shot from the previous position.