RimWorld Mods

No Laggy Bed Mod

Author of the No Laggy Bed Mod: telardo

The No Laggy Bed Mod fixes the fps drop when you select a bed or workbench.

No Laggy Bed Mod features

Some players (usually heavy-modded) experience this fps issue in their game when selecting a bed or workbench. I wish this mod fixed it.

Technical Details

If you’re not curious about where it comes from, stop here.
Long story short: this is a vanilla problem; more mods exacerbate it.

When you select a bed or a workbench, the game will try to find available linkable facilities like dressers and show them. BuildCopyCommandUtility.FindAllowedDesignator() scans all the designators in the database every frame to find a single build command. Typically, a game with a medium-size mod list contains thousands of designators. Hence, the game needs to validate millions of designators in 60 frames for a bed with 10ish linkables. The same case applies to workbenches. That’s the main reason why selecting them slows down your game drastically. The situation worsens with more modded buildable things. For example, VE furniture series add tons of buildable things in the game. In this mod, I build copies for needed designators and cache them to avoid scanning.

Some people claim the mod SRTS Expanded is also the culprit. To some extent, they’re right. SRTS has a harmony patch for research projects, which costs 0.005ms per call. It’s not bad itself but calling it 10k times per frame is. To avoid this, I also add caching for Designator_Build.Visible. It eliminates calling that method as much as possible, and it’s not a problem now. This caching should also speed up general gizmo drawing.

At last, I also replace GetRoom() in Building_Bed.DrawExtraSelectionOverlays() with a cached version. It’s a small lift without getting them every frame.

No free lunch! So what’s the price? Like other performance optimizers, it needs a little more memory to store the cache. It’s not a big deal from my testing. Of course, there might be other impacts I didn’t notice; if you find something, feel free to let me know.

Above is all my understandings of this problem. Please don’t quote me on that~


Version 1.5
No Laggy Bed Mod is not updated to RimWorld 1.5

Older versions:

Leave a Reply

Your email address will not be published. Required fields are marked *

Hm, you're using an ad blocker...

We get it, ads are not what you’re here for. But ads help us keep the lights on. We deliver up-to-date mods, guides and plenty of RimWorld content at no cost to you. So, please, add us to your ad blocker’s whitelist to continue browsing the RimWorld Base. 

Please whitelist us on your ad blocker and

Get a lifetime ad-free experience with the purchase of any RimWorld merchandise from our store. 

Still seeing this message after making a purchase? Click here to fix it

Get your RimWorld T-Shirt!

Dress in RimWorld style. For you or your loved ones!