Compare commits

...

4 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
a4077ed0e3 use snf bot prerelease 2024-08-08 13:23:24 -07:00
3 changed files with 45 additions and 3 deletions

4
Cargo.lock generated
View File

@ -1952,9 +1952,9 @@ dependencies = [
[[package]]
name = "strafesnet_snf"
version = "0.1.2"
version = "0.1.3-bot"
source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/"
checksum = "d12fc351b2af5fd7a8183175d55ac43e21eb8fd1f76cc70cd4713c0d1a556c96"
checksum = "69448a3ed6ab5e9886cf83a3b2358c1f05d652cde4839963cd867978b924b52b"
dependencies = [
"binrw 0.14.0",
"id",

View File

@ -26,7 +26,7 @@ strafesnet_bsp_loader = { version = "0.1.3", registry = "strafesnet", optional =
strafesnet_common = { version = "0.3.0", registry = "strafesnet" }
strafesnet_deferred_loader = { version = "0.3.1", features = ["legacy"], registry = "strafesnet", optional = true }
strafesnet_rbx_loader = { version = "0.3.2", registry = "strafesnet", optional = true }
strafesnet_snf = { version = "0.1.2", registry = "strafesnet", optional = true }
strafesnet_snf = { version = "0.1.3-bot", registry = "strafesnet", optional = true }
wgpu = "22.0.0"
winit = "0.30.4"

View File

@ -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")
}
}