RimWorld

RimWorld

170 ratings
Lockable doors
   
Award
Favorite
Favorited
Unfavorite
Mod, 1.5, 1.6
File Size
Posted
Updated
429.566 KB
25 Dec, 2024 @ 4:05am
31 Jul @ 4:10pm
6 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.
56 Comments
Zeracronius  [author] 4 hours ago 
This doesn't change the behaviour or limitations of vanilla doors. It only adds an additional layer to the doors.
Like adding an extra lock on the doors.
Prisoners cannot pass through doors in vanilla, so that doesn't change.

This is to preserve compatibilities and performance for the objective of the mod.

However in vanilla everything can pass through an open door, so setting it to always open let's them pass.
ZzZombo 10 hours ago 
Does this not support prisoners? I need this for "Prison Labor".
Turk 1 Aug @ 7:03am 
Yeah it all seems to work fine. Thanks both of you for the great mods.
jikulopo 1 Aug @ 7:02am 
Harmony: while technically not required there might be mods explicitly checking for it and breaking- better to leave it
Loading Progress and FGL - i dont actually use them but from quick check nothing broke
Turk 1 Aug @ 6:50am 
Thanks Jikulopo, I didn't know that they didn't need to be in a 1.6 folder. I don't need Harmony with your Prepatcher? Is it compatible with Faster Game Loading and the Loading Progress mod?
jikulopo 1 Aug @ 6:31am 
prepatcher assembly for 1.6 is in Assemblies folder in root of repo, 1.5 folder is for 1.5
see LoadFolders.xml
Turk 1 Aug @ 3:43am 
I don't see a 1.6 prepatcher on that github page.
Zeracronius  [author] 31 Jul @ 4:05pm 
Updated to 1.6
While official prepatcher hasn't been updated yet, there is an updated version that can be tested for 1.6:
https://github.com/jikulopo/Prepatcher
Zeracronius  [author] 6 Jul @ 9:41am 
I will be updating as soon as Prepatcher is updated.
Evono 5 Jul @ 4:06pm 
is 1.6 planned?