RimWorld

RimWorld

Smarter Raider AI
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
Azerbaijan_Technology 27 Jun @ 5:27am 
Does this mod allow for faster enemy raider reaction in general? In vanilla, they usually prefer walking past your colonist instead of reacting.

This is the most important aspect of the defunct CAI personally.
gus_blatnoj 25 Jun @ 1:50am 
Hi, developer!
Could you please add an optional setting that changes raider behavior as follows:

-When a player colonist falls into an unconscious (critical) state, raiders immediately start executing the colonist; :steamhappy:

-Alternatively, when a player colonist becomes unconscious (critical), raiders immediately try to capture and carry them off the battlefield as a prisoner; :steamhappy:

The idea is to prevent raiders from ignoring player colonists who are lying unconscious at their feet, and instead make them actively prioritize either finishing them off or kidnapping them during combat, not just after the fight is over.
gus_blatnoj 25 Jun @ 1:34am 
Alright, CAI-5000 is officially dead. Open up the donation link and take its place.:steamhappy:
pogoman  [author] 23 Jun @ 12:51am 
With dev mode on turn on the setting 'show avoid grid'
ForestSingleRank 22 Jun @ 9:36pm 
how can I see the red area(pawn attack area) on your cover page, is that a mod or debug function?
Bunuffin 22 Jun @ 1:02pm 
Thank you for keeping this alive <3
pogoman  [author] 22 Jun @ 10:35am 
Didnt realise 1.6 was already out updated now. There's a few non gameplay affecting errors in the logs in certain situations. Will fix at a later date as am on vacation for a week from tomorrow. Ive only done a couple hours testing against the unstable beta branch so any issues please leave comments here and i will take a look in a weeks time
renegade_sock 21 Jun @ 2:42pm 
Really hoping this gets updated, god knows the ai needs all the help it can get
Bunuffin 10 Jun @ 2:15pm 
Thanks for this CAI has been broken for me and this is a life saving... Base AI is just trash
Deankiller Turnupseed 12 May @ 5:56pm 
i just cant add a rule to sort it before ce without rimsort jibbering about being unable to sort now
Brumes Wolf 1 May @ 2:41pm 
I doubt anyone else has or will run into this, but if you have the CE performance fix setting turned on *and* you have the most up to date version of the CE dev branch, this mod breaks a third mod, namely "Grenade Tweaks". If this helps anyone it means my suffering was not in vain.
deltaplays010 22 Apr @ 3:01pm 
thanks, this is exactly what i was looking for, something to make raids more realistic, rather than just a bunch of nameless cannonfolder tossing themselves to the line of fire
Kasa 1 Apr @ 6:37am 
Mod does what is says on the tin, making the game MUCH harder.

Pretty much all typical base defence strategies no longer work, almost like the raiders now have a complete map of your base.

I recommend folks using mods like Seamless Embrasures + Breachable Embrasures (may be incompatible with this mod though) to compensate.
Nishe 14 Mar @ 6:18am 
I haven't used this mod but I'd have to second @PookySmile's comment if that's true - if they automatically avoid any area a mortar is targeting that more or less makes mortars useless. Also just not very reasonable that pawns could visually track shells flying through the air and know where they're going to land. If that gets fixed I'll use this mod, otherwise I'll wait.
The Filnir 2 Mar @ 8:19pm 
Thanks. This will help with my crippling suffering addiction.
gnar 14 Nov, 2024 @ 6:13pm 
ooo this looks like a good version of careful raids, thanks!
skycrossercat 18 Oct, 2024 @ 11:33pm 
might need to inform you that this mod is incompatible with mod "grenade tweaks", if loaded together (load order doesn't matter), throw grenade over wall function would not work
yaroslav.sventsitskiy 21 Aug, 2024 @ 3:55pm 
I have a suggestion - could you add an option to make enemies beyong a certain intellectual skill (for example, less than 4) ignore smart tactics? I think it would be a fun addition, since there is already an option to make raiders dumber by technological level
PookySmile 20 Aug, 2024 @ 4:08pm 
This mod makes enemies avoid mortars. As soon as I pick a target on the ground (even before the mortars start aiming) the enemy raid just scatters away from that point. It's way too OP.
llunak 5 Aug, 2024 @ 10:49pm 
@pogoman: After thinking more about it, I'm not anymore that convinced the AI choice was so bad. Going straight above would mean attacking my defence position with not much cover, so it kind of makes sense going through the fungus room, as that shortens the exposed area. It's just that the execution was poor and the group split too much. I suggest considering the following improvements:
- Only one or few raiders with the highest mining or breach equipment will dig, the rest will wait (so basically how vanilla breaches work). Or maybe cancel the dig orders when some finish, I don't know which one would be better.
- If the raiders are primarily melee and they outnumber colonists, do not bother with cover and rush (maybe a % chance this happens, depending on melee count and pawn ratio?).
- If there is fighting taking place nearby, stop digging or destroying buildings and try to join the fight.
bajo jajo 4 Aug, 2024 @ 2:38pm 
im struggling HARD with this mod and combat extended pikemen - turns out centipedes arent that scary after all
pogoman  [author] 4 Aug, 2024 @ 3:17am 
Redundant this mod does the same thing they will breach embrasures. Majority of play testing was done with CE enabled. @Ilunak I'm on vacation at the moment will be back in a week and take a look then. No need for save file your scenario is clear from the image. Looks like they were potentially going for the water pump and the dig jobs didn't expire when the wall was breached. Will take a look next week
Arthur GC 3 Aug, 2024 @ 8:28pm 
Is this mod redundant or incompatible with PawnTargetFix and "Breachable Embrasures - An AI-Behaviour Change"?
llunak 30 Jul, 2024 @ 2:33pm 
(continued)
Additional problem was that the entire group started digging, but once one of them managed to dig though the wall, the others didn't use the hole, they continued with their own digging. So the raiding party also split into smaller parts depending on when each pawn finished digging, which gave me even more time and made dealing with the raid easier.
llunak 30 Jul, 2024 @ 2:33pm 
I have also run into a problem with dig vs go around. Sadly this time I do not have an easy reproducer, I made a save only when they were already at the digging place, and also it's my playthough with 50+ mods and it does not load properly without them. Is there any point providing that save?
But, in short, I got raided, the raid started at https://imgur.com/a/5lMF9Hw in the upper right corner (where the blood stains begin). I expected the raiders to go around (above the mountain), but they instead went down and started digging through. I assume the AI made this decision because there wasn't much cover when going above, but they are all melee characters, so no point in seeking cover, and they also have a big numbers advantage, so they could simply rush and overwhelm me. By going down, they gave me quite some extra time to prepare.
pogoman  [author] 29 Jul, 2024 @ 12:08am 
Thanks for the kind words much appreciated! The decision threshold at which they dig vs go around is a tricky one. I would definitely like them to dig less if it is safe to go around but havent had much luck changing the obvious path cost values. setting BlockedWallExtraForNaturalWalls to 10000 didnt seem to have much of an effect so i think the magic variable lives somewhere else. Needs some more investigation for sure
J 28 Jul, 2024 @ 4:55pm 
@pogoman:

Message 1 out of 3.

Not sure if the recent update had something to do with it, but I couldn’t reproduce after updating to 1.5.1—it’s also possible that scythers digging through a 5x3 hill instead of pathing around it towards my pawns was a product of very specific circumstances.

In any case, that 5x3 natural wall case isn’t really an issue, because in the end, you just move your pawns to regain the line of sight and that should make the enemies stop digging—at least it did in my case. It didn’t really affect the gameplay negatively in any major way.
J 28 Jul, 2024 @ 4:55pm 
@pogoman:

Message 2 out of 3.

Speaking of the removed BlockedWallExtraForNaturalWalls, while I was trying to reproduce it, I noticed that if the natural wall is 4 tiles wide [i.imgur.com], scythers don’t path around and dig, if it’s 3, they do. I think the question is then: should they even path around 4 tiles wide walls? I don’t have a strong opinion on this, because them refusing to path around also works gameplay-wise. Not asking for changes, just sharing.
J 28 Jul, 2024 @ 4:55pm 
@pogoman:

Message 3 out of 3.

Also, I did extensive playthroughs with both CAI and Smarter Raider AI at this point, I’ve got to say that SRA is so underrated. While I appreciate the technical details of CAI, I feel like these details don’t support the combat design in the way that I hoped they would—unless maybe you play with the fog of war, but it’s not a gameplay change that everybody can enjoy.

SRA, on the other hand, does just enough to elevate RimWorld’s mechanics without sacrificing mod compatibility. Props to you for making this—it's one of those mods that’s so good, it should join Wall Light in Vanillahalla.
pogoman  [author] 28 Jul, 2024 @ 3:12am 
I have posted a small but critical update based on a bug report from @llunak. @J please can you test your scenario and see if the behaviour is any different. BlockedWallExtraForNaturalWalls wasnt behaving as expected so it was removed yes. @J if your issue persists can you try reproducing with a save file that only has this mod enabled, and create an issue on github as llunak did and attach said save file. Will make it a lot easier for me to debug the issue
llunak 27 Jul, 2024 @ 8:04am 
@pogoman: I have reported an issue on github, in case you do not watch those.
J 26 Jul, 2024 @ 8:14pm 
@pogoman:

Finally playing the game, wanted to test BlockedWallExtraForNaturalWalls, but apparently, it’s no longer a thing. Still, want to share my experience, please take a look at this screenshot [imgur.com]—there’s some context to explain. Mechanoids are moving from an off-screen location in the direction of the red arrow, around that time my colonists are standing at the red cross. When scythers got to their current location on the screenshot, they noticed my pawns and started digging through instead of pathing around the walls. I then moved my pawns to where you can see them on the screenshot and both scythers stopped digging, began to approach.

It’s fine if modding RimWorld isn’t your focus at the moment, just wanted to throw it out there and say that I can test things for you right now.
pogoman  [author] 4 May, 2024 @ 10:32pm 
Yeah there's some code in vanilla that runs for each enemy and is set to check for enemies that come into range and the default is every 8 seconds. So for example you could come in to range at 7 seconds on the clock and they will react in 1 more second, or you could come into range at 1 second and they would take 7 seconds to start shooting back. So i just halved the number. Not sure if it was done like this for performance reasons but the impact seems negligible.
5150 4 May, 2024 @ 10:56am 
I find it more enjoyable to install this mod than to haphazardly increase the game's difficulty level. I'm currently using 250 mods, and they don't seem to have a significant impact on performance. It's a truly intriguing mod. In vanilla, enemies always take cover before shooting, but with this mod, enemies react immediately and start shooting first.
stun 30 Apr, 2024 @ 9:17pm 
Inhumanized doesn't mean they're lacking in intelligence, just that they don't have beauty or outdoors needs and they can't do animal handling
pogoman  [author] 26 Apr, 2024 @ 1:59pm 
Good to hear thanks for checking
Michiko 26 Apr, 2024 @ 10:19am 
So far in my testing it seems to work fine. It seems that shamblers (undead zombies) do avoid turrets but they already sorta did that a bit in vanilla. Shamblers normally already like attacking walls instead of trying to come straight into your base, which makes sense. Like think of a typical zombie movie and you're likely to see zombies just crowding a wall if they can't find a way in either.

Cultists are definitely affected and will try to find ways around your base, which is fine. Normally they're meant to be slightly mindless as they're "inhumanized," but they are able to use weapons so maybe there's supposed to be a bit of intelligence left.

Invisible enemies don't appear to be affected but it's hard to tell. Anyway they can break into your base just fine unless you seriously wall up, which is good.
pogoman  [author] 26 Apr, 2024 @ 7:09am 
It doesnt affect manhunters but it does affect mechs. Anomaly im not too sure. This mod may make them avoid turrets which could break immersion given they are zombies. If anyone tries it out let me know
Michiko 26 Apr, 2024 @ 7:00am 
Very promising and I'm definitely gonna try it out. Does it only affect raids, as in with human/humanoid enemies? Like mechanoids and manhunters aren't affected? Because if so that might be a good thing, in particular, since you mention not having tested it with Anomaly, I'm curious to see how it handles Anomaly's various attacks, most of which boil down to basically various kinds of zombie/monster attacks.

I for one would rather that this doesn't affect anything but intelligent human enemies. Though the vanilla behaviour already has some zombies attacking your walls to begin with.
Kompaktive 26 Apr, 2024 @ 6:39am 
@pogoman thanks, I appreciate it. I'll try it sooner or later