I have never been able to figure out target leading. You know, where the bot shoots ahead of you to try to hit you in motion. In Quake, direction is all screwy. Its all relative. There is no absolute left or right, not even an absolute x or y. Everything is relative.
I couldn't figure out where the player would be next. He might be traveling forward or backward, but what if he were strafing? But then I saw that great tutorial by SkinSki, and it gave me an idea. Much much thanks go out to him.
After peering at his lesson, two words came to me: his velocity. No matter where you think the player may go, he is traveling in the direction of his velocity. And of course, a player velocity is a vector, just like a player origin. Thus, we can simply add his velocity to his origin, and boom, we know his next location.
Let us open up the tutor.qc file, and let us scroll down to bot_aim_at_enemy(). I am sure yours looks different now, so here is what the new one should look like:
// ------------------------------------- vector() bot_aim_at_enemy = // ------------------------------------- { if (self.enemy.velocity) return normalize( (self.enemy.origin + (self.enemy.velocity * 0.6) ) - self.origin); return normalize(self.enemy.origin - self.origin); };Man I love simple things. That's it; that is realistic bot leading. This does almost the same thing as SkinSki's great tutorial.