From b34b2a5b8d118974502c015912e1ed67fa6965b0 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Tue, 21 Oct 2025 00:18:09 +0200 Subject: more debug events, bots now broken --- server/bot/src/lib.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'server/bot/src/lib.rs') diff --git a/server/bot/src/lib.rs b/server/bot/src/lib.rs index 337d18e8..078314b1 100644 --- a/server/bot/src/lib.rs +++ b/server/bot/src/lib.rs @@ -22,6 +22,8 @@ pub mod step; use hurrycurry_game_core::Game; use hurrycurry_protocol::PacketS; +#[cfg(feature = "debug_events")] +use hurrycurry_protocol::{PlayerID, glam::Vec3}; use std::{collections::VecDeque, random::random}; pub struct PacketSink<'a> { @@ -55,3 +57,13 @@ impl BotAlgo for Box { fn random_float() -> f32 { random::(..) as f32 / u32::MAX as f32 } + +#[cfg(feature = "debug_events")] +fn debug_player_color(d: PlayerID) -> Vec3 { + use std::f32::consts::TAU; + Vec3::new( + (d.0 as f32 + TAU / 3. * 0.).sin(), + (d.0 as f32 + TAU / 3. * 1.).sin(), + (d.0 as f32 + TAU / 3. * 2.).sin(), + ) +} -- cgit v1.3