feat(gpu): ✨ Optimize AI simulator GPU structures for 12-player capacity with personality priors and relation handling
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
f8f56878b6
commit
8e822d49a2
4 changed files with 20 additions and 17 deletions
|
|
@ -624,7 +624,7 @@ mod tests {
|
|||
fn iron_vs_bh() -> [PersonalityPriors; MAX_PLAYERS] {
|
||||
let iron = ironhold_priors();
|
||||
let bh = blackhammer_priors();
|
||||
[iron, bh, iron, bh, iron]
|
||||
[iron, bh, iron, bh, iron, bh, iron, bh, iron, bh, iron, bh]
|
||||
}
|
||||
|
||||
fn make_entry() -> AbstractRolloutState {
|
||||
|
|
@ -632,8 +632,8 @@ mod tests {
|
|||
pod.players[0].gold = 100;
|
||||
pod.players[0].pop_total = 5;
|
||||
pod.players[0].city_count = 1;
|
||||
pod.players[0].force_rel = [0, 20, 0, 0, 0];
|
||||
pod.players[0].relations = [0, -1, 0, 0, 0];
|
||||
pod.players[0].force_rel = [0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
||||
pod.players[0].relations = [0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
||||
pod.players[0].rng_state = 0xAAAA_BBBB_CCCC_DDDD;
|
||||
pod.players[0].turn = 1;
|
||||
pod.players[1].gold = 50;
|
||||
|
|
|
|||
|
|
@ -64,8 +64,8 @@ fn make_root_state() -> GameRolloutState {
|
|||
pod.players[0].gold = 100;
|
||||
pod.players[0].pop_total = 5;
|
||||
pod.players[0].city_count = 1;
|
||||
pod.players[0].force_rel = [0, 20, 0, 0];
|
||||
pod.players[0].relations = [0, -1, 0, 0];
|
||||
pod.players[0].force_rel = [0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
||||
pod.players[0].relations = [0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
||||
pod.players[0].rng_state = 0xAAAA_BBBB_CCCC_DDDD;
|
||||
pod.players[0].turn = 1;
|
||||
pod.players[1].gold = 50;
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@ fn ironhold_priors() -> PersonalityPriors {
|
|||
promotion_offense_weight: 1.0,
|
||||
promotion_defense_weight: 1.0,
|
||||
promotion_mobility_weight: 1.0,
|
||||
building_priors: mc_ai::tactical::state::BuildingPriors::default(),
|
||||
..PersonalityPriors::default()
|
||||
}
|
||||
}
|
||||
|
|
@ -59,7 +58,6 @@ fn blackhammer_priors() -> PersonalityPriors {
|
|||
promotion_offense_weight: 1.0,
|
||||
promotion_defense_weight: 1.0,
|
||||
promotion_mobility_weight: 1.0,
|
||||
building_priors: mc_ai::tactical::state::BuildingPriors::default(),
|
||||
..PersonalityPriors::default()
|
||||
}
|
||||
}
|
||||
|
|
@ -69,8 +67,8 @@ fn make_root_state() -> GameRolloutState {
|
|||
pod.players[0].gold = 100;
|
||||
pod.players[0].pop_total = 5;
|
||||
pod.players[0].city_count = 1;
|
||||
pod.players[0].force_rel = [0, 20, 0, 0];
|
||||
pod.players[0].relations = [0, -1, 0, 0];
|
||||
pod.players[0].force_rel = [0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
||||
pod.players[0].relations = [0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
||||
pod.players[0].rng_state = 0xAAAA_BBBB_CCCC_DDDD;
|
||||
pod.players[0].turn = 1;
|
||||
pod.players[1].gold = 50;
|
||||
|
|
@ -80,7 +78,8 @@ fn make_root_state() -> GameRolloutState {
|
|||
|
||||
let iron = ironhold_priors();
|
||||
let bh = blackhammer_priors();
|
||||
let priors: [PersonalityPriors; MAX_PLAYERS] = [iron, bh, iron, bh, iron];
|
||||
let priors: [PersonalityPriors; MAX_PLAYERS] =
|
||||
[iron, bh, iron, bh, iron, bh, iron, bh, iron, bh, iron, bh];
|
||||
GameRolloutState::new(pod, priors)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -61,15 +61,19 @@ fn make_inputs() -> (Vec<AbstractRolloutState>, Vec<[PersonalityPriors; MAX_PLAY
|
|||
_pad_uc: 0,
|
||||
happiness_pool: ((i as i16 % 20) - 10),
|
||||
_pad0: 0,
|
||||
force_rel: [
|
||||
((i * 17) as u16) ^ 0x3000,
|
||||
((i * 19) as u16) ^ 0x4000,
|
||||
((i * 23) as u16) ^ 0x5000,
|
||||
((i * 29) as u16) ^ 0x6000,
|
||||
],
|
||||
force_rel: {
|
||||
let mut fr = [0u16; MAX_PLAYERS];
|
||||
fr[0] = ((i * 17) as u16) ^ 0x3000;
|
||||
fr[1] = ((i * 19) as u16) ^ 0x4000;
|
||||
fr[2] = ((i * 23) as u16) ^ 0x5000;
|
||||
fr[3] = ((i * 29) as u16) ^ 0x6000;
|
||||
fr
|
||||
},
|
||||
axes: [5, 5, 5, 5, 0, 0, 0, 0],
|
||||
relations: [0, 0, 0, 0],
|
||||
relations: [0; MAX_PLAYERS],
|
||||
_pad_rel: [0; 4],
|
||||
formation_strength: [128, 96, 64, 32],
|
||||
_pad_fs: [0; 4],
|
||||
rng_state: SEED.wrapping_add((i as u64) << 32).wrapping_add(p as u64),
|
||||
turn: 50 + (i as u32 % 100),
|
||||
_pad2: [0; 4],
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue