Compare commits

...

3 Commits

Author SHA1 Message Date
d4b6dfc71c edit sim tests 2024-08-08 13:48:44 -07:00
16575eb777 update bots location 2024-08-08 13:36:11 -07:00
cc33eeb2ad resimulation as tests 2024-08-08 13:24:55 -07:00

@ -1811,4 +1811,46 @@ mod test{
Time::ZERO
),None);
}
fn simulate(map:&str,bot:&str){
//create physics
let mut physics=PhysicsContext::default();
//load map
let map_file=std::fs::File::open(format!("/run/media/quat/Files/Documents/map-files/verify-scripts/maps/{map}.snfm")).unwrap();
let map=strafesnet_snf::read_map(map_file).unwrap().into_complete_map().unwrap();
physics.generate_models(&map);
//load bot
let bot_file=std::fs::File::open(format!("/run/media/quat/Files/Documents/Strafe Client/debug_bots_v1/{bot}")).unwrap();
let instructions=strafesnet_snf::bot::read_bot_debug(bot_file).unwrap();
//run bot on physics
for ins in instructions{
physics.run_input_instruction(ins);
}
}
#[test]
fn simulate_bot_1(){
//arcane
simulate("bhop_snfm/5692113331","ff4940efb50f724e48eb54ce3593d88f")
}
#[test]
fn simulate_bot_2(){
simulate("bhop_snfm/5692113331","17cf70412eba16d172a67385cab5727e")
}
#[test]
fn simulate_bot_4(){
//brick
simulate("bhop_snfm/5692176057","c0631c6f524eebddbf75237cac48e78e")
}
#[test]
fn simulate_bot_5(){
//toc
simulate("bhop_snfm/5692152916","1722976199076914659")
}
#[test]
fn simulate_bot_6(){
//utopia
simulate("surf_snfm/5692145408","1722980796007573431")
}
}