SAIN 2.0 - Solarint's AI Modifications - Full AI Combat System Replacement 2.3.3

Bots that don't suck.

REQUIRES latest BigBrain by DrakiaXYZ
REQUIRES latest Waypoints by DrakiaXYZ

Report issues or bugs to here: SAIN Github Issue Tracker

Any issues must include a full list of your server and client mods, the version of SPT you are playing on, and either your Bepinex/LogOutput file or an exact description of the issue you are experiencing and the context of when it occurred. Just telling me "its broken" is not helpful what so ever.


[tabmenu]

HUGE Thanks to everyone in the Discord who helped test the Alpha builds of 2.0. Ya'll are the only reason this mod works as well as it does!

  • Version 2.3.3

    Major Update


    Important:

    Added detection for when the sain server mod is installed incorrectly. Due to allowing bot types to have sain disabled on them, I need to check to make sure PMC brains are set correctly. You will get an ingame error notification if sain detects that a PMC does not have the correct brain type. Read the error.


    Reworking Bot recoil. (Will need more adjustments)

    Headshot protection slightly reworked. Instead of always aiming for the specific center mass, it will limit the height of their aim target to the height of center mass, meaning stomach shots should be less frequent.

    Added scatter and aim buffs/debuffs for bots using weapons with or without different types of optics.

    For example: When using an optic, Bots will be more accurate at long range, and less accurate at close range.

    Bots who are shooting at prone or crouching enemies are now more inaccurate.

    Bot accuracy when only a single body part is visible is now reduced.

    Updated and reworked how bots use flashlights slightly.

    Bots who are searching will turn their flashlight on when turning a corner if they are not a sneaky personality type.

    Added config option to disable sneaky bot search behavior.

    Fixed issue where bots would not properly sense bullets flying by them at range.

    Replaced function that detects this with a brand new one, and its working well.

    Increased distance that bots can see players shooting at them.

    Changes to bot vision:

    Peripheral vision is dramatically reduced, they see much slower, and can see less far on enemies further than 45 degrees to their side.

    Reduced Bot Raycasts against other bots to optimize.

    Bots will have reduced vision speed based on how many body parts are visible or not. So if they can only see your head, they will set you as visible far slower.

    Third Party: Bots have reduced vision speed against Non-Active enemies, if they are currently fighting and the other enemy is more than 30 degrees away from where they last saw their active enemy.

    Bots see enemies infront of them who have shot recently further.

    Hearing:

    Hearing range reduced across the board, but especially for bots without headsets (mostly scavs).

    Adjusted chance to hear footsteps, they are less likely to hear footsteps on the max range of their hearing.

    Added config options for max footstep range while not wearing headset.

    Added chance to hear enemy actions (reloading, ect) instead of it being always 100% chance, similar to how hearing footsteps works.

    Fixed Bot Taunting and Responding to Enemies being broken. Bots are talking a lot more now.

    Scavs now respond to friendly voicelines even when actively fighting an enemy, rather than only when at peace.

    (will need to be adjusted now, scavs are a bit too talkative)

    Added option to enable PMCs being allowed to aim for the head.

    Fixed bots not being able to sprint because other code was forcing them to look in a certain direction.

    Fixed bots not sprinting to cover while reloading or healing.

    Reworked bot sprinting, now working much better than before.

    New Stamina management system for bots sprinting. Bots will dynamically adjust how much stamina to use or keep in reserve based on the action they are doing.

    Fixed personality settings not being imported or saved properly.

    Reworked how bots look for and decide to fight enemies that are extremely close.

    Fixed bots ignoring other enemies that are closer when currently "DogFighting" an enemy.

    Fixed bots getting yanked back down to earth after jumping.

    Fixed console errors about coroutines being unable to be started on bots.

    Moved Headshot protection into the "Aiming" category.

    Tweaked sound detection distances and chances.

    Added config options to edit the range bots can hear different enemy actions such as reloading or healing. (Advanced)

    Added config option to change the max range to report enemy actions for bots without headsets.

    Fixed bots not actually "hearing" enemy actions, and thus not being able to act upon the information.

    Added frequency limit on the number of sounds a single player can broadcast to bots per second.

    Moved Max Footstep distance to global settings.

    Added missing sounds that bots can now hear properly.

    - Landing from a fall, Vaulting, Breathing, Heavy Breathing, Pain, injury, and Weapon DryFiring.

    Reduced the distance that bots can hear looting slightly.

    Increased the distance that bots can hear surgery from 40 meters to 55 meters.

    Increased the distance that bots can hear grenades being pulled slightly. 25 meters to 30 meters.

    Slightly reduced the distance that bots think is within range to rush enemies to better match the reality of the time it takes to get there.

    Reworked sounds from aiming, gear, prone, turning to better match the range that a real player can hear those things. Uses the same functions to calculate volume.

    Fixed (?) bots using surgery when enemies are too close, or they've seen them recently.

    Fixed bots not canceling surgery when an enemy is approaching.

    Fixed Errors from SelfActionDecisionClass.

    Fixed Errors from SAINPerson Constructor.

    Added Joke option to General Settings to add random 1% chance at a speed hacker, I could only get them moving about 1.5x as faster before I moved on. :P

    Reworked bot running, they should only pause sprint to turn when they actually need to turn now.

    Moved sain toggles for bots into a new category in global settings.

    Added additional options to disable sain for specific bot types. Requires game restart still for all options.

    Removed option to disable sain for player scavs, as p-scavs use the same brain type as PMC, and it would not work properly with the current method.

    Removed option to disable sain for raiders, for the same reason.

    Added check to make sure bots don't get stuck in SurgeryAction.

    Adjusted bot friendly fire checks to be more accurate, hopefully.

    Fixed bots being excluded from playing pain noises in vanilla EFT code.

    Bots now prioritize looking at their enemies last know position more compared to randomly looking around to check for enemies.

  • Version 2.2.5.4

    Major Issues Fixed:

    Fixed Issue where bots were getting incorrect information on whether an enemy was in line of sight or not, leading them to not be able to see targets infront of them.

    Fixed Issue where bots who get disabled by an AI limiter will ignore enemies after being reactivated.

    Fixed issue where bots were entering search quicker than intended.


    Performance improvements to coverfinder and bot vision raycasts.

    Adjusted bot sprinting to get them sprinting a bit more.

    Added null check to SelfDecisionClass

    Fixed bots T-Bagging while shooting at enemies sometimes.

    Added new config options to configure the distance that bots will ignore AI gunshots sounds when extremely far from the player.

    Added config option to personality settings to configure the distance a bot while "chase" gunshot sounds, or when they will ignore sounds instead.

    Fixed bot hearing sensor not working as intended and ignoring gunshots sometimes.

    Note:
    Due to resolving an issue with bot's hearing, I will likely need to rebalance it, as it seems scavs are having a lot of trouble hearing footsteps now. One bug fixed leads into another :D

  • Version 2.2.5.2

    Performance Optimizations to coverfinder.


    New: Added toggles to disable SAIN for Bosses and Normal Scavs. All behavior will be vanilla with these options enabled for those bot types. Also have a seperate toggle for player scavs. All disabled by default. Requires game restart after enabling or disabling.


    New: Reworked how bots react when enemies are very close, should be better at playing footsies and peeking enemies at close range.


    New: Reworked how bots stop and shoot for distant enemies.


    New: Personality Setting that tells a bot to kick every door they come across if they have an active enemy.


    New: Added new handling for how bots see you faster after repeat contact, instead of working off a timer like vanilla EFT, it now never expires, but scales by distance to the place they last saw you, it also works with hearing and where they last heard you, but to a lesser extent.


    New: Reworked personality settings to break them into categories (gui not updated yet). Old preset personality settings will be reset.


    Reworked how personalities are assigned and how the percentage chance works, it now scales with power level, so their chance to be assigned will increase up to a target power level, until it caps out at the assigned chance.


    New: Added special behavior for when bots detect an enemy using surgery or looting.


    New: Started work on bots considering more than just 1 active enemy at a time when making decisions.


    Fixed door desync while using Project Fika.


    Adjusted bot door opening to prevent them from freezing up for a moment after it opens.


    Trying some experimental stuff with doors in general, let me know if its hella broken.


    Fixed error from grenades in SAIN Bot Controller.


    Fixed bots not reacting to grenades.


    Reworked how bots react to grenades slightly.


    Fixed bots walking backwards off into the distance while they should be fighting.


    Reduced distance that bots will enter extreme close quarters fighting mode (DogFight)


    Fixed: Bots who hear a grenade explosion would consider the explosion position as a last known location, causing them to get confused and look towards where it exploded. They now estimate the thrower's position and go off that information.


    Fixed: Discovered and resolved issue where after a bot is shot, they will get instant, perfect information on their enemy location and look at them, now references their last known location and looks to that, which has randomized dispersion as intended.


    Reworked a lot of bot steering to fix many issues (still wip)


    Reworked how bot's enemies are assigned to make sure their active enemy is being set correctly.


    Slightly reduced the range bots without headphones can hear footsteps.


    Disabled some EFT bot functions that are resource expensive and rarely used by SAIN.


    Added more places that bots can try to throw grenades at to try to flush/kill their enemy.

  • Version 2.2.4.01-hotfix

    Fixed Null Reference in FindCrouchFromCover()

  • Version 2.2.4.01

    Forgot to include:
    New: When a bot hears a sound and it came from behind them, the random dispersion is now increased substantially.


    New: The max range a bot will shoot before swapping to semi auto is configurable now and depends on caliber (found in Global Settings => Shoot). Previously it was 40 meters for all bots and all weapon types, now it can go up to 100m for machineguns (for example)


    New: Added toggles for different bot types to force them to turn their flashlight off when they don't currently have an enemy to fight. (Default to force off for PMCs and Goons, toggles are found in GlobalSettings => Flashlight)


    New: Added a enforced delay/reaction time for how quickly bots can react to and hear noises, this changes depending on if they are at peace or have an active enemy. Can be changed in Global Settings => Hearing. (Default values are 0.2 seconds for when they have an active enemy, and 0.35 seconds when they are a peace (no enemy))


    Increased default range flashlights can dazzle a bot (40 meters from 30 meters)


    Fixed bots crouch spamming and returning to standing while walking around.


    Fixed bots trying to sprint then stopping in some cases (was caused by the above issue)


    Fixed bots looking in the wrong direction sometimes. Especially when moving to extract. Was caused by the code thinking a bot was sprinting when they were not.


    Fixed issue where bots would not add an obvious threat as an enemy and would ignore them.


    Fixed bots hearing and reacting to themselves.


    Fixed bots trying to run or move to cover that is unreachable.


    Fixed: Added additional check to make sure SAIN Coroutines are being stopped.


    Fixed: Added null check to BotUnstuck Coroutine.

  • Version 2.2.3.2

    Important!
    The standalone No Bush ESP and No Grenade ESP are now labeled as incompatible with SAIN. You must uninstall these to use SAIN.


    Update: Forgot to include a few changes.
    Suppressed bots will now have reduced accuracy, vision speed, vision distance, and more scatter, and the amount is increased based on more suppression.
    Bots in a squad will call out to their fellow members if they are close when clearing your last known position, often calling you a god damn pussy while doing so.

    Bots can sometimes Leap into cover (more of an easter egg) very low chance.

    Performance:

    Rewrote AI Cover-finder to increase performance substantially.

    Performance Optimizations all over the dang place.

    Simplified Search functions while I rewrite the system.

    Added AI vs AI fighting limiters to increase performance. Essentially - bots will think slower and be slightly worse at finding cover when only fighting other AI, especially if a human player is far away. (Can be disabled in settings)

    2 new bot personalities!

    1. Snapping Turtle - A player who finds the balance between rat and chad, yin and yang. Will rat you out but can spring out at any moment.
    • Rarer than other types (30% chance)
    • PMC only.
    1. Wreckless - Rush B Cyka Blyat. Who care if I die? Gotta get the clip.
    • Extremely rare. (3% chance)

    Squad Personalities! - Config options yet, but It is planned.

    1. Gigachads - Maximum Vocalization and highly coordinated.
    2. Elite - Quiet and highly coordinated.
    3. Rats - Were the rats.
    4. TimmyTeam6 - Very vocal, low coordination.

    Chad Personality types are now no longer PMC only, gigachad is still PMC only.

    Raiders, Rogues, and Bloodhounds can no longer be assigned Timmy or Coward personalities.

    Rewrote how AI Power level is calculated from scratch. Now takes into account way more variables and looks at the composition of their gear and attachments.

    Added a few fun easter eggs.

    New Personality settings: Jump Push chance, Can BunnyHop during jump push, BunnyHop chance (default is very low chance)


    Presets:

    Added a new default Difficulty Preset: Default with Harder PMCs.

    Reworked how presets are handled. Default presets are no longer exported and wont be in the Presets folder, only custom presets are handled in this way now.

    Old presets should work, but starting fresh is always recommended.

    Clarified the warning on a version mismatch for presets. Also made the warning smaller.


    Added new friendly response system.

    When playing as a scav, other scavs will respond with voicelines letting you know they are also a scav.

    AI Scavs will also talk with each other way more and be noisy (can be disabled)


    Added optional folder to zip with a few other mods from me.

    Bots now open doors WAY faster than before. (Can be disabled)

    Added brand new path finder for bots running to cover. They should get stuck on stuff and miss corners far less often.

    Completely rewrote how bots track your last known position using audio and visual cues from squad members and themselves.

    All information a bot has is "real" sensory input. Bots do not cheat.

    Bots will now see targets further away based on if the target has been shooting from that same position.

    Bots now get more accurate information the more shots are fired from a single position, simulating "certainty" in locating a sound source.

    Reworked most of the squad voice systems.

    Added a few new voice line situations for squads.

    Tons of new config options to tweak to your hearts desires.

    Slightly increased the height a bot aims for with Headshot protection turned on, should reduce the stomach shots.


    Added stealth bonuses or debuffs for gear. Currently the system is very limited. But currently the buffs are:

    Tan Ulach: 7.5% faster vision speed against enemies wearing this.

    Blue UNTAR helmet 10% faster vision speed.

    Pilgrim Backpack 7.5% faster vision speed.

    RAID backpack 6.25% faster vision speed.

    Boonie Hats: 15% slower vision speed.

    Any face cover: 2.5% slower vision speed. (even the mustache)


    Squads now communicate between each other more information on a shared enemy. If 1 bot knows you are healing, they will report that to the others. So now you can get jump shot by an entire squad! Yay!

    New Squad Decision - Push Suppressed Target - If a fellow member is suppressing an enemy, other members will push hard to kill the suppressed enemy.

    New Squad Decision - Group Search - Bots will follow the squad leader and attempt to search together.

    Goons are now fully utilizing SAIN PMC AI. Good Luck.

    Bots who are prone or aiming down sights now experience 20% less recoil impulse, making them more accurate.

    Bots with machineguns will lay down suppressing fire more consistently and for longer.

  • Version 2.2.1

    2.2.1 -

    Fixed bots sometimes failing to react to being shot when they can't see their enemy when they were previously at a peaceful state (No Enemy or No threats heard)

    Fixed incompatibility when using both Jiro's Battery System and Realism Mod.

    Adjusted some numbers that were resulting in bots being a bit too easy than intended.

    2.2.0 -

    Looting bots integration (requires latest looting bots version)

    Bots will extract when their inventory is full and they have picked up enough loot to satisfy them. (Can be configured in Global Settings => Looting Bots

    Bots will see you slightly faster or slower depending on your speed and pose, if you are sprinting they will see you much faster.

    Bots will see targets slower if their target is above them, and faster if they are above their target.

    Reworked GUI. Added ability to rename presets in the gui. Editing a default preset now automatically creates a new copy.

    (still a bit jank, working on it)

    Optimized and greatly improved Cover finding for bots.

    Reworked Headshot protection entirely. It's much more consistent and reliable. Now On by default.

    Reworked bot recoil entirely. It has a more direct impact on their aim.

    Bots who can't currently see their enemy but are being shot at will fire blindly toward the source. (especially at night)

    Tweaks and adjustments all over the code.

    Nerfed bots AD/AD strafing sometimes. it's smoother and less frequent.

    Adjusted and added new voicelines for bots in squads.

    PMCs will react better to hearing enemies.

    Scavs will talk and respond to your voicelines if you are a scav.

    Bots can rush their enemy in more situations, like if their enemy is heavily injured, or prone and healing up.

    Bots with machine guns will lay down more suppressing fire.

    Bots will go prone with under fire and far from any cover if it protects them more.

    Bot movement and steering is smoother and less jittery.

    Fixed bots leaving flashlight on during the day.

    Added optimizations for bots that are far from the player.

    Fixes issues when using SAIN and Project Fika

    Added Performance Mode in General settings.

    Added tons of new config options in personality settings.

    Fixed bots using surgery at bad times (mostly)

    Greatly reduced chances of bots getting busy hands bug.

    And so much more.

    Known Issues:

    Bot aim is a jittery when shooting at close range.

    Performance in this version should be better overall, but feedback is required on more PCs on the actual difference.

  • Version 2.1.12

    This version will only work with SPT 3.8.0

    • Fixed major issue that caused bots to not get proper position info on the Player.
      • This was the cause of a lot of strange, unintentional behavior. Bots feel better than ever to fight. This should fix bots healing when in line of sight of the player, among many other issues.
    • Bots can be suppressed now. Suppressed bots won't lean out of cover and will usually wait in cover until a while after they have been suppressed.
    • Bots will shift between cover less often overall.
    • Rats will no longer shift between cover.
    • Added option in personality settings to enable or disable cover shifting.
    • Added advanced config options to modify shift cover behavior. (Global Settings / Cover)
  • Version 2.1.11

    This version will only work with SPT 3.8.0

    Update for SPT 3.8.0

    • Resolve issue where bots on Ground Zero can cause massive framerate drops
  • Version 2.1.10

    This version will only work with SPT 3.8.0

    Update for SPT 3.8.0

    • Updates necessary to work with SPT 3.8.0
    • Improved fallback behavior for bots