RimWorld

RimWorld

140 ratings
Smarter Raider AI
2
3
3
4
   
Award
Favorite
Favorited
Unfavorite
Mod, 1.4, 1.5, 1.6
File Size
Posted
Updated
262.790 KB
11 Mar, 2023 @ 9:56am
5 Jul @ 3:35am
95 Change Notes ( view )

Subscribe to download
Smarter Raider AI

Description
Tynan says Rimworld is a storyteller, not a skill test. This is for people who want it to be both.

This mod focuses on reworking the raid AI strategy to be more in line with what a player would do, all whilst attempting to maintain vanilla performance. This is done by leveraging the existing vanilla avoid grid used in smart raids and extending it to incorporate player pawns as well (not just turrets).

Summary of main changes:
  • All enemy pawns will now avoid areas your turrets or drafted pawns have line of sight to (yes no more killboxes).
    Note: If a turret or pawn is engaged in a firefight the avoid grid will be disabled for that unit, meaning other raiders will now consider the area safe to advance into. This promotes initial strategic movement of raiders around your defences, but then simulates the chaos of war once the battle commences.

  • If a pawn dies a temporary 1 tile radius avoid grid will appear to tell other raiders to go around if they can. This negates the effectiveness of trap killboxes and stops raiders queueing up for death at any given entrance to your base.
    (similar to Careful Raids mod. Thanks @Nidvinter for suggestion).

  • Any raider with a weapon defined as breachable (set in mod options), will now attempt to breach first (regardless of whether it is a breach or normal raid). By default these are weapons including the keywords "stickbomb, concussion, doom, triple inferno, chargeblast, thermal, thump". i.e. a raider carrying a doomsday will fire it at your walls if there are no available colonist targets.

  • Raiders will prioritise pillaging and destroying colony buildings and will take the safest path to do this. If there is no safe path and they have no breachers then they will sap/attack walls in the safest locations.

  • Raiders will now engage enemies behind impassable cover (i.e. embrasures) within 2-4 seconds of coming into range (vanilla default is up to 8 seconds).

Due to all of the above it is much harder to 'Game' the AI. Strategic defence of the whole colony and not just one entrance is very important.

If you would like to see how the mod works you can toggle show avoid grid in dev mode and then spawn a raid.

Compatibilities:

Can add/remove from save without issue.

Incompatible with Careful Raids.

Compatible with Combat Extended (load this mod after).

Partially compatible with CAI (load this mod before). CAI does not use the avoid grid generated by this mod, so only SRAI's breaching and sap changes work while both are loaded.

Will be flagged as incompatible with Line of Sight Fix. The code causing the conflict is an optional performance fix for Combat Extended than can be disabled in the in-game options. If you aren't running Combat Extended this option will be hidden and disabled by default, however regardless of the state of the setting Rimpy will still complain, as the code exists in the dll. But there won't actually be a conflict unless the option is specifically enabled. The code itself dynamically redirects patches to the los function to use vanilla code in certain situations as the CE los function is poorly optimised.

Github: https://github.com/pogoman/Smarter-Raider-AI

========================================

My other mod:
No Foreign Xenotype Wanderer Join Events
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2973997911
Popular Discussions View All (1)
3
5 Jul @ 3:48am
1.6 bug possibly yours
moo
156 Comments
Brumes Wolf 5 Jul @ 4:56pm 
Yeah this on 1.5, that explains it
pogoman  [author] 5 Jul @ 6:31am 
Are you running 1.5? I'm only making changes to the 1.6 branch now given it's full releasing next week
Brumes Wolf 5 Jul @ 4:37am 
I'm not seeing that setting, did a reinstall and its still not present.
pogoman  [author] 5 Jul @ 3:37am 
Alright pushed a little update with configurable reaction time settings. There is a min and max value and the actual reaction time is randomised between the two. I ran a few tests at 0.1s reaction time and it was definitely laggy during larger raids, so recommend probably minimum of 0.5s
Azerbaijan_Technology 1 Jul @ 7:55pm 
That's very cool to hear. Hope to see it soon some day
pogoman  [author] 1 Jul @ 12:54pm 
I assume it was originally done at 8s for performance reasons. I'll run some tests at max raid size and see how low is ok these days. Could make it a parameter in settings as well i suppose
Azerbaijan_Technology 1 Jul @ 11:47am 
Is it possible to reduce the reaction time even further? It's quite important when playing with combat mods.
Thank you.
pogoman  [author] 30 Jun @ 7:32am 
@gus short of any bugs or super simple features i won't be extending the mod further as am flat out with other projects
pogoman  [author] 30 Jun @ 7:31am 
Yeah they engage new targets in 2-4s instead of the vanilla default of 8s. @big cheese I'll need more context, does it happens every time, without other mods etc
Big Cheese 28 Jun @ 7:31pm 
There's a large chance that my raiders just decide to... retreat. Without any message, or their names turning blue. They just walk out of the map