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.