// Management · RimWorld Mod

Better Settlement Defense AI

Better Settlement Defense AI mod preview for RimWorld

Tell me if this is you.

Tell me if this is you.

You've played a settlement for some time and decide to raid an enemy settlement and when you arrive you find a complex set of turrets, mortars, and sandbags. So you approach and as your colonists engage at a distance you fear for the drawn out gunfight only for the enemy to literally abandon all of it to dead sprint at you into the open and die before you even hit the settlement.

Well this mod hopes to change that.


Features

- Four different types of "roles" that can be weighted in the mod options that affect enemy pawn behaviour when raiding a settlement:

Defense: Enemies will stay in place and attempt to hold security positions within the settlement.

Hide: Enemies will find open doors and attempt to hide and / or defend from inside buildings in the settlement.

(REMOVED FOR NOW, CURRENTLY WORKING ON PATCH) Patrol: A patrol will be sent out to circle the map and attempt to find mortar positions or landing zones

Assault: Vanilla behaviour


- Mod options that allow you to tweak the settings for how you want settlements to respond.


UPDATES

August 1st, 2026:

- Edited some of the roles for more consistency so now pawns will hide in friendly buildings instead of running to the corner of the map.
- Changed some of the code to ensure max compatibility and removed the patrol function for now. As of this update it seems the patrol function doesn't like to play nice with rimworlds current job system so I'm going to take another look at it.
- Fixed bug where pawns would use defense AI while assault player colonies.


FAQ


Does this work with CAI - 5000, Rim cities, CE, worksites expanded, etc..?

For CAI - 5000 school is still out on that, however I haven't seen much issue so far. Worksites, Rimcities, Base gen, and CE all seem fine and should work as intended.


Wait this looks normal, they're all just bundling in the center?

Yes, until attacked they will bundle up in the center like usual. But once you recieve the, "X faction is attacking your colonists" prompt they will take their roles.


Incompatibilites

- While not a hard incompatibility, my urban combat framework mod will likely cause issues with hiding pawns because all the doors are barricade.



Credit

Thanks to Ranger Rick for his work on the C#, and if your in the mood check out the fallout collaboration project here.
https://steamcommunity.com/sharedfiles/filedetails/?id=2518249845