Left 4 Dead 2

Left 4 Dead 2

Bot AI Improvements
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.
trijun_heisei 13 Mar @ 6:16pm 
Does this addon have scripts that increase the difficulty of the game? When I play advanced mode the game feels a tiny bit more harder.
浮生若梦 9 Mar @ 4:45pm 
Thank you. It's really regrettable:steamsad:
T-Rizzle  [author] 9 Mar @ 3:03pm 
Yeah, this addon can’t do much about it. Left 4 Bots 2 helps, but even then they still have issues. The issue lies within the internal AI and I can’t really fix it as a result.
Charming p 9 Mar @ 7:25am 
i like this, but bots kind a sloppy wen u get pinned thou
浮生若梦 7 Mar @ 7:44pm 
They do can help me with many things, but when I was caught, they often just stand by without using more effective means.
loganbarron 12 Jan @ 12:59pm 
oh wait bad
loganbarron 9 Jan @ 4:17pm 
cool bots mod keep it up!
something something house 10 Dec, 2024 @ 9:27am 
@HyperEndless how, mine almost never pick any melee at all and i had to force them to using ion vocalizer command

@5seth they still prefer pistols over their primary for whatever reason and they almost never pick a single melee during my time using this mod
HyperEndless 24 Nov, 2024 @ 2:51pm 
I have tested it a lot with L4B2. It has problems. They become more likely to run into your fire, some become obsessed with melee and stay behind then get snatched by special infected. Also they are more easily cornered by the tank, and when one falls all sacrifice one by one trying to revive.
Ænima 24 Nov, 2024 @ 10:01am 
does this work with left 4 bots 2
Charming p 5 Nov, 2024 @ 4:44am 
i like this, finally bots av melee weapons. an they even picking up the flamethrower mod i got in. thnx for this, l4bots mod alone wasn't enough cuz bots dnt pick up melee to that an even wen then do they put it dwn after, but with this they keep.
T-Rizzle  [author] 3 Nov, 2024 @ 5:18pm 
@Who am I
The secondary addon Left 4 Bots allows them to do the objective.
Although I have heard that Left 4 Bots 2 is much better and should work with this addon!
Who am I 3 Nov, 2024 @ 5:10pm 
so this allows the bots to do objectives and function like people..?
Commisshine Redstar 7 Oct, 2024 @ 2:03am 
@Phoenix Rose
I didn't use any command, sometimes many special infected attacked at the same time then they will probably stuck
Phoenix‎ Rose 6 Oct, 2024 @ 3:19pm 
@Commissar Pony
that sounds like 2 issues.

your first issue sounds like you accidentally used the "wait" command so the bots "wait" in place, then when teleported they go back to their "waited" place.

your 2nd issue sounds like an addon conflict issue
T-Rizzle  [author] 6 Oct, 2024 @ 2:07pm 
@Commissar Pony
I'm afraid this is not an issue created by my addon. My addon only touches certain cvars while also manipulating the bot's selected weapons. It appears to be an issue with the base AI's pathfinding functions. I do believe that Left 4 Bots has a method that would allow you to reset their AI which could temporally alleviate the issue. I think is was bots follow, I don't remember at the current moment.
Commisshine Redstar 6 Oct, 2024 @ 6:29am 
Sometimes bots will stuck at a place by randomly accident, and you don't have any way to let them move. They just standing there and do nothing, even stop defensing themselves, although they will dodge Charger, but their self-defense ability has significantly weakened. If you teleported them with admin system, they will running back to that place, no matter how far away.
Rescue map of my last game(No Mercy campaign), they just standing there some how, and hitting by zombies, but the bots are not killing them, one of them even has down twice! Even if the rescue has coming, they're still standing there, didn't come in to the chopper. The same issue also happened to my previous game(The Last Stand campaign).
While I'm abusing this problem, my dad is yelling at me again...TAT Plz could you do sth to fix this?
Phoenix‎ Rose 4 Oct, 2024 @ 7:08pm 
Well, just hope you are doing good is all. if you ever want to come back to this addon for fixes and improvements, you always can in the future :)
T-Rizzle  [author] 4 Oct, 2024 @ 6:57pm 
@Phoenix Rose
I have had a lot to do lately, so I haven't done much for this addon of the recent.
Phoenix‎ Rose 4 Oct, 2024 @ 6:00pm 
hows it going, T-Rizzle?
Phoenix‎ Rose 22 Sep, 2024 @ 5:50pm 
@Killjoy234
from what i know, the built in primary weapon enforcer only activates on a bot that is using a sniper rifle, at least i believe so
Killjoy234 17 Sep, 2024 @ 10:42pm 
Is there a way to disable the bot primary weapon enforcer function of this mod
Phoenix‎ Rose 1 Sep, 2024 @ 1:59pm 
@Commissar Pony
ive had that exact issue with vanilla bots on that crash course map. i believe it happened 3 times, but this was like 2 years ago, and it's not happened again since.

this mod, ,from what i know, does not change any navigation mesh's. the only thing it does is block the nav when a molotove is thrown, or in Ded Center's first chapters case, it prevents the bots from walking through the fires
Commisshine Redstar 1 Sep, 2024 @ 2:04am 
Accident: Crash Course Level 1, near the safe house, I want to keep away from a Witch that blocking the way, and I walked near the cliff, idk why, one of the bots jumped off the fence, fell into water and dead, idk why the pathfinding system do this
Let bots keep away from those place that will cause instantly kill(like cliffs), stay away from it for at least a distance, if unable to reach that distance, like walking through single-plank bridge, just don't let them jump
Remember if you fix or add sth, test them first:steamthumbsup:
Commisshine Redstar 1 Sep, 2024 @ 12:29am 
OK, got it, thank you
T-Rizzle  [author] 31 Aug, 2024 @ 11:31am 
@HealthierShark
I haven't tested if this mod is compatible with Left 4 Bots 2, but I don't see any reason why it wouldn't

@Commissar Pony
You can set improved_melee_ai to 0 in your settings.txt file and the bots should no longer approach nearby zombies to kill them with melee weapons. I do have it set where if the bots get too far from the human player they will attempt to reconnect to the rest of the group , but its mostly an internal AI issue I can't fix.
Commisshine Redstar 31 Aug, 2024 @ 1:38am 
I think if bots are using melee to defend themselves, just stand still, don't running around, only move when special infected are coming(like Charger). Also when the distance between player and bots has reached a certain level, then bots will start to approaching player, but don't stick too close, I want to avoid them blocking the firing line.
You're a responsible mod author, do as much as you can, if sth you can't do, I won't force you to do that.
I will continue to report issues during game play. Hope to see this mod become better and better.
Love from China:steamthumbsup::steamhappy:
Commisshine Redstar 31 Aug, 2024 @ 1:38am 
Bots can use melee weapon, that's a good thing, but every time they use melee weapon, they'll started running around, only to kill zombies, and sometimes they will block my firing line, even falling behind. I think the safe room issue before was caused by this "Running around and kill zombies" problem.
There's an example: Level 2 of Parish campaign, normally we just need to stand on the tower and kill the zombies just with your guns, until the horde event end, but the bots will jump off the tower and kill zombies with melee, I teleported them back with admin system, but not long after, they jumped off again, that's really annoying
HealthierShark 30 Aug, 2024 @ 10:53pm 
Is this mod compatible with Left 4 bots 2? Kinda it works or we they is features broken having both of them?
T-Rizzle  [author] 29 Aug, 2024 @ 8:39am 
@Commissar Pony
Ok, I will add that to the todo list.
Commisshine Redstar 29 Aug, 2024 @ 1:54am 
There's a little problem, if bots are entering the safe room, but some zombies or horde are coming, then the bot will rushing out and start to kill the zombies with melee weapons instead of enter the safe room. They will kill all the zombies, otherwise they won't enter the safe room. I wish you to fix the priority of them
Phoenix‎ Rose 23 Aug, 2024 @ 2:09pm 
yeah it's just those things mainly, having the bots take out their primary's when at a farther distance from the tank and witch would be the best, the optional thing would then be to let us manually edit those distances, but that is of course optional.

take your time with this, there is no need to rush, real life comes first and formost like always :)
T-Rizzle  [author] 23 Aug, 2024 @ 12:42pm 
@Phoenix Rose
Looks like I need to change a few numbers. I will get to doing some tests and changes when I get the time.
Phoenix‎ Rose 19 Aug, 2024 @ 11:01pm 
Have been doing some more tests with the mod. There are still some times when the bots won't take out their primary weapons when near a witch.

If i the bots have their pistol out and i run towards a witch and command a bot to crown her as the bots are catching up, the shotgun bot will run up with a pistol and shoot her.

But if i get close to the witch just enough to not agro her, then the bots will slowly take out their primary.

Same with the tank, they won't use their primary on a tank quite often, perfering to use a pistol most times

Is there maybe a way you can somehow increase the distance to when a bot will swap to their primary when fighting a witch/tank?

If you can increase the range at which they will swap to primary, id say 1600 for a tank would be good, and about 800 for a witch, or if possible let us customize the range ourselves. They do good with special infected though oddly
Phoenix‎ Rose 15 Aug, 2024 @ 9:34pm 
Hey @T-Rizzle

I have a suggestion for a future update to this mod should you ever want to add it (and if its possible)

Since your mod has a built in primary weapon enforcer for snipers, and since left 4 bots 2 lets you set weapon preferences

Is it possible to detect when a bot has the Magnum pistol as their secondary, and they are using a sniper, to allow the bot to swap to and use the magnum? Like have the enforce sniper thing disable for them if they have a magnum?

And if thats possible, is it also possible to add in a 0/1 in the cfg file for that, along with the ability to adjust the range at which "bots will use the sniper at this range and will use pistol at this range"?

Just a suggestion for a future update if possible and if you ever want to. Mod is still working perfectly!
Phoenix‎ Rose 15 Aug, 2024 @ 12:05pm 
Thats alright, at least the bug fix worked!
T-Rizzle  [author] 15 Aug, 2024 @ 11:00am 
@Phoenix Rose
Great to hear, you can configure the pistol range using the addons settings.txt.
As for the retreating from tanks, Liberate Incapacitated Survivor action overrides the retreat command so there isn't much I can do i'm afraid.
Phoenix‎ Rose 14 Aug, 2024 @ 3:03pm 
the fix seems to have worked. the bots will indeed pull out their primary weapons when a witch is nearby

though, not sure if this is from the update, but when it comes to them fighting tanks, they will tend to use their pistols at range which is good, and when it gets close they will swap to their primarys sometimes, or sometimes they will stick with pistols, it varies.

also, when it comes to tanks, they seem to be much dummer, like they will rush in to revive a survivor even if the tank is right directly blocking them. not sure if this is fixable though
Phoenix‎ Rose 14 Aug, 2024 @ 2:26pm 
oh shoot, let me test it for ya!
T-Rizzle  [author] 14 Aug, 2024 @ 12:10pm 
@Phoenix Rose
Done, I finally put out the bug fix. Let me know how it goes!