RimWorld

RimWorld

Smarter Raider AI
229 Comments
feihuxia 21 Oct @ 3:07pm 
could you delete a temporary 1 tile radius avoid grid,in another page downloader?
Vril 19 Oct @ 11:31am 
Doesnt hold a candle to CAI mod, but its better than vanilla at least.
mtjoel 19 Oct @ 7:43am 
Good alternative for CAI on 1.6 since unfortumately they likely wont be updating it
Eddlm 16 Oct @ 3:52am 
Could you make the "avoid tile if someone died here" a configurable radius? A bigger radius may make the pawns more dynamic, would love to try it. Also is there any possibility that the "priorise pillaging" can be made configurable? As in, priorise destroying stuff, or kidnapping, or killing. Out of curiosity.

And thanks for your work!
Vintage Fruitcake 2 Oct @ 8:27pm 
https://gist.github.com/HugsLibRecordKeeper/a79f29bfa3ef4d048a155535b2e27c5e
Full log if you need it. I'm running a fair number of mods, so I only gave a pastebin of the relevant NRE.
Vintage Fruitcake 2 Oct @ 8:24pm 
https://pastebin.com/S7faGNUG
I think there's an NRE issue caused by your mod when a pawn on a map that's unloaded dies. Those world pawns should still be loaded and HeDiffs are still ticking, and some HeDiffs in my example killed a pawn and caused a NRE issue.
LikewiseHH 22 Sep @ 12:09am 
Hi pogoman,

Great mod! Quick question: I observed that raiders often dont reload what entering a map. So they rush into combat and only then do the reloading. Could this be fixed on your end? Playing with Combat Extended but aside from that there should be no mod messing with the raider AI.

Thanks!
艾青 20 Sep @ 8:40pm 
Is it compatible with the real fog of war?:steamhappy:
Azerbaijan_Technology 30 Aug @ 7:32am 
It's always nice to know how the mod actually works, appreciate it.
pogoman  [author] 26 Aug @ 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 26 Aug @ 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] 25 Aug @ 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 23 Aug @ 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.
안녕하세요 15 Aug @ 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 15 Aug @ 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 15 Aug @ 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 15 Aug @ 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] 15 Aug @ 2:31am 
actually i think there's a threat point metric per pawn that could be used for this. will investigate
pogoman  [author] 15 Aug @ 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 14 Aug @ 8:05pm 
also god bless you @Wesdabest for bringing my attention to a fog of war mod
Nic 14 Aug @ 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 14 Aug @ 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] 14 Aug @ 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 14 Aug @ 4:01am 
since cai 5000 is dead, would adding a fog of war be a big task?
pogoman  [author] 14 Aug @ 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] 14 Aug @ 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] 14 Aug @ 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 14 Aug @ 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 13 Aug @ 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 13 Aug @ 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 13 Aug @ 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] 13 Aug @ 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] 13 Aug @ 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 13 Aug @ 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 13 Aug @ 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 12 Aug @ 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 11 Aug @ 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] 11 Aug @ 2:00pm 
have uploaded a little patch now. They should start the assault as soon as your damage one of them
pogoman  [author] 11 Aug @ 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 11 Aug @ 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] 11 Aug @ 10:13am 
@plaerjilion_RUS У меня сейчас мало времени на запросы функций, поэтому я сосредоточен только на ошибках. Но я учту ваше пожелание в будущем. Обратите внимание, судя по комментариям к этому моду, он работает в версии 1.6, просто официально не обновлён. Вы можете отредактировать конфигурацию мода, указав версию 1.6 на DLL-файл версии 1.5, и всё должно заработать.
pogoman  [author] 11 Aug @ 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 11 Aug @ 12:53am 
plaerjilion_RUS 11 Aug @ 12:50am 
@pogoman как вам идея добавить к вашему замечательному моду функционал другого мода, который называется enemy self preservation?Данный мод уже не обновляется. Думаю к улучшенному ии он подойдет великолепно. Кратко этот мод добавляет, что если рейдер получает определенный процент ранений он убегает.
Polluxo 10 Aug @ 3:37pm 
Thanks!
Redsnow 10 Aug @ 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] 10 Aug @ 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] 10 Aug @ 6:52am 
@A_T let me know if you see any more pawns freezing after the patch i just pushed
pogoman  [author] 10 Aug @ 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 9 Aug @ 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