]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Bot AI: improve bot ability to climb ladders up (e.g. ladders in the water on Reservo...
authorterencehill <piuntn@gmail.com>
Mon, 9 Jul 2018 16:29:23 +0000 (18:29 +0200)
committerterencehill <piuntn@gmail.com>
Mon, 9 Jul 2018 16:33:44 +0000 (18:33 +0200)
qcsrc/server/bot/default/aim.qc
qcsrc/server/bot/default/havocbot/havocbot.qc
qcsrc/server/bot/default/navigation.qc

index 53932ff6a9d1e75e12e9918c3f3a6f6dae8fa2a5..768aa6daee2bb2719c759eb5f9f7dc4354f5f264 100644 (file)
@@ -242,6 +242,7 @@ void bot_aimdir(entity this, vector v, float maxfiredeviation)
                + this.bot_4th_order_aimfilter * autocvar_bot_ai_aimskill_order_mix_4th
                + this.bot_5th_order_aimfilter * autocvar_bot_ai_aimskill_order_mix_5th
        );
+       desiredang.x = bound(-90, desiredang.x, 90);
 
        // calculate turn angles
        diffang = desiredang - this.bot_mouseaim;
index b66d423d98fa31337b3e3ab8cb411d9042ae70ca..a2c6e2686311b7ab830853e932aae3425f9c5ab5 100644 (file)
@@ -1151,8 +1151,13 @@ void havocbot_movetogoal(entity this)
                }
                if (ladder_zdir)
                {
-                       dir.z = ladder_zdir * 1.3;
-                       dir = normalize(dir);
+                       if (vdist(flatdir, <, 15))
+                               dir = ladder_zdir * '0 0 1';
+                       else
+                       {
+                               dir.z = ladder_zdir * 1.3;
+                               dir = normalize(dir);
+                       }
                }
        }
 
index 88d189beec079d78f8c4bc7a662fdb8d70b53e4d..20095fd49dbf5f26b7a6629e19c088692722d9ec 100644 (file)
@@ -1701,8 +1701,16 @@ int navigation_poptouchedgoals(entity this)
                        gc_min = this.goalcurrent.origin - '1 1 1' * 12;
                        gc_max = this.goalcurrent.origin + '1 1 1' * 12;
                }
-               if(!boxesoverlap(this.absmin, this.absmax, gc_min, gc_max))
-                       break;
+               if (time < this.ladder_time)
+               {
+                       if (!boxesoverlap(this.absmin, this.absmax - eZ * STAT(PL_MAX, this).z, gc_min, gc_max))
+                               break;
+               }
+               else
+               {
+                       if (!boxesoverlap(this.absmin, this.absmax, gc_min, gc_max))
+                               break;
+               }
 
                // Detect personal waypoints
                if(this.aistatus & AI_STATUS_WAYPOINT_PERSONAL_GOING)