Skip to content

Conversation

@sunzenshen
Copy link
Contributor

@sunzenshen sunzenshen commented Dec 12, 2025

Description

In their tactical monitor, bots check for grenade entities around them and then attempt to evade any grenades found using retreating logic.

Toolchain

  • Windows MSVC VS2022

Linked Issues

@sunzenshen
Copy link
Contributor Author

bot_grenade_avoidance_spam.mp4
bot_grenade_avoidance.mp4

@sunzenshen sunzenshen requested a review from a team December 12, 2025 05:44
@sunzenshen sunzenshen added the Bots Related to bot players label Dec 12, 2025
@sunzenshen
Copy link
Contributor Author

bot_grenade_avoidance_navmesh_clip.mp4

@AdamTadeusz
Copy link
Contributor

AdamTadeusz commented Dec 15, 2025

I seem to remember the combat sound logic being used for this in the base sdk, with grenades making a special kind of sound every second or so as they fly that the bots can then run away from

Perhaps instead of this pr we should look at bot hearing again, and make sure bots react to sounds better and "hear" grenades and react appropriately

@AdamTadeusz
Copy link
Contributor

Well maybe nextbots don't have this idk, I would have to spend some more time looking at this topic so don't consider this a damning review for this pr

@sunzenshen
Copy link
Contributor Author

I seem to remember the combat sound logic being used for this in the base sdk, with grenades making a special kind of sound every second or so as they fly that the bots can then run away from

I think CAI_Senses::Listen (ai_sense.cpp) might be the example you were thinking of? At least it ended up being helpful for figuring out the approach.

@DESTROYGIRL
Copy link
Contributor

Out of scope for this PR but I also added InsertSounds for all weapons since #1527. You should be able to use these to detect weapon fire too, this would also unify bot & NPC sound detection a bit which is nice. Worth keeping in mind for the future

@sunzenshen sunzenshen requested a review from a team December 18, 2025 04:30
@sunzenshen sunzenshen merged commit caec9ee into NeotokyoRebuild:master Dec 20, 2025
7 checks passed
@sunzenshen sunzenshen deleted the bot-avoid-grenades branch December 24, 2025 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bots Related to bot players

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants