RimWorld

RimWorld

Smarter Raider AI
221 Comments
Azerbaijan_Technology Aug 30 @ 7:32am 
It's always nice to know how the mod actually works, appreciate it.
pogoman  [author] Aug 26 @ 11:47pm 
The current modifier i went with is there's an 8% chance on a raider taking damage for the wave to attack, so it's still a little random. Previously 30% of the wave had to die. If you open up dev mode you can test, usually takes about 5-6 instances of damage before they attack. Improved reaction time depends, if they are breaching they are less likely to react to attacks as they have a mission. This is in the base game and i left it as if they can breach your walls quickly it's of higher strategic importance. Might be you arent talking about breachers here so let me know more details
Azerbaijan_Technology Aug 26 @ 10:05pm 
I don't believe the prompt to make preparing raiders attack earlier when shot is working, I'm also not 100% sure if the improved reaction time actually works.
pogoman  [author] Aug 25 @ 3:59am 
yeah i dont have anomaly so havent been able to test shamblers unfortunately. @안녕하세요 any feature in particular you would like toggleable? Some things can already be toggled off like every raid sapping, smart raids can be disabled by setting min tech level to ultra etc
Melon Aug 23 @ 9:02pm 
I think this mod really slowed down shamblers for me. Not sure what causes it but they often stand around doing nothing. All raiders sometimes have moments of idleness but its particularly noticeable in shamblers. Other than that though the mod has been working great.
안녕하세요 Aug 15 @ 11:12pm 
각각의 요소를 활성/비활성 할 수 있게 해주실 수는 없을까요? 그러면 정말 좋을 것 같아요

Could you make it so that each feature of the mod can be enabled or disabled individually? That would be really great.
Nic Aug 15 @ 12:18pm 
oh and one funny observation (not funny as in ha ha), the musket does 29 damage but has 5 sharp pen, the R-6 Charge Rifle has, I think, 12 damage but can pen anything, I can't think of a reason why a round ball fired at you at less than the speed of sound does more damage than literal plasma fired at you over the speed of sound, either way, R-6 rifles rule and muskets drool because of their inability to fire many rounds thus not doing really any suppression nor even having that high of a chance to hit any rounds because there's not many rounds being fired
Nic Aug 15 @ 12:12pm 
with the 7.9s reload time and how close the raider was, he definitely could've got to my pawn before he reloaded so him going after my pawn would've been ideal, I think that an easy fix to this situation is just having the raiders prioritize the guy with a weapon that's right there, then ransack your base, then, I guess, other pawns on the map, funny though that these raiders are addicted to destroying my horseshoe pin like it's crack, but like a chronically addicted crack addict, it's going to get them killed, still funny though, if I were the one making this mod (and even knew how to code and not just change variables in files as the only way to mod, and delete stuff) I would set the priority to destroy the horseshoe pin if it's in the open to be really high, new game mode, protect your horseshoe pin.
Nic Aug 15 @ 12:08pm 
what exactly happened was there was a ruin on the left, a mountain on the right, a ~5 cell gap between the two, and my base below, the raid came from above, I would just wait in the ruins for him to start coming my way so he didn't use his gun to shoot at me (which he switched between weapons really well, no problems there) then once he was decently close and out of cover I would take a pot shot at him then go back behind cover to reload, one time though he didn't run back for cover and just kept on going, I'm guessing it was because I waited extra long for him to get closer and going between the ruins and the mountain where I couldn't shoot him was closer than that other cover
pogoman  [author] Aug 15 @ 2:31am 
actually i think there's a threat point metric per pawn that could be used for this. will investigate
pogoman  [author] Aug 15 @ 1:16am 
@Nic if your pawn was in combat mode and waiting with a musket the raider would have tried to avoid him. It raises an interesting point though, in this instance the raider was technically stronger. I predominantly used to play with CE so any pawn with a gun was always a massive threat. Could add a table of threat levels for different guns in the options. Musket sounds like it would be pretty low down
Nic Aug 14 @ 8:05pm 
also god bless you @Wesdabest for bringing my attention to a fog of war mod
Nic Aug 14 @ 8:05pm 
pogoman, you have done a great job at making these raiders utter bastards, first raid I get and the guy just refuses to be shot and doesn't even go for my pawn, he just runs by and goes for a door and (of course) my horseshoe pin, him ignoring my pawn does lead to his death so not very tactical on his part since it allows my guy to get in a good position to just shoot him, idk if you want to tweak that so the enemy doesn't just make a mad dash past your pawns 7 cells away to beat on a random door, I mean seriously, that poor door, I didn't even really have armor and he had a gladius and I missed with my musket so he could've easily came up to my pawn and sliced and diced, good thing the only things I lost were a door, horseshoe pin, and my pawns dignity for missing so many times
Wesdabest Aug 14 @ 9:14am 
@Redsnow, just a heads up that NWN Fog of War mod has been doing great for me in 1.6. Not sure if they've posted to the workshop yet, but I installed the mod from Github and it's been working for me with no issues for the past 2 weeks.

Here is the link for the Fog of War: https://github.com/ajperson1927/NWNRealFogOfWar
pogoman  [author] Aug 14 @ 6:09am 
aha yeah certainly would be. It would be much simpler for someone to fork CAI and just upgrade it to 1.6. Surprised no one has done it yet but perhaps this is easier said than done
Redsnow Aug 14 @ 4:01am 
since cai 5000 is dead, would adding a fog of war be a big task?
pogoman  [author] Aug 14 @ 3:57am 
@Wesdabest in the settings you can remove allowed breach weapons for any you dont want them to waste ammo with.

Re the sapping logic, they do priorities walls/doors with lower hitpoints (assuming they arent in dangerous areas), unless already reserved by another pawn. i think there is a limit to how many pawns can sap a single wall, so will double check this and get back to you.
pogoman  [author] Aug 14 @ 1:21am 
ive uploaded a patch to remove the 8% chance on harm to cancel the siege, and switched stage and attack/prepare raids to 8% chance on harm to cancel instead of instantly cancel on any damage
pogoman  [author] Aug 14 @ 1:07am 
@Redsnow
these are the vanilla triggers for sieges:
transition2.AddTrigger((Trigger) new Trigger_Memo("NoBuilders"));
transition2.AddTrigger((Trigger) new Trigger_Memo("NoArtillery"));
transition2.AddTrigger((Trigger) new Trigger_PawnHarmed(0.08f));
transition2.AddTrigger((Trigger) new Trigger_FractionPawnsLost(0.3f));
transition2.AddTrigger((Trigger) new Trigger_TicksPassed((int) (60000.0 * (double) Rand.Range(1.5f, 3f))));

Trigger_PawnHarmed(0.08f) means there's a an 8% chance on a radier being damaged to cancel the siege, which in my opinion is pretty dumb. Should be hard to stop a siege, 30% of raid lost is probably ok here
Nic Aug 14 @ 12:04am 
CAI 5000 wont update so I am going to different mods, even if they wont fill the gap in my soul like CAI 5000 did
Redsnow Aug 13 @ 5:02pm 
like if a siege for example would insta start a raid on your base once one person is shot, it would make sieges easier since no mortar fire
Wesdabest Aug 13 @ 4:38pm 
pogoman, this is a great mod. Thank you for your work.

One suggestion: Any way to make the raiders work together to destroy a single piece of wall instead of all the raiders hitting and shooting at different parts of the wall?

Second suggestion: Any way to have the raiders target low hit point doors instead of walls, if a door is nearby?

Third suggestion: For those of us playing with CE or LTS Ammunition mods, any way to add a toggle in the mod options so that raiders don't attack walls with ranged weapons and instead melee the walls (even if holding a ranged weapon) so they don't run out of ammunition before they destroy the wall?
Redsnow Aug 13 @ 4:29pm 
i think something like, will fight back and chase a bit, and if an enemy dies or a certain percentage the whole group starts teh raid, but yeah a small config menu for that would probably give players their preference
pogoman  [author] Aug 13 @ 3:29am 
could also tweak how far they are willing to chase, but still means you could draw them out one by one so really the whole group needs to aggro together. will take a look a bit later
pogoman  [author] Aug 13 @ 3:28am 
Give it a playtest for a bit and see how this goes it's an easy one to change. The main options are percentage of raid lost, single raider lost, damage taken, enemy spotted etc. Default for vanilla was 30% of raid lost. Can always add it as config as well if it comes down to player preference
Redsnow Aug 13 @ 2:59am 
but yeah i agree with the comment before me, preparing raids should be still kinda preparing, not be helpless but not also go full force rush your colony down as soon as they spot a scout shooting at them. not sure what a realistic behaviour would be
Redsnow Aug 13 @ 2:56am 
thanks, this makes a lot more sense then them being literal nps that dont care being shot at, will all raids attack if there are multiple groups or just the attacked group if there are multiple?
Azerbaijan_Technology Aug 12 @ 5:55pm 
There has got to be a happy medium between zero reaction to half of the raid being killed and immediately attacking from a gust of wind.
Alot of the stand off options like sniper rifle are already pretty shitty due to all AI behaviour being blind rush.
Smiley Face Killer Aug 11 @ 7:57pm 
I noticed this earlier. Was weird being able to take down an entire raid before they decided hey there's like two of us left standing, let's attack now. Then immediately decided to flee.
Glad to hear of a patch, hoping tomorrow's preparing raids will be more dangerous
pogoman  [author] Aug 11 @ 2:00pm 
have uploaded a little patch now. They should start the assault as soon as your damage one of them
pogoman  [author] Aug 11 @ 1:22pm 
yeah you can shoot them with a sniper rifle all day long, if you are out of their range they will just chill until attack time (vanilla behaviour). Never really thought about it before but i agree its bad ai . i'll take a look at the triggers see if i can switch them to assault on taking damage.
Redsnow Aug 11 @ 11:27am 
But they dont even fight back, expecially melees, they chase you 10 meters, but then turn back around and return to camp. you keep shooting them but the melees individually are not agressive enough to attack you when out of range. are you sure that is nothing caused by the mod? cause i also had like a 25 miltor raid, and i could just mow them down from the range without them ever coming close to attack me. and they only started attacking me when the timer was over for the preparation
pogoman  [author] Aug 11 @ 10:13am 
@plaerjilion_RUS У меня сейчас мало времени на запросы функций, поэтому я сосредоточен только на ошибках. Но я учту ваше пожелание в будущем. Обратите внимание, судя по комментариям к этому моду, он работает в версии 1.6, просто официально не обновлён. Вы можете отредактировать конфигурацию мода, указав версию 1.6 на DLL-файл версии 1.5, и всё должно заработать.
pogoman  [author] Aug 11 @ 10:10am 
@Redsnow it's not enough to attack them, you have to kill like roughly 30% of the raid. Only then will they assault early. Just tested this with no mods and SRAI. Same behaviour for each. Can test with dev mode enabled spawn raid specific StageThenAttack
plaerjilion_RUS Aug 11 @ 12:53am 
plaerjilion_RUS Aug 11 @ 12:50am 
@pogoman как вам идея добавить к вашему замечательному моду функционал другого мода, который называется enemy self preservation?Данный мод уже не обновляется. Думаю к улучшенному ии он подойдет великолепно. Кратко этот мод добавляет, что если рейдер получает определенный процент ранений он убегает.
Polluxo Aug 10 @ 3:37pm 
Thanks!
Redsnow Aug 10 @ 1:45pm 
@pogoman not a mod called preparing raids, but raids that dont immediatly attack but the notification says they will prepare for a while to attack, you can just run up to them and shoot at them. they will chase a little but run back to their waiting point. They dont start attacking you even if provoked, unlike vanilla where the notifcation comes that they will start the attack once you shoot at them
pogoman  [author] Aug 10 @ 7:52am 
@polluxo simple sidearms and ce bug should be fixed now. If they run out of ammo they should no longer get stuck in a loop
pogoman  [author] Aug 10 @ 6:52am 
@A_T let me know if you see any more pawns freezing after the patch i just pushed
pogoman  [author] Aug 10 @ 6:51am 
pushed a little patch to handle exceptions and default to vanilla behaviour when they occur. Quick fix until i have time to playtest 1.6 properly.@Redsnow which mod is preparing raids? cant find it on workshop
Redsnow Aug 9 @ 2:40pm 
Its not a bug that happend just in 1.6 it was already existent in 1.5, i dont use any other mods that influence raider behaviour
Redsnow Aug 9 @ 1:53pm 
The mod causes preparing raids to not fight back when you attack them, is there a fix for this?
Azerbaijan_Technology Aug 9 @ 1:03pm 
"Exception in Verse.AI.ThinkNode_Priority TryIssueJobPackage: System.NullReferenceException: Object reference not set to an instance of an object
[Ref 79842F12] Duplicate stacktrace, see ref for original"

I'm getting this sort of error during raids where enemy pawns would sometimes randomly freeze in motion for some reason, do you think this is related?
pogoman  [author] Aug 6 @ 1:42am 
I've had an idea to deal with the sticky bomb issue for awhile, basically make them go one at a time as sometimes you get tribal raids all with sticky bombs and they can chain reaction blow themselves all up lol. Will look at it next patch. Note by removing cannon war Queens and diabolus won't breach, no biggie but they are crazy good breachers. If it add back in BurningCannon and NeedleCannon they should be back on again
Polluxo Aug 5 @ 10:31am 
@pogoman Thanks, yeah. I did remove the weapon keyword that they were using which was "cannon" and one of the pistols they'd come equipped with was hand cannon. That seems to have fixed that issue, however they're very liberal with the use of sticky bombs, like 5 of them will throw their stickybombs at one spot, sometimes killing a few of themselves in the process.
pogoman  [author] Aug 5 @ 12:23am 
So there's two potential issues here. I haven't tested the scenario of Raiders running out of ammo when trying to breach in awhile, and it relies on the ce weapon internal class names staying the same. I just fixed a bug with ce turrets because in the latest build they've renamed the base turret class so it could be the same thing here. Simple sidearms may complicate things further, I've not tried that mod before. In any case I'm curious what weapon they were trying to breach with? I'm out of office till next Monday but you can try editing mod options and removing the keyword that indicates that weapon should be used for breaching. Then at the very least they will just sap/dig and avoid wasting ammo
Polluxo Aug 4 @ 9:59pm 
I also have simple sidearms, maybe it's a conflict with that mod?
Polluxo Aug 4 @ 4:06pm 
I have a cave base, and a raid group spawned on the other side of the map. There is a tunnel to get to my base from the back, where the raid group started. They started going that way but attacked the side of every narrow passageway smaller than 2 tiles even though it wasn't necessary and so far away from where my home was. They did this until they ran out of ammo since I have CE installed, then they bugged out and just stood there while one of the raiders kept trying to switch to their pistol which didn't have any ammo.
Soaryn ツ Aug 2 @ 6:53am 
Thanks, it really didn't look like anything broke