07-26-2020, 04:10 AM
Hello,
I've been thinking about creating some kind of OP bots 4 fun and training. They should be as good as possible, allowed to cheat, e.g. have complete game information, 100% hitscan shoot accuracy etc.
So far I've managed to give them an almost 100% accuracy with this:
Try it out! (Put the changes above into said file and recompile.)
Bots still sometimes miss hitscans for some reason -- if you know why, please let me know.
Let's discuss and please suggest me ideas or code snippets about further bot improvements.
I've been thinking about creating some kind of OP bots 4 fun and training. They should be as good as possible, allowed to cheat, e.g. have complete game information, 100% hitscan shoot accuracy etc.
So far I've managed to give them an almost 100% accuracy with this:
Code:
index 21506d075..dec170d9c 100644
--- a/qcsrc/server/bot/default/aim.qc
+++ b/qcsrc/server/bot/default/aim.qc
@@ -203,6 +203,21 @@ void bot_aimdir(entity this, vector v, float maxfiredeviation)
if (this.bot_prevaimtime == time)
return;
+this.v_angle = vectoangles(normalize(v));
+
+this.v_angle.x *= -1;
+
+makevectors(this.v_angle);
+shotorg = this.origin + this.view_ofs;
+shotdir = v_forward;
+
+this.bot_firetimer = time + 0.001;
+
+int aaa = 0;
+
+if (!aaa)
+ return;
+
// invalid aim dir (can happen when bot overlaps target)
if(!v) return;
@@ -432,3 +447,4 @@ bool bot_aim(entity this, .entity weaponentity, float shotspeed, float shotspeed
this.dphitcontentsmask = hf;
return true;
}
Try it out! (Put the changes above into said file and recompile.)
Bots still sometimes miss hitscans for some reason -- if you know why, please let me know.
Let's discuss and please suggest me ideas or code snippets about further bot improvements.