r5862 - in trunk/data: . qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Thu Feb 12 22:09:16 EST 2009


Author: mand1nga
Date: 2009-02-12 22:09:16 -0500 (Thu, 12 Feb 2009)
New Revision: 5862

Modified:
   trunk/data/defaultNexuiz.cfg
   trunk/data/qcsrc/server/havocbot.qc
   trunk/data/qcsrc/server/havocbot_roles.qc
   trunk/data/qcsrc/server/progs.src
Log:
Bots: Avoid getting stuck against a wall, remove goals leading to it.
Fixed compilation order of bot sources
Removed rocketlauncher from "close" weapon priority list because it means suicide :)


Modified: trunk/data/defaultNexuiz.cfg
===================================================================
--- trunk/data/defaultNexuiz.cfg	2009-02-12 15:41:36 UTC (rev 5861)
+++ trunk/data/defaultNexuiz.cfg	2009-02-13 03:09:16 UTC (rev 5862)
@@ -356,10 +356,12 @@
 set bot_ai_custom_weapon_priority_distances "300 850"	"Define close and far distances in any order. Based on the distance to the enemy bots will choose different weapons"
 set bot_ai_custom_weapon_priority_far "11 7 15 14 4 5 8 13 6 1 3 9 2"	"Desired weapons for far distances ordered by priority"
 set bot_ai_custom_weapon_priority_mid "11 9 4 5 3 7 15 14 6 13 8 2 1"	"Desired weapons for middle distances ordered by priority"
-set bot_ai_custom_weapon_priority_close "11 3 9 13 14 8 6 4 2 5 7 15 1"	"Desired weapons for close distances ordered by priority"
+set bot_ai_custom_weapon_priority_close "11 3 13 14 8 6 4 2 5 7 15 1"	"Desired weapons for close distances ordered by priority"
 set bot_ai_weapon_combo 1	"Enable bots to do weapon combos"
 set bot_ai_weapon_combo_threshold 0.3	"Try to make a combo N seconds after the last attack"
 set bot_ai_friends_aware_pickup_radius "500"	"Bots will not pickup items if a team mate is this distance near the item"
+set bot_ai_facingwall_timeout 0.08	"Consider the bot to being stuck after N seconds facing and touching a wall"
+set bot_ai_ignoregoal_timeout 2	"Ignore goals leading the bots to stuck in front of a wall for N seconds"
 // Better don't touch these, there are hard to tweak!
 set bot_ai_aimskill_order_mix_1st 0.01
 set bot_ai_aimskill_order_mix_2nd 0.1

Modified: trunk/data/qcsrc/server/havocbot.qc
===================================================================
--- trunk/data/qcsrc/server/havocbot.qc	2009-02-12 15:41:36 UTC (rev 5861)
+++ trunk/data/qcsrc/server/havocbot.qc	2009-02-13 03:09:16 UTC (rev 5862)
@@ -2,6 +2,8 @@
 .void() havocbot_role;
 void() havocbot_chooserole;
 .float havocbot_keyboardskill;
+.float facingwalltime, ignoregoaltime;
+.entity ignoregoal;
 
 vector havocbot_dodge()
 {
@@ -237,6 +239,33 @@
 				
 				traceline(self.origin + self.view_ofs , dst_ahead, TRUE, world);
 
+				// Check head-banging against walls
+				if(vlen(self.origin + self.view_ofs - trace_endpos) < 1.5)
+				{
+					if(self.facingwalltime && time > self.facingwalltime)
+					{
+						self.ignoregoal = self.goalcurrent;
+						self.ignoregoaltime = time + cvar("bot_ai_ignoregoal_timeout");
+						navigation_poproute();
+					}
+					else
+					{
+						self.facingwalltime = time + cvar("bot_ai_facingwall_timeout");
+					}
+				}
+				else
+				{
+					if(!self.ignoregoaltime)
+						self.facingwalltime = 0;
+
+					if(time > self.ignoregoaltime)
+					{
+						self.ignoregoal = world;
+						self.ignoregoaltime = 0;
+					}
+				}
+			
+				// Check for water/slime/lava and edges
 				if(trace_fraction == 1){
 					traceline(dst_ahead , dst_down, TRUE, world);
 					//	te_lightning2(world, self.origin, dst_ahead);	// Draw "ahead" look 

Modified: trunk/data/qcsrc/server/havocbot_roles.qc
===================================================================
--- trunk/data/qcsrc/server/havocbot_roles.qc	2009-02-12 15:41:36 UTC (rev 5861)
+++ trunk/data/qcsrc/server/havocbot_roles.qc	2009-02-13 03:09:16 UTC (rev 5862)
@@ -102,7 +102,8 @@
 		friend_distance = 10000; enemy_distance = 10000;
 		rating = 0;
 	
-		if(!head.solid || distance > sradius ){
+		if(!head.solid || distance > sradius || head == self.ignoregoal )
+		{
 			head = head.chain;
 			continue;		
 		}

Modified: trunk/data/qcsrc/server/progs.src
===================================================================
--- trunk/data/qcsrc/server/progs.src	2009-02-12 15:41:36 UTC (rev 5861)
+++ trunk/data/qcsrc/server/progs.src	2009-02-13 03:09:16 UTC (rev 5862)
@@ -48,8 +48,8 @@
 bots.qc
 
 // LordHavoc's bots
+havocbot.qc
 havocbot_roles.qc
-havocbot.qc
 
 g_subs.qc
 




More information about the nexuiz-commits mailing list