View Single Post
ArcticCerebrate
New Member
Join Date: Jul 2023
Old 07-18-2023 , 05:11   Re: [L4D2] ScavengeBotsDS
Reply With Quote #66

I have made a modified version of ScavengeBotsDS designed to work alongside the "Survivor Bot AI Improver" plugin:
https://forums.alliedmods.net/showthread.php?t=342872

This additional plugin is not required for the modified ScavengeBotsDS to function, but the mod will benefit from the plugin or any equivalent plugin that improves the Bot AI during battle.

Modified Changes:

- Fixed an issue where if a special infected manages to kill a bot carrying gas before another survivor can help, the bots will not touch that particular gas can even if it is the last one because they believe their dead teammate can still bring it home.

- Fixed an issue where a bot that is on thirdstrike/black&white still maintains their claim on a gas can but will not fetch it due to thirdstrike/black&white status. This issue resulted in healthier bots ignoring that particular gas can forever if no teammate has any health items to heal the injured bot. The modified version will take any thirdstrike/black&white bot off scavenge duty and unassign their gas cans.

- Fixed a rare issue where a bot carrying a gas can thinks they need to fetch a new one.

- Bots are more cautious and will engage/defend against any special infected they encounter. The "Survivor Bot AI Improver" plugin is recommended to enhance this aspect of the mod.

- Bots will assist pinned/downed teammates at any stage of the gas collection process. In the original ScavengeBotsDS, bots would only assist if they were on the return trip with a gas can, while bots that don't have a gas can would continue journeying to one.

- Bots with low hp will be taken off scavenge duty to allow them to heal. The original ScavengeBotsDS typically will not let bots heal until they are on thirdstrike/black&white.

- Bots will attempt to assign gas cans in clusters. Whenever a bot is searching for a new gas can, they will check which gas cans their teammates are pursuing and find a gas can in that vicinity. This improves the chances of creating a zone on the map with high survivor foot traffic, thus increasing the odds that a teammate is nearby if any bot gets pinned by the special infected. The original ScavengeBotsDS assigns gas cans based on whichever is closest to the bot.

- Bots can optionally use a buddy-pair strategy when collecting gas cans.
This feature can be enabled/disabled with a new cvar: scavengebotsds_buddy (0/1)
This cvar is disabled by default: 0
When enabled, bots will pair up with each other and attempt to collect gas cans together, thus improving their survivability at the cost of collection speed.
This strategy generally underperforms the original solo strategy (at least when bots do it) and should be reserved for non-finale custom campaigns where time/tanks are not an issue or if there are enough humans on the team to pick up the slack.

- Bots will prefer not to lose their current gas can assignments whenever a teammate is pinned/downed. After a teammate is rescued, bots will check if their gas can is still nearby, and if so they will return to it. If it is far away, they will clear their gas can assignment and find a new gas can to scavenge. This change is to reduce the odds that a boomer will send a gas can lying on the ground out of bounds.

- Bots will drop any gas cans they are carrying if the cvar "scavengebotsds_on" is disabled "0". This is only relevant if you wish to turn the plugin off in the middle of a scavenge.

- Bots will drop any gas cans they are carrying if the scavenge section of a campaign ends. This is only relevant in singleplayer where the number of required gas cans collected is fewer than the number of gas cans spawned or in custom maps that always spawn more gas cans than required.

Notes:
Code for special infected detection was borrowed from "Survivor Bot Fix"
https://forums.alliedmods.net/showthread.php?p=2757330

I am still new to SourcePawn so there may be still be unforeseen issues.

++++++++++
Edit: Newer updated version at:
https://forums.alliedmods.net/showpo...7&postcount=70
Attached Files
File Type: sp Get Plugin or Get Source (scavengebotsds.sp - 78 views - 55.2 KB)

Last edited by ArcticCerebrate; 10-08-2023 at 14:32. Reason: Add link to newer version
ArcticCerebrate is offline