The default stage weight: each factor times the aspect of the same name (an unset aspect weighs 1, so a factor on its own is not erased), minus a keepAwayScore penalty for a candidate's distance.
keepAwayScore
distance
import { Aspects, defaultWeigh } from '@datamoc/mw_games/ai';const score = defaultWeigh( { id: 'charge', action: {}, factors: { aggression: 3 } }, { aspects: new Aspects({ aggression: 2 }) },);console.log(score); // 6 Copy
import { Aspects, defaultWeigh } from '@datamoc/mw_games/ai';const score = defaultWeigh( { id: 'charge', action: {}, factors: { aggression: 3 } }, { aspects: new Aspects({ aggression: 2 }) },);console.log(score); // 6
The default stage weight: each factor times the aspect of the same name (an unset aspect weighs 1, so a factor on its own is not erased), minus a
keepAwayScorepenalty for a candidate'sdistance.