RimWorld

RimWorld

87 ratings
Lagless Lamps - C#
2
3
   
Award
Favorite
Favorited
Unfavorite
Mod, 1.5
File Size
Posted
Updated
323.656 KB
21 Apr @ 2:18am
31 May @ 12:33am
14 Change Notes ( view )

Subscribe to download
Lagless Lamps - C#

Description
Updated 5/30/25: Check Changelog for Details

A successor to Lag Free Lamps by NECEROS and Infinite Torches by okradonkey.
Inspired by Optimization: Meats by SeoHyeon

This is for the people who want to do low tech runs without bogging down their computer with all the ticking light sources. Removes the refuelable comp from low tech light sources (default) or slow down the refuelables comp tick.

Comp Delay:
The vanilla refuelable comp calculates fuel every tick, with harmony, the recalculation can be delayed to every user configured tick. The default is every 10 ticks, which means fuel is calculated 10 less often. Fuel consumption is scaled to tick interval so fuel should still last the same amount of time.

Other tick intervals can be set but I don't know if it will affect the game in any other ways.

This affects all things with the refuelable comp except turrets and things like stoves (i.e. things that have consumeFuelOnlyWhenUsed set to true) since those calculate fuel consumption separately.

Comp Removal:

Removes the refuelable comp from things that fit the following criteria:

  • is a building
  • has the refuelable comp
  • has the glower comp
  • if it's a heatpusher, heatPerSecond is below a threshold (which can be changed via mod settings)
  • isn't a turret
  • is not a production building
  • doesn't consume or generate electricity
  • consumeFuelOnlyWhenUsed is set to false

Also features three lists that you can use to exclude things from comp removal and comp delaying
NoRemove - Any light sources you want to exclude from comp removal
NoFuelConsumptionScaling - Anything that has the refuelable comp that should not be scaled to tick interval such as turrets or things that reduce fuel per use.
ForceRemove - Anything you want to force the comp removal on

Safe to add and remove midgame but changing any settings require a restart.

Whitelisting for modders
This mod is a hammer and for hammers, everything looks like nails. Use this patch to exclude things from comp removal and fuel consumption scaling if they're still falling through the cracks and getting patched when they shouldn't be.

<Patch> <Operation Class="PatchOperationFindMod"> <mods> <li>Lagless Lamps - C#</li> </mods> <match Class="PatchOperationSequence"> <operations> <li Class="PatchOperationAdd"> <!--Adding an item that should always keep its refuelable comp--> <xpath>Defs/LaglessLamps.WhitelistDef[defName = "NoRemove"]/thingDefs</xpath> <value> <li MayRequire="Ludeon.RimWorld.Ideology">Autobong</li> </value> </li> <li Class="PatchOperationAdd"> <!--Adding an item that should never have its fuel consumption scaled--> <xpath>Defs/LaglessLamps.WhitelistDef[defName = "NoFuelConsumptionScaling"]/thingDefs</xpath> <value> </value> </li> <li Class="PatchOperationAdd"> <!--Adding an item that should always have its refuelable comp removed, regardless of mod logic--> <xpath>Defs/LaglessLamps.WhitelistDef[defName = "ForceRemove"]/thingDefs</xpath> <value> </value> </li> </operations> </match> </Operation> </Patch>

A copy of this patch can also be found in the mod folder.

GitHub[github.com]
Popular Discussions View All (4)
9
21 May @ 5:43pm
PINNED: Bug Reports
Jsin0
4
9 May @ 1:22am
PINNED: Whitelist Suggestions
Jsin0
0
24 Apr @ 11:23pm
PINNED: General Suggestions
Jsin0
50 Comments
Jsin0  [author] 9 hours ago 
Eventually yes though the tick optimizations in 1.6 may make this mod obsolete
LazY_Pickachu 11 hours ago 
Hello. Thank you for this mod. Are there any plans for updating to 1.6?
Tsornin 21 Jun @ 9:06pm 
Thank you that helps!
Jsin0  [author] 21 Jun @ 6:48pm 
You just need to add <li>campfire</li> and whatever the defName of the swamp cooler in the thingDefs area for the ForceRemove like this:

<thingDefs>
<li>Campfire</li>
<li>SwampCooler (or whatever it is)</li>
</thingDefs>

I'll try to add that feature when I've got time and figure out how that works
Tsornin 21 Jun @ 9:16am 
I know it's cheesy but I'd like to add the campfire and swamp cooler to the force remove list. I found the whitelist.xml in the folder but I'm not sure how to do it. If there's a way to do it from the mod settings I couldn't figure it out.
Jsin0  [author] 13 Jun @ 2:37pm 
Similar, but different methods. Tweaks galore relies on things to have that ring that shows you how far the light reaches to determine if they're lamp but not every modded light source will have that. This one relies on several criteria to figure out if something is a light source.
Gnimo Tiefenhain 13 Jun @ 7:35am 
is this and the "lagless lamps" setting from "tweaks galore" the same thing?
Jsin0  [author] 31 May @ 12:35am 
Thanks for the heads up, I've patched that issue.
//SlipperyPete:. 30 May @ 9:41am 
Gonna switch to just using the lag free lamps options in Tweaks Galore, looking at the comments it seems like this mod is very much still in development and not complete yet.

Also, for anyone out there, the description doesn't say it specifically, but this is safe to remove from your save.
//SlipperyPete:. 30 May @ 9:26am 
Chemfuel Powered Generators are not consuming fuel despite being in the "Will not be patched" list of this mod's mod options page.