Skip to content

T-Rizzle Bots Bug Fix Patch#75

Open
T-Rizzle12 wants to merge 14 commits into
mainfrom
bug-fixes
Open

T-Rizzle Bots Bug Fix Patch#75
T-Rizzle12 wants to merge 14 commits into
mainfrom
bug-fixes

Conversation

@T-Rizzle12
Copy link
Copy Markdown
Owner

@T-Rizzle12 T-Rizzle12 commented Jan 22, 2025

I have been working on other projects of mine and found some bugs that I wanted to fix. I also wanted to refactor the code and cleanup old and obsolete functions now handled by the interface system. I also have been doing some work on issues posted to this GitHub repository.

Change Log:

  • Added new debug text that appears on the bots when developer ConVar is not 0, this shows their current action tree and what they are attempting to do!
  • Reregistered PlayerSay hook since it still has some uses
  • Fixed bots giving up on healing teammates in the healing state if they were in combat and became injured
  • Changed the bot to not give up the healing state unless they had seen an enemy recently
  • Multiple fixes to the bots and how they check who is injured or not
  • Added a sanity check that fixed the bots attempting to heal players with max health less than the HealThreshold
  • Fixed the bots being idiots and not swapping weapons after leaving the healing state for a few seconds
  • Optimized the code by creating some local variables of commonly used functions
  • Optimized and fixed the vehicle checks for bots
  • Randomized the spawn preferred weapon timer so bots have some variability between spawning in weapons
  • Fixed the bots always considering themselves in combat if an enemy was spamming sounds
  • Actually fixed the issue of the bots creating errors on server shutdown, this closes This error appeared when I disconnected #66
  • Moved FindNearbySeat to the action metatable which closes Bots call FindNearbySeat in the player Metatable rather than the action Metatable #72
  • Added an IsAlive method to the Nextbot class since some addons trick this one into believing that they are NPCs which closes Bots create errors when they see or hear the Terminator NextBot #71
  • Added some optimization to enemy targeting
  • Fixed the bots using incorrect jump height in the TBotReloadInCover action
  • Fixed bots not using the vision metatable to check Line Of Sight when checking for players to heal
  • Removed double declaration of GetKnown in the Vision metatable
  • Added new function to the vision metatable HasReactionTimeElapsed, this returns true if an enemy has been in the bot's Field Of View long enough
  • Added new function to the vision metatable ForEachKnownEntity, this calls the entered function with two parameters the vision interface and a TBotKnownEntity. More info can be found in the TBotVision.lua file
  • Registered the TBotChasePath and TBotRetreatPath metatable so other addons can use it
  • Fixed Bot can't tell if a prop is explosive #65, where the bots would attack explosive props when they thought they were breakable objects
  • Fixed the bots not using the vision interface when checking if a breakable object can been seen
  • Fixed TBotPathFollower::Avoid function causing the bot to not be able to walk through teammates if they were on team 1-4 and GetNoCollideWithTeammates set to true
  • Changed TBotRetreatPath default throttle timer from 0.5 seconds to 1.0 seconds
  • Optimized TRizzleBotRangeCheckRetreat by changing Length calls into LenthSqr
  • Made some experimental changes to how bot retreat when using TBotRetreatPath
  • Removed more instances of Either as it can be slow and create unexpected errors
  • Removed old and unused variables from TBotResetAI
  • Removed HandleButtons function as it was moved into TBotLocomotion
  • Added more player.Iterator function usage as its much faster than the other methods
  • Made some changes to DidPlayerJustFireWeapon, the bot is much better at checking players who fired weapons recently
  • Made some changes to IsCursorOnTarget, which fixes Bots have inconsistent attack times when multiple enemies are close #70
  • Fixed some bugs in SelectBestWeapon
  • Added new parameter to RegisterTBotWeapon, IsAutomaticOverride. This parameter if not set to nil will override the bots internal AI and force them to treat a weapon as if its automatic, if set to true, or semi-auto, if set to false
  • Fixed PLAYER:IsReloading not working with weapons with custom reloading functions, this makes the bots much better at staying in cover until they actually finish reloading
  • Added ENTITY:IsExplosive, checks if an entity is explosive
  • Added PLAYER:TransientlyConsistentRandomValue returns a number between 0-1 that stays consistent for a period of time
  • Added a more descriptive error to the assert check in the pathfinder, fixes Change the assert in the NavAreaBuildPath to be more descriptive #74
  • Removed a crap ton of old and unused code, fixes Remove redundant code #63

- Moving updated files from computer to GitHub
- Moving updated files from computer to GitHub
- Moving updated files from computer to GitHub
- Moving updated file from computer to GitHub
- Uploading changes
- Uploading changes
@T-Rizzle12 T-Rizzle12 added the enhancement New feature or request label Jan 22, 2025
@T-Rizzle12 T-Rizzle12 self-assigned this Jan 22, 2025
@T-Rizzle12 T-Rizzle12 linked an issue Jan 22, 2025 that may be closed by this pull request
- MORE CHANGES, YEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHHHHHHHHHHH
- Made some changes and fixed some AI bugs
Copy link
Copy Markdown
Owner Author

@T-Rizzle12 T-Rizzle12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Added new debug text that appears on the bots when developer ConVar is not 0, this shows their current action tree and what they are attempting to do!
  • Reregistered PlayerSay hook since it still has some uses
  • Fixed bots giving up on healing teammates in the healing state if they were in combat and became injured
  • Changed the bot to not give up the healing state unless they had seen an enemy recently
  • Multiple fixes to the bots and how they check who is injured or not
  • Added a sanity check that fixed the bots attempting to heal players with max health less than the HealThreshold
  • Fixed the bots being idiots and not swapping weapons after leaving the healing state for a few seconds
  • Optimized the code by creating some local variables of commonly used functions
  • Optimized and fixed the vehicle checks for bots
  • Randomized the spawn preferred weapon timer so bots have some variability between spawning in weapons
  • Fixed the bots always considering themselves in combat if an enemy was spamming sounds
  • Actually fixed the issue of the bots creating errors on server shutdown
  • Moved FindNearbySeat to the action metatable
  • Added an IsAlive method to the Nextbot class since some addons trick this one into believing that they are NPCs
  • Added some optimization to enemy targeting
  • Fixed the bots using incorrect jump height in the TBotReloadInCover action
  • Fixed bots not using the vision metatable to check Line Of Sight when checking for players to heal
  • Removed double declaration of GetKnown in the Vision metatable
  • Added new function to the vision metatable HasReactionTimeElapsed, this returns true if an enemy has been in the bot's Field Of View long enough
  • Added new function to the vision metatable ForEachKnownEntity, this calls the entered function with two parameters the vision interface and a TBotKnownEntity. More info can be found in the TBotVision.lua file
  • Registered the TBotChasePath and TBotRetreatPath metatable so other addons can use it
  • Fixed the bots attacking explosive props when they thought they were breakable objects
  • Fixed the bots not using the vision interface when checking if a breakable object can been seen
  • Fixed TBotPathFollower::Avoid function causing the bot to not be able to walk through teammates if they were on team 1-4 and GetNoCollideWithTeammates set to true
  • Changed TBotRetreatPath default throttle timer from 0.5 seconds to 1.0 seconds
  • Optimized TRizzleBotRangeCheckRetreat by changing Length calls into LenthSqr
  • Made some experimental changes to how bot retreat when using TBotRetreatPath
  • Removed more instances of Either as it can be slow and create unexpected errors
  • Removed old and unused variables from TBotResetAI
  • Removed HandleButtons function as it was moved into TBotLocomotion
  • Added more player.Iterator function usage as its much faster than the other methods
  • Made some changes to DidPlayerJustFireWeapon
  • Made some changes to IsCursorOnTarget
  • Fixed some bugs in SelectBestWeapon
  • Added new parameter to RegisterTBotWeapon, IsAutomaticOverride. This parameter if not set to nil will override the bots internal AI and force them to treat a weapon as if its automatic, if set to true, or semi-auto, if set to false
  • Fixed PLAYER:IsReloading not working with weapons with custom reloading functions
  • Added ENTITY:IsExplosive, checks if an entity is explosive
  • Added PLAYER:TransientlyConsistentRandomValue returns a number between 0-1 that stays consistent for a period of time
  • Added a more descriptive error to the assert check in the pathfinder
  • Removed a crap ton of old and unused code

Copy link
Copy Markdown
Contributor

@t-rizzle-s-assistant t-rizzle-s-assistant Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a reminder that I need to upload the new changes to the repository so I can ready this update for relase!

- Finally upload changes from computer
- Finally upload changes from computer
- Finally upload changes from computer
- Finally upload changes from computer
- NOTE: I still need to add the stuck teleporting for the TBotFollowGroupLeader Action
- Copy changes from TBotFollowOwner.lua to this file
Copy link
Copy Markdown
Owner Author

@T-Rizzle12 T-Rizzle12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Finally added #39, bots will now teleport to their owner or group leader if they get stuck for more than 5 seconds or are unable to path to them. Bots will teleport to a CNavArea nearby the player that is out of sight
  • Fixed some weird repathing code in TBotFollowOwner and TBotFollowGroupLeader Actions
  • Added TBotFollowerMonitor which fixes #77
  • Fixed #79 by making the bots stop healing themselves after taking damage with low health
  • Made the bot move closer to the player it's trying to heal; this fixes a rare issue where the bot would fail to heal its target
  • Changed how the bot determines when it can press its primary attack key as it was ugly and was creating some issues
  • Changed the bots revive distance to be closer to the player for the same reason the heal distance was changed
  • Fixed bots not looking at the player at times when attempting to revive them
  • Fixed a code inconsistency in the TBotScenarioMonitor in regarding how the bot picks who to heal
  • Made a quick optimization to the TBotLocomotion
  • Made MORE changes to TBotRetreatPath, made bots check if the area is crossing line of fire which should hopefully help the bots be smarter about fleeing from a threat. There will probably even more changes!
  • Added GetLastDamageTimestamp to the Player Metatable, Grabs the last time the player was damaged
  • Made PLAYER:SelectBestWeapon account for floating point errors in the deploy animation
  • Made some changes to IsCrossingLineOfFire and IsIntersecting2D

@T-Rizzle12
Copy link
Copy Markdown
Owner Author

Alright, I just need to merge some final changes, type up some patch notes, and this should be good for release!

@T-Rizzle12
Copy link
Copy Markdown
Owner Author

For anyone wondering why this hasn't been merged yet is I haven't had the time to do so. I also want to try a few tweaks to TBotRetreatPath, but based on my recent testing. I may not actually apply the adjustments to TBotRetreatPath I made.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: In Progress

1 participant