// traces multiple trajectories to find one that will impact the target
// 'end' vector is the place it aims for,
// traces multiple trajectories to find one that will impact the target
// 'end' vector is the place it aims for,
void bot_lagfunc(entity this, float t, float f1, float f2, entity e1, vector v1, vector v2, vector v3, vector v4)
{
void bot_lagfunc(entity this, float t, float f1, float f2, entity e1, vector v1, vector v2, vector v3, vector v4)
{
this.bot_aimtarg = e1;
this.bot_aimlatency = CS(this).ping; // FIXME? Shouldn't this be in the lag item?
//this.bot_aimorigin = v1;
this.bot_aimtarg = e1;
this.bot_aimlatency = CS(this).ping; // FIXME? Shouldn't this be in the lag item?
//this.bot_aimorigin = v1;
{
float dist, delta_t, blend;
vector desiredang, diffang;
{
float dist, delta_t, blend;
vector desiredang, diffang;
//dprint("aim ", this.netname, ": old:", vtos(this.v_angle));
// make sure v_angle is sane first
this.v_angle_y = this.v_angle.y - floor(this.v_angle.y / 360) * 360;
this.v_angle_z = 0;
//dprint("aim ", this.netname, ": old:", vtos(this.v_angle));
// make sure v_angle is sane first
this.v_angle_y = this.v_angle.y - floor(this.v_angle.y / 360) * 360;
this.v_angle_z = 0;
// get the desired angles to aim at
//dprint(" at:", vtos(v));
v = normalize(v);
// get the desired angles to aim at
//dprint(" at:", vtos(v));
v = normalize(v);
+ this.bot_4th_order_aimfilter * autocvar_bot_ai_aimskill_order_mix_4th
+ this.bot_5th_order_aimfilter * autocvar_bot_ai_aimskill_order_mix_5th
);
+ this.bot_4th_order_aimfilter * autocvar_bot_ai_aimskill_order_mix_4th
+ this.bot_5th_order_aimfilter * autocvar_bot_ai_aimskill_order_mix_5th
);
//dprint(ftos(maxfiredeviation),"\n");
//dprint(" diff:", vtos(diffang), "\n");
//dprint(ftos(maxfiredeviation),"\n");
//dprint(" diff:", vtos(diffang), "\n");
}
vector bot_shotlead(vector targorigin, vector targvelocity, float shotspeed, float shotdelay)
}
vector bot_shotlead(vector targorigin, vector targvelocity, float shotspeed, float shotdelay)
bool bot_aim(entity this, .entity weaponentity, float shotspeed, float shotspeedupward, float maxshottime, bool applygravity)
{
bool bot_aim(entity this, .entity weaponentity, float shotspeed, float shotspeedupward, float maxshottime, bool applygravity)
{
//dprint("AIM: ");dprint(vtos(this.bot_aimtargorigin));dprint(" + ");dprint(vtos(this.bot_aimtargvelocity));dprint(" * ");dprint(ftos(this.bot_aimlatency + vlen(this.bot_aimtargorigin - shotorg) / shotspeed));dprint(" = ");dprint(vtos(v));dprint(" : aimdir = ");dprint(vtos(normalize(v - shotorg)));dprint(" : ");dprint(vtos(shotdir));dprint("\n");
//traceline(shotorg, shotorg + shotdir * 10000, false, this);
//if (trace_ent.takedamage)
//dprint("AIM: ");dprint(vtos(this.bot_aimtargorigin));dprint(" + ");dprint(vtos(this.bot_aimtargvelocity));dprint(" * ");dprint(ftos(this.bot_aimlatency + vlen(this.bot_aimtargorigin - shotorg) / shotspeed));dprint(" = ");dprint(vtos(v));dprint(" : aimdir = ");dprint(vtos(normalize(v - shotorg)));dprint(" : ");dprint(vtos(shotdir));dprint("\n");
//traceline(shotorg, shotorg + shotdir * 10000, false, this);
//if (trace_ent.takedamage)