spearmint icon indicating copy to clipboard operation
spearmint copied to clipboard

Make the bots go for health/ammo only when it's necessary/reachable & grab items only when they're spawned into the map

Open rawr51919 opened this issue 8 years ago • 12 comments

I think the bots would probably be smarter & more manageable with their health if they don't grab any health if they are at full health or greater. Only exceptions are the 5 health & the MH. Doing this will undoubtedly fix the stuck in RA room issue for q3dm7, because 25 health balls are causing the problem.

rawr51919 avatar May 31 '16 19:05 rawr51919

Previously discussed on #246. Also, I don't think this is specifically related to health items which iirc are nearby goals in this case. I think the issue is that the long term goal (red armor) is in the room and bot doesn't choose one outside the room so it does not leave. It just waits around for red armor to respawn and tries to grab the health items in the mean time just because they're nearby.

zturtleman avatar May 31 '16 22:05 zturtleman

Okay, actually it's picking other long term goals as items in the room too (not always red armor). Disabling spawning the 25 Health can still result in the bot being stuck going back and forward between the red armor and the Shotgun and Rocket ammo (even when all three are waiting to respawn). set disable_item_health 1 So changing the item selection to ignore health items that are unable to be picked up does not solve the issue of bot not wanting to leave the q3dm7 RA room.

zturtleman avatar May 31 '16 23:05 zturtleman

Maybe having them not going for health they can't pick up in conjunction with the bot not picking up items when they aren't spawned into the area of the map the bot is in & the bot not picking up ammo for a weapon which already has full ammo & having them not picking up anything that isn't reachable in the map's botfile will most likely, to an extent, fix this issue @zturtleman. Also, this issue happened because of the changes in the cdaef49 commit in mint-arena.

rawr51919 avatar Jun 01 '16 11:06 rawr51919

@coltongit: I really think you should have a quick look at the source code, to at least get some basic understanding of the current bot AI and game logic in general. As I alreay said here, first, get a program of your choice, any IDE, or whatever you want, to investigate the source code. Once again, working with Notepad is no good idea. It isn't that hard to get a feel how the Q3/Spearmint code works, if you investigate the source code with a good IDE...

...so, It doesn't make sense to say: "bot should not picking up ammo for a weapon which already has full ammo". What do you mean by that? What is full ammo? Did you ever see a bot with ammo 999? Moreover why should the bot not pick up ammo or health at all? There are some cases where this can be helpful but not in general. I already told you why the current code was written so that bots will always go for health, and that there is a good reason for that. This code was always there and didn't yet change for Spearmint! ...what do you exactly want to have at all? If you are still not satisfied with the behavior on q3dm7, than this is because it isn't fixed yet (and it won't get fixed sooner by opening a new ticket with the same issue.) If you want to have it fixed sooner, than have a look at the source code = use an IDE and investigate the specific code (and find out that in Q3/Spearmint a weapon isn't really full ever. You (and also bots) can collect ammo until they are up to 999, which is very unlikely) ....

ghost avatar Jun 02 '16 11:06 ghost

The weapon limits for deathmatch are 200 ammo for each weapon @KuehnhammerTobias. That's what I meant by what I said in my last post. The only time they are at 999 is when you use the give all or give <weapon> cheat.

rawr51919 avatar Jun 02 '16 13:06 rawr51919

@coltongit: but WHAT should it fix, to not pick up ammo (after a specific amount)? WHY do you want to limit the ammo pick up? If 999 is too much, why do you want them to stop pick up ammo at 200, why not at 100, or 50 or 10? Moreover, consider the amount of ammo is relative. 100 shots for LG is something different than 100 slugs for your RG!

ghost avatar Jun 02 '16 13:06 ghost

Yes, ammo items can't be picked up after 200 ammo and ammo is capped so it doesn't exceed 200. Though, I don't think it really affects @KuehnhammerTobias' original message.

Waiting until the bot has 200 rocket and shotgun ammo in q3dm7 RA room could take over 14 minutes. This doesn't really seems like a good solution.

Disabling spawning the 25 Health, Rocket Ammo, and Shotgun Ammo can result in the bot just standing at the Red Armor spawn point forever (technically, I only waited 6 in-game hours with timescale 200) because the bot keeps picking the Red Armor as the long term goal. set disable_item_health 1; set disable_ammo_rockets 1; set disable_ammo_shells 1; So changing the item selection to ignore health and ammo items that are unable to be picked up does not solve the issue of bot not wanting to leave the q3dm7 RA room.

@coltongit bots already only try to pick up items that are possible for bots to reachable based on the reachabilities in the AAS file.

There is code for bot to avoid items for the length of the respawn time (as defined in botfiles/items.c) after it's been selected for long term or nearby goal (see mint-arena/code/game/ai_goal.c). Though in the RA room ai_goal.c:BotChooseLTGItem fails to choose a long term goal after selecting the items in the room, so then ai_dmnet.c:BotGetItemLongTermGoal() falls back to resetting the avoid goal times and then later (next server frame?) ai_goal.c:BotChooseLTGItem() begins selecting the items in the room again. With bot_developer 1, the console spams Sarge: no valid ltg (probably stuck) from ai_dmnet.c:BotGetItemLongTermGoal.

So basically as I've suspected "bot doesn't choose [a long term goal] outside the room so it does not leave." The issue is not the items in the room. It's BotChooseLTGItem not selecting an item outside the room which it naturally should after it's selected all of the items in the room due to having set avoid goal times on them.

inb4: someone should probably look into why BotChooseLTGItem fails.

zturtleman avatar Jun 02 '16 17:06 zturtleman

Yeah, correct! That's why this issue is the same as already discussed. BTW, it is not only a not so good solution to wait 14 minutes until the bot has 200 ammo. It even is a VERY BAD solution! Everyone can simply test this by set the bots preference for pick up items to 0 when full of (health/ammo what else). Result: if there is no more LTG the bot should go for, the bot will stay around and jerk and stutter (as a last resort solution, only a item_botroam can fix this). This behavior can be seen also on maps with very few items (or long respawntimes). Sometimes this even can happen on regular q3dm1 too. And is also reproducable if someone places only a single weapon into a very small map. So without any other changes to bot AI, we will ALWAYS need an item (per map) the bot will go for, no matter if ammo health or anything else is at 999, 200 or whatelse! I tried this to explain to coltongit already at issue 246

ghost avatar Jun 02 '16 18:06 ghost

So that's what you were hinting at @KuehnhammerTobias. Sorry for not catching that sooner. Hopefully we get this all fixed up before August 13th for Spearmint 0.4 @zturtleman. And I assume test_bigbox would be a likely candidate for that particular bug @KuehnhammerTobias, if it had a botfile however...

rawr51919 avatar Jun 02 '16 23:06 rawr51919

You do know these due dates aren't solid right? @zturtleman can change them or complete them whenever he feels like it.

mecwerks avatar Jun 03 '16 16:06 mecwerks

Oh well, it's his duty to anyway.

rawr51919 avatar Jun 03 '16 18:06 rawr51919

Actually guys, it seems that creating a new botfile with -forcesidesvisible in bspc seems to fix the stuck in RA room issue (or at least, it lessens the issue to the point where it's almost unnoticeable). I tested this myself. If you want my patch to test (it contains the botfile explained earlier), then here it is: https://mega.nz/#!to9GgAIR!xHdIK53ui2HtaFazn9NkigQuv9YxqeNIHUp39fa4RgY The bots hit the jump pad multiple times at the shotgun area, but otherwise, they're perfectly fine.

rawr51919 avatar Jun 05 '16 21:06 rawr51919