game/src/net/bot.rs#
Source: lib/game/src/net/bot.rs
bot -- a player without a person for tests and load: it wanders the arena, turns, strafes, runs and
jumps now and then, and (with fire) aims at the nearest other figure and shoots. It sees what its
client sees (its predicted figure, the others interpolated) and makes the input of one tick from it;
deterministic from its seed
BotConfig seed, whether it shoots, how often it jumps, how fast it turns
Bot::think the input of a tick from the own figure's feet (None before the first snapshot) and the
others' feet
struct BotConfiga bot's settingsseed: u64-- its random numbersfire: bool-- it shoots at others withinrangerange: f64-- see fire (m)jumps: f64-- jumps a second on averageturn: f64-- the fastest turn (rad/s)half: f64-- half the side of the arena (where it wanders)rate: u32-- ticks a second
struct Bota bot (see the module header)
impl Bot
fn new(cfg: BotConfig) -> Bota bot with these settingsfn think(&mut self, own: Option<Vec3>, others: &[(u16, Vec3)]) -> NetInputthe input of one tick:ownthe figure's feet (None: not known yet),othersthe other figures' feetfn remote_feet(remotes: &[super::client::Remote], out: &mut Vec<(u16, Vec3)>)the feet of the other figures of a client's view (KIND_PLAYER remotes, blended), for Bot::think