The named tuning knobs of a heuristic AI - Wesnoth's "aspects" - read by whatever stage is
scoring candidates. mwg ships no values, because the numbers are game content: a side sets
aggression, caution, village_value, keep_away and the rest to whatever its own balance
wants, and a difficulty level overrides a few of them.
Typed readers give a stage a usable number without every caller casting: a missing aspect reads
as the fallback (1 for a weight, so an unset aspect is neutral rather than zeroing a score).
The named tuning knobs of a heuristic AI - Wesnoth's "aspects" - read by whatever stage is scoring candidates.
mwgships no values, because the numbers are game content: a side setsaggression,caution,village_value,keep_awayand the rest to whatever its own balance wants, and a difficulty level overrides a few of them.Typed readers give a stage a usable number without every caller casting: a missing aspect reads as the fallback (
1for a weight, so an unset aspect is neutral rather than zeroing a score).Example