Left 4 Dead 2

Left 4 Dead 2

462 ratings
Bot AI Improvements
2
   
Award
Favorite
Favorited
Unfavorite
Game Content: Scripts
File Size
Posted
Updated
114.563 KB
6 Sep, 2022 @ 5:48pm
14 Aug, 2024 @ 12:08pm
31 Change Notes ( view )

Subscribe to download
Bot AI Improvements

Description
I noticed that bots are lacking in many features, this mod is made to be compatible with the mod Left 4 Bots and to add onto it. Like an DLC/ADDON

Important:
When this addon receives an update the setting.txt and const.nut will NOT automaticaly add the new cvars to said files, you have two choices either delete the setting.txt and const.nut and let this addon recreate them with the new cvars or use this list of Addon Settings and manually add the new cvars, if this addon does not detect one of the cvars in the setting.txt it will use this addons default settings as a failsafe.
Also, if you notice certain features are not working, “bots not pulling on their melee weapons when a common infected gets too close,” your setting.txt and/or const.nut may be corrupted or has a typo, you should delete the file and let this addon recreate it. I am working on having this addon automatically fixing said issue.

Current Features:
- Bots will pull out their melee weapons when a common infected get to close to them,
- Improved bot chainsaw behavior, "Bots will shove for two seconds after pulling out their chainsaw and will hold down their attack button when multiple commons are close to them."
- Bots will crouch when fighting far away common infected, there is a limit to how far away the common infected can be when deciding to crouch
- Bots with sniper rifles will scope in when crouching to improve their accuracy
- Attempted to fix bots when incapacitated and sb_allow_shoot_through_survivors is set to 0 not shooting through teammates
- Attemped to fix bots walking though fire, “This bug happens all the time, bots for some reason love trying to reach you by walking straight through Molotovs and/or Gascans, “this is a major problem in expert mode where fire can easily kill you,” what I did to fix this is add a check for active fires and marked the area as blocked for the survivor bots, “infected will still walk into the fire,” making the bots take alternate routes to get to the player.”
- Bots can now attempt to dead stop hunters and jockeys
- Bots will stop reviving teammates if they are being attacked by a common infected and/or if a tank is nearby, “bots being bots will still attempt to revive teammates, but they will immediately stop the revive if the tank or common infected is too close.”
- Bots will prioritize killing smokers that are trying to grab them
- Bots will not drop melee weapons if they are controlling an idle player
- sb_melee_approach_victim is set based on the distance from the closest player
- Improved bots ability to deal with nearby common infected
- Bots with T1 shotguns and css snipers have a chance to shove after shooting to allow them to shoot faster
- Bots with shotguns will reload for 2 seconds after emptying their weapon clip before firing again
- Bots will reload their secondary weapons if they are not in combat
- Bots will use their secondary weapons if they are attacking far common infected to save ammo

This addon is NOT compatiable with Bot Primary Weapon Enforcer, because of this I have replicated the features of that addon into this one.

If you want more information on the features of this addon here is a link that explains them in a bit more detail Addon Features Explained

You can customize this addon's cvars, here is a guide on what each cvars does: Changing Addon Settings

Todo:
- Improve bots ability to deal with nearby common infected

Important Discussions:
Suggestions
Bugs
Known Bugs

Here is this addon’s source code
GitHub Repository[github.com]

Check out my other addons:
Left 4 Bots Chainsaw Pickup Fix: https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2809813258
Bot Chatter: https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2857764764
Popular Discussions View All (6)
136
3 May @ 1:21pm
PINNED: Bugs
T-Rizzle
79
23 May @ 5:14pm
PINNED: Suggestions
T-Rizzle
11
27 Oct, 2024 @ 9:21am
PINNED: Addons Cvars
T-Rizzle
373 Comments
T-Rizzle  [author] 4 Jul @ 9:25pm 
@CaptPatrick01
Sigh, this was one of my few first ever mods I made and as a result, it runs on some “pretty” bad coding mistakes in my time. I wonder if it has something to do with the dynamic tables as an optimization, having some kind of race condition. I did my best to look into the error and found this, 0x52200C54 may indicate a problem with your game files. Try verifying the integrity of the game files through Steam. I have never had the mod crash like this, but it’s still probably something I should look into eventually.
CaptPatrick01 4 Jul @ 1:54pm 
It appears this mod is causing an exception to be thrown at the server.dll (0x52200C54) when it tries to remove a dead SI on Ryzen 5000 CPUs.
T-Rizzle  [author] 23 Jun @ 11:44am 
@SP-Calamitas
Yeah, thats an issue with how the base AI is coded! I try to force the bots to use the chainsaw, but the base AI has final authority that I have very little control over.

Yeah, the bots still walk into fire as there is only so much I can do about fixing it since the issue in in the base AI and I can only suggest to the bots not to path there in the first place!
佐伊的老公 23 Jun @ 5:30am 
The bot will still walk into the fire
SP-Calamitas 14 Jun @ 6:33am 
bots still suck when using chainsaw, even after bumping up the value of melee_attack_distance and abandon distance they'll still pull swap to their primary even when surrounded by infected
Homero si canta 7 Jun @ 10:18pm 
oh nice, ill try and see how well it works
T-Rizzle  [author] 7 Jun @ 5:27pm 
@angry bird
There is no need for a second version. This should be compatible with both versions of left 4 bots! Although I may need to update the "requirements" section!
Homero si canta 7 Jun @ 8:34am 
are u gonna make a separate version for left 4 bots 2?
trijun_heisei 14 Mar @ 2:36pm 
@T-Rizzle
Oh okay. Also do you know why the bots just randomly start slow walking for no reason? I've encountered this issue 2 times as of now.
T-Rizzle  [author] 14 Mar @ 6:26am 
@trijun
No, this addon shouldn’t affect the difficulty of the game in any way shape or form. There may be another addon that is affecting that. I will note that some maps, “custom only,” have custom difficulty settings which may influence the difference in difficulty you may be experiencing.