feat(@projects/@magic-civilization): add promotion weights to player states

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
Natalie 2026-05-04 01:49:19 -04:00
parent a64edaebf2
commit 000043d946
8 changed files with 33 additions and 52 deletions

View file

@ -521,10 +521,6 @@ mod tests {
trade_willingness: 3.0,
grudge_persistence: 7.0,
}
,
promotion_offense_weight: 1.0,
promotion_defense_weight: 1.0,
promotion_mobility_weight: 1.0,
}
fn blackhammer_priors() -> PersonalityPriors {
@ -536,10 +532,6 @@ mod tests {
trade_willingness: 2.0,
grudge_persistence: 9.0,
}
,
promotion_offense_weight: 1.0,
promotion_defense_weight: 1.0,
promotion_mobility_weight: 1.0,
}
fn iron_vs_bh() -> [PersonalityPriors; MAX_PLAYERS] {

View file

@ -360,11 +360,10 @@ mod tests {
strategic_axes: ::std::collections::BTreeMap::new(),
race_id: None,
strategic_resources: Vec::new(),
promotion_offense_weight: 1.0,
promotion_defense_weight: 1.0,
promotion_mobility_weight: 1.0,
}
,
promotion_offense_weight: 1.0,
promotion_defense_weight: 1.0,
promotion_mobility_weight: 1.0,
}
fn state(current: u8, map: TacticalMap, players: Vec<TacticalPlayerState>) -> TacticalState {

View file

@ -826,11 +826,10 @@ mod tests {
strategic_axes: ::std::collections::BTreeMap::new(),
race_id: None,
strategic_resources: Vec::new(),
promotion_offense_weight: 1.0,
promotion_defense_weight: 1.0,
promotion_mobility_weight: 1.0,
}
,
promotion_offense_weight: 1.0,
promotion_defense_weight: 1.0,
promotion_mobility_weight: 1.0,
}
fn state(current: u8, players: Vec<TacticalPlayerState>) -> TacticalState {

View file

@ -640,11 +640,10 @@ mod tests {
strategic_axes: ::std::collections::BTreeMap::new(),
race_id: None,
strategic_resources: Vec::new(),
promotion_offense_weight: 1.0,
promotion_defense_weight: 1.0,
promotion_mobility_weight: 1.0,
}
,
promotion_offense_weight: 1.0,
promotion_defense_weight: 1.0,
promotion_mobility_weight: 1.0,
}
fn state(current: u8, turn: u32, players: Vec<TacticalPlayerState>) -> TacticalState {

View file

@ -405,11 +405,10 @@ mod tests {
strategic_axes: ::std::collections::BTreeMap::new(),
race_id: None,
strategic_resources: Vec::new(),
promotion_offense_weight: 1.0,
promotion_defense_weight: 1.0,
promotion_mobility_weight: 1.0,
}
,
promotion_offense_weight: 1.0,
promotion_defense_weight: 1.0,
promotion_mobility_weight: 1.0,
}
fn base_state(map: TacticalMap, players: Vec<TacticalPlayerState>) -> TacticalState {

View file

@ -31,11 +31,10 @@ fn raider() -> PersonalityPriors {
capture_weight: 0.6,
ransom_accept_threshold: 0.3,
destroy_civilian_aggression: 1.4,
promotion_offense_weight: 1.0,
promotion_defense_weight: 1.0,
promotion_mobility_weight: 1.0,
}
,
promotion_offense_weight: 1.0,
promotion_defense_weight: 1.0,
promotion_mobility_weight: 1.0,
}
fn merchant() -> PersonalityPriors {
@ -49,11 +48,10 @@ fn merchant() -> PersonalityPriors {
capture_weight: 1.2,
ransom_accept_threshold: 0.9,
destroy_civilian_aggression: 0.4,
promotion_offense_weight: 1.0,
promotion_defense_weight: 1.0,
promotion_mobility_weight: 1.0,
}
,
promotion_offense_weight: 1.0,
promotion_defense_weight: 1.0,
promotion_mobility_weight: 1.0,
}
fn expansionist() -> PersonalityPriors {
@ -67,11 +65,10 @@ fn expansionist() -> PersonalityPriors {
capture_weight: 1.5,
ransom_accept_threshold: 0.6,
destroy_civilian_aggression: 0.6,
promotion_offense_weight: 1.0,
promotion_defense_weight: 1.0,
promotion_mobility_weight: 1.0,
}
,
promotion_offense_weight: 1.0,
promotion_defense_weight: 1.0,
promotion_mobility_weight: 1.0,
}
#[test]

View file

@ -41,11 +41,10 @@ fn ironhold_priors() -> PersonalityPriors {
wealth: 3.0,
trade_willingness: 3.0,
grudge_persistence: 7.0,
promotion_offense_weight: 1.0,
promotion_defense_weight: 1.0,
promotion_mobility_weight: 1.0,
}
,
promotion_offense_weight: 1.0,
promotion_defense_weight: 1.0,
promotion_mobility_weight: 1.0,
}
fn blackhammer_priors() -> PersonalityPriors {
@ -56,11 +55,10 @@ fn blackhammer_priors() -> PersonalityPriors {
wealth: 2.0,
trade_willingness: 2.0,
grudge_persistence: 9.0,
promotion_offense_weight: 1.0,
promotion_defense_weight: 1.0,
promotion_mobility_weight: 1.0,
}
,
promotion_offense_weight: 1.0,
promotion_defense_weight: 1.0,
promotion_mobility_weight: 1.0,
}
fn make_root_state() -> GameRolloutState {

View file

@ -89,11 +89,10 @@ fn player0_fixture() -> TacticalPlayerState {
strategic_axes: ::std::collections::BTreeMap::new(),
race_id: None,
strategic_resources: Vec::new(),
promotion_offense_weight: 1.0,
promotion_defense_weight: 1.0,
promotion_mobility_weight: 1.0,
}
,
promotion_offense_weight: 1.0,
promotion_defense_weight: 1.0,
promotion_mobility_weight: 1.0,
}
/// Player 1 — two spearmen adjacent to player 0's warrior.
@ -163,11 +162,10 @@ fn player1_fixture() -> TacticalPlayerState {
strategic_axes: ::std::collections::BTreeMap::new(),
race_id: None,
strategic_resources: Vec::new(),
promotion_offense_weight: 1.0,
promotion_defense_weight: 1.0,
promotion_mobility_weight: 1.0,
}
,
promotion_offense_weight: 1.0,
promotion_defense_weight: 1.0,
promotion_mobility_weight: 1.0,
}
/// Two-player state with player 0 as the active player.