RimWorld

RimWorld

187 ratings
Lockable doors
   
Award
Favorite
Favorited
Unfavorite
Mod, 1.5, 1.6
File Size
Posted
Updated
429.687 KB
25 Dec, 2024 @ 4:05am
7 Sep @ 6:36am
7 Change Notes ( view )

Subscribe to download
Lockable doors

Description
Short description:
A simple and performance friendly door lock.

Detailed explanation:
The reason door lock mods tend to be heavy on performance is because the additional conditions to pass through a door are checked every time any pawn attempts to path through it.

This mod uses Zetrith's prepatcher to make this logic as fast as possible to minimize overhead, which is why it is required.

By default a locked door is locked for everyone, including your own pawns, pets, mechs and allies. There is the ability to set exceptions on locked doors, however these take (slightly) longer to process compared to locked doors without exceptions.

A locked door only applies additional restrictions, vanilla and other limitations still apply.

All injected logic and overhead can be monitored in a single harmony patch under "Harmony Patches" in Dub's Analyser.

Performance impact scales by number of locked doors and number of enabled exceptions.

Remember that if you have available jobs in areas that some pawns can't get to, if those pawns are idling they will keep trying to path to those unattended jobs.

The shown analyser picture is 150+ locked doors with 28 pawns locked in separate rooms with plenty of work to do. So pretty much a worst case scenario running at 360 tps.
Please note, the end result in analyser also depends on how powerful your system is, so values could greatly vary based on your cpu model and modlist content.

Exceptions
The following groups can be allowed access through locked doors on a door by door basis:
- Colonists.
Regular colonists.
- Colony mechs.
Biotech mechs owned by colony.
- Slaves.
Ideology slaves owned by colony.
- Pets.
Tamed animals owned by colony.
- Allies.
Any members of factions that are not hostile to colony

Links:
Github[github.com]
Previous versions[github.com]
Change notes

Credits:
Madman666: Icons and preview.
Dubwise's discord server, where many performance friendly mods are born.
75 Comments
Espiovvv 12 Oct @ 8:15am 
Thank you!
Zeracronius  [author] 12 Oct @ 7:40am 
It is already updated. If Rimpy doesn't recognise it then it is because Rimpy is outdated.
Jikulopo's mod is listed in the metadata as alternative to prepatcher dependency.
Espiovvv 12 Oct @ 6:24am 
It says in RimPy that I'm missing zetrith.prepatcher, that's because I'm using jikulopo.prepatcher, can you please update the dependency to the unofficial 1.6 update of Prepatcher?
https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=3563469557
Zeracronius  [author] 6 Oct @ 3:32am 
Specifically power-tab appends their tab to the same list for all objects that has power component.
Zeracronius  [author] 6 Oct @ 3:31am 
Thing is, i don't decide where the tab is placed. I add it to the list of tabs for all implementations of Rimworld's Door, and then Rimworld decides where and how to display the tab button.
Power-tab does the same thing, so there is no conflicts.

What Powered doors are you referring to? And do they work normally without Power-tab?
Vril 6 Oct @ 2:52am 
Yeah, the normal doors have the access icon/button displayed properly, powered do not. You need a patch for power tab mod.
Vril 6 Oct @ 2:51am 
I dont see access button? i use power tab mod, maybe it overlap it?
Zeracronius  [author] 4 Oct @ 8:46am 
Unfortunately not, this mod only adds additional criteria for when pawns check if they can open a door. A check that is skipped by Rimworld if the door is already open, at which point any pawn can pass through without these checks being triggered.

A vac barrier counts as a door that is always open. Blocking pawns from pathing through that would require me to add entirely new checks that then check if door is vac barrier specifically. This would add more overhead across all doors.
Stim The One 4 Oct @ 8:35am 
Any chance to also include vac barriers as lockable? We can go about vaccum resistance later, I want to use it as a tox cloud barrier and have only mechs go through.
Zeracronius  [author] 3 Oct @ 5:25am 
@GoatSkin
Did you check your log for errors? And if none, can you provide a screenshot of harmony patches tab in Dubs Performance Analyser?