With cordite in the air, splintered steel, shell casings and powder burns, there’s only one explanation...
For all you mappers out there!

Moderators: Pardner, Joe Kari, TheDoctor, Breli

Postby LuckyGenDago » Tue Jan 25, 2011 3:05 am

in my santaclare map the bots did not move in the first br round. but i have already wrote that.

Will happen if Donut compile it as a br map?
[IngameName] mS.Dago
TS Admin
Image
LuckyGenDago
Gunslinger
 
Posts: 139
Joined: Fri Apr 10, 2009 1:05 am



Postby Pardner » Tue Jan 25, 2011 3:48 pm

Pardner wrote:Do bots routes depend on vis splits (question directed at a mapper or coder)? If your map only has a single vis area, the bots might not "see" anywhere else to go. I might be way off on this, but what if you had an "L" shaped map, would the bots move from one end to the other?


OK, I just tested the idea with the map pictured below. The bots moved (not perfectly). They actually moved perfect without the HINT brushes in place.

Here is the source file for the map, try compiling it and adding different nodes and see if the bots work.


Image


LuckyGenDago wrote:Will happen if Donut compile it as a br map?

In a deathmatch map there will most likely be money and other pickups that the bots will be attracted to. The ai files are really only used for BR since the bots are not attracted to the money in the bank.

Image
Image
User avatar
Pardner
SG Team
 
Posts: 1786
Joined: Fri Nov 18, 2005 5:48 am
Location: MD, USA



Postby TheDoctor » Tue Jan 25, 2011 9:40 pm

In SG, bots are item-driven. In DM maps, it's items like pickup_money, item_belt or ammo_dynamite. In BR maps, it's the item_money (aka money bag). In the current SG versions, bots never ever have the long target goal (LTG) of reaching an .ai node, but if they have chosen an item, they try to visit nearby .ai node (at least I hope they do). Whenever a bot encounters an opponent, he will fight and possibly approach his enemy.

Concerning dm_sky (the small test map), there are two bugs at work preventing a single bot from moving. The main bug is in BotChooseLTGItem(int, vec3_t, int, int) of botlib/be_ai_goal.c:
Code: Select all
// areanum is the current area the bot is in
if (!areanum || !AAS_AreaReachability(areanum))    {
   areanum = gs->lastreachabilityarea; // use the last valid area the bot was in
}

This bug is usually masked by non-trivial maps, but since dm_sky has only one area, the number of reachable areas is 0, hence every time areanum is overwritten with lastreachabilityarea, which is initially 0 (an invalid value). Consequently, the bot believes himself to be in a different (non-existant) area, in which no items exist he could go for. In this sense, Pardner's assumption was right, as he also proved. To fix this, just prepend a check before the assignment:
Code: Select all
if (gs->lastreachabilityarea>0) {areanum = gs->lastreachabilityarea;}


The second bug is in BotCheckBuy(bot_state_t*) of game/ai_dmq3.c:
Code: Select all
bs->buytime = level.time + 3000 + rand()%4000;

buytime is updated everytime the bots checks for something to buy (which is rather frequently) instead of when they actually buy something (not so often). The assignment should really be moved to the bottom of the function. As it is right now, the following condition of BotGetItemLongTermGoal(bot_state_t *, int, bot_goal_t *) of ai_dmnet.c is always true:
Code: Select all
// bot "needs" time to buy something
if(bs->buytime > level.time)
   return qfalse;

This condition was inserted to keep bots from following .ai points for 3-7 seconds whenever they just bought something, but instead it kept them from selecting any .ai node as long term goal.

To summarize: bots couldn't neither take the items as long term goal (bug #1) and nor the .ai nodes (bug #2). Since they had no goal, they had no incentive to move.

This explain the problems on dm_sky. I've updated TerraNova. The original problem of dm_station is not solved by fixing these two bugs. However, it is related to the error messages I described earlier. To test this, I've bot-clipped the complete railway sidings, added a some money on the platforms and voila, a single bot moves, targeting the money.
User avatar
TheDoctor
Smokin' Amigo!
 
Posts: 788
Joined: Sun Jun 06, 2010 3:31 am



Postby Joe Kari » Wed Jan 26, 2011 5:38 pm

@ The Doctor:
I will try your patch tonight.
You should definitively become an SG Dev ;)
User avatar
Joe Kari
SG Team
 
Posts: 878
Joined: Sun Sep 16, 2007 8:44 pm
Location: France



Previous

Return to Level Editing

Show Sidebar
Show Sidebar

User Control Panel