astray.to

moods and the equalizer · 6 min read

Tuning the drive: how custom moods work.

The same road is a delight or a mistake depending on who is in the car. A mood is astray's answer to the question "what do you like?" It is a named, editable set of preferences that turns the map's raw measurements into your kind of route.

in plain words

Same road, different verdict.

Every road in the graph carries fourteen neutral measurements, such as how bendy it is, how close to water, and how far from industry. A mood is the opinion layered on top: one weight per measurement, positive for "seek it out," negative for "steer around it," zero for "don't care." astray ships six to start with:

moodcharacter
BalancedThe default mix: coastline, hills, and quieter roads weighted up; stop-and-go and industry weighted down.
Coast & waterHugs the shoreline: coastline and fresh water dominate, with winding roads rewarded and everything else muted so the detour actually reaches the coves.
Peaks & passesClimbs on purpose: summit views, peaks, grades, and switchbacks weighted up — the mountain-pass mood.
Back roadsSmall quiet roads through farm and hill country: lane-and-a-half pavement, remoteness, and a lean away from roads you already know.
CruiseSmooth and open: strong penalties on stoplights, intersections, and sharp bends; rewards for vistas and coastline.
GentleFor motion-sensitive passengers: bends, switchbacks, and steep grades penalized, the sharpest roads vetoed outright — and it stays close to the fastest route rather than detouring for scenery.
the equalizer

Fifteen sliders, no wrong answers.

Open any mood and you get an equalizer: one slider per measurement, from -1 to +1 in steps of a tenth. Center means "ignore this entirely." Push forest up and woodland roads start winning; pull bend_sharpness below zero and switchbacks start losing. The fifteenth band is familiarity, the one measurement computed privately on your device — and it has a shortcut: the "Avoid roads I've driven" switch in Tune stacks it onto whichever mood is active.

Edits are stored locally in your browser, nowhere else. Tweak a factory mood and your changes ride on top of it, and "restore original" gets the shipped version back untouched. Or copy any mood into a custom preset and build your own from there: the mood for one particular passenger, or one particular kind of Sunday.

under the hood

A mood is a JSON document the engine can prove things about.

There is no magic between the slider and the route. A mood resolves to a small, versioned JSON document called a scoring spec, listing signal names and weights, and it travels in full with every route request. Factory moods are literally entries in one shipped JSON file; your custom preset is the same shape with different numbers. Tuning a factory mood for everyone means editing that file, with no graph rebake and no engine recompile.

On the other end, the engine walks each road's fourteen bytes, multiplies by your weights, and sums. That is a dot product per road, nothing more. Two details keep this stable as the data evolves: sliders left at center are omitted from the wire entirely, and a spec that names a signal the graph does not carry contributes zero instead of failing. Old moods keep working against new bakes, and new signals do not break old moods.

What happens after the dot product: how the combined score is clamped into a safe range and priced against your time budget. The routing engine
when a weight is not enough

The Gentle mood carries a veto.

Weights trade; sometimes you need a rule that refuses to trade. Consider the carsick passenger: give sharp bends a heavy negative weight and the router will usually avoid them, but a spectacular enough coastline can still outbid the penalty and win the route a cliff-hugging switchback section. For a preference, that is fine. For nausea, it is not.

So the Gentle mood uses a second kind of combination rule: a threshold. Any road whose bend_sharpness ranks in roughly the top sixth of the region has its scenic reward zeroed outright, and no amount of forest or ocean can buy it back. The road is not forbidden (sometimes it is the only road), but the router gets no credit for choosing it, so it never goes there on purpose. Gentle then adds ordinary negative weights on bends and grades for everything below the veto line.

The full set of combination rules is deliberately tiny (weighted sums, thresholds, products, minimums) because every rule must have an output range the engine can bound before the search runs. A mood is expressive exactly up to the point where it would make the math unsafe, and no further.

The best way to evaluate a router is to drive it.

There is no account and no tracking. Open it, pick somewhere you've been meaning to go, and give it twenty spare minutes.