RimWorld

RimWorld

119 ratings
Lagless Lamps - C#
2
3
   
Award
Favorite
Favorited
Unfavorite
Mod, 1.5, 1.6
File Size
Posted
Updated
345.868 KB
21 Apr @ 2:18am
16 Aug @ 5:23pm
20 Change Notes ( view )

Subscribe to download
Lagless Lamps - C#

Description
Updated 8/16/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)
17
3 Aug @ 1:45am
PINNED: Bug Reports
Jsin0
4
9 May @ 1:22am
PINNED: Whitelist Suggestions
Jsin0
0
24 Apr @ 11:23pm
PINNED: General Suggestions
Jsin0
76 Comments
JACK 23 Aug @ 11:11pm 
you're the GOAT
Ashnal 16 Aug @ 2:20pm 
I ended up diving in to things .... the problem we were facing was actually the Refueled Signal sent from the Refuel method, and how CompGlowable processes it, which is super slow.
Jsin0  [author] 15 Aug @ 8:11pm 
I assumed that 1.6 tick intervals applied to refuelable comps but I soon found out I was wrong. I'll add the support to 1.6 eventually but I just haven't had the time recently. Hopefully I'll be able to make some progress on that and the bugs people are mentioning
Ashnal 15 Aug @ 5:24pm 
Is the source for the harmony version still available? The github link does not go anywhere. I think being able to disperse or delay checks is preferable to just removing fuel consumption. I was looking forward to using chemfuel lamps from Appliances expanded, but got a tip from a friend that made a hundred of them that they are laggy just like torches, even though they are fueld from the pipe network.

I think a mod that optimizes CompProperties_Refuelable to tick less often is super useful for things like this.
largejaroalmonds 14 Aug @ 3:45pm 
Ravayen - I'm getting this too.
Ravayen 13 Aug @ 2:13am 
Actually now that i've looked closer it's any wall torch that isn't on the north gets reset to north facing as if the rotation isn't being saved and it resets to default.
Ravayen 13 Aug @ 2:07am 
Odd bug but since installing this every time i exit the game and reload half of my wall torches get rotated off the wall...
Tsornin 24 Jul @ 9:04pm 
For others: uninstall and reinstall your torches and whatnot, and they'll do what they're supposed to and not need to be refueled.
Tsornin 24 Jul @ 8:20pm 
Thanks, that fixed it! You rock.
MikeTheDead 21 Jul @ 12:12am 
Posted a report about the issue he mentioned, it includes why they are just standing still, it occurred for me since yesterday