-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Fix bots never using their Seek and Destroy (Deathmatch AI) #917
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Fix bots seek and destroy AI.
fixed original code remaining
Yeah my bad. I originally had it in the master fork but decided to move it to a branch and ended up accidentally keeping a copy of the original code. Now it's fixed. |
I think the bug you're trying to fix stems from If none of the expected conditions are met then the function returns 0.0, which tricks other parts of the code into thinking the round is about to end at that instant. Since we need to account for overtime I think changing the condition to exclude 0.0 is unreliable. The best fix imo would be to change that final return statement to return a really big number, say This will also fix any other bugs caused by other references to GetTimeLeftToCapture(). Keep your check in place, it is reasonable since we don't want to exit the seek and destroy state unnecessarily. |
Thanks/credit to megascatterbomb for the suggestion.
Tested it out and it worked. I've added that change alongside the original one as well. Thanks! |
Tested myself, LGTM! |
How sure how it is supposed to work but it doesn't in my end Desktop.2025.03.11.-.15.13.51.04.DVR.mp4 |
The problem with Payload Race is bots think the gamemode is payload. They aren't really set up to properly understand and support two payload carts though. You can use "NB_DEBUG BEHAVIOR" to see what AI bots are currently using. The seek and destroy AI will occur when the bots have literally no game logic to use. Which should work on most unsupported maps/gamemodes. There are a few exceptions like CTF and PLR though. In these they somewhat understand the gamemode. I think these would preferably be fixed with actual real support for these gamemodes (especially for PLR since they already understand payload) instead of using their deathmath AI. |
…eek and Destroy] Co-authored by: ShowinGrowin <[email protected]>
…eek and Destroy] Co-authored by: ShowinGrowin <[email protected]>
…eek and Destroy] Co-authored-by: ShowinGrowin <[email protected]>
…eek and Destroy] Co-authored-by: ShowinGrowin <[email protected]>
Description
Bots are intended to deathmatch when they don't understand the current gamemode. This feature was eventually broken when the cvar tf_bot_offense_must_push_time was added to the game. This check is only relevant in specific gamemodes.
Since only specific gamemodes account for this logic, it causes them to not go into their "deathmatch" mode when they're supposed to. I added a check for said gamemodes so they will still use "seek and destroy" logic if there is no other supported gamemode logic to go by.