RimWorld

RimWorld

Delayed Deterioration
34 Comments
Dealer Mangan 20 Oct @ 11:02am 
thanks for the fix, boss!
HeadWar  [author] 20 Oct @ 10:10am 
This is why you should never test your own code...

Should be fixed now, was missing a "ref", so the deterioration was never actually prevented, it just said it was.
HeadWar  [author] 20 Oct @ 9:11am 
Wow. Yeah, everything is deteriorating now, no matter how it ended up on the ground, and including survival meals. Those have a much lower basic rate though, so you might just have gotten lucky and not have them deteriorate on you by chance.

Thanks, I'll see if I can find what's gone wrong.
Samira 20 Oct @ 5:23am 
@HeadWar i dont exactly remember and i dont know about visitors or caravan traders since i use the put ir right there mod but from any kind of drop pod (orbital traders or events) they since to take any kind of damage, also the components from mining they end up taking 1 or 2 ticks or damage, most probably the delayed deterioration doesnt seem to apply to stuff you havent picked once
Weak noob feeder 20 Oct @ 4:39am 
i have only tested this mod with the initial items like package meals or start weapons the scenario given, maybe these items in some sense are dropped items since they come from the transport pod.
Dealer Mangan 20 Oct @ 2:58am 
I've also noticed that some items deteriorate despite saying "x hours until". Some item types are not affected. In dev quicktest - survival package meals don't deteriorate, but everything else like meicine, apparel, weapons, etc - does. Haven't thoroughly checked what else is unaffected.
HeadWar  [author] 20 Oct @ 12:29am 
@Samira, just so we're clear, when you say "drops", is that items dropped from orbit by traders, items dropped on the ground by your pawns, or items dropped from slain enemies? I realized I assumed you meant from orbit since that was my pet peeve...
HeadWar  [author] 20 Oct @ 12:25am 
I'll confess I haven't done much testing with dropped items, which in retrospect was silly since that was one of the two scenarios that I found really annoying...

@feeder, is it dropped items that are acting up for you as well?

I'll take a look at it and see if I can work out what's going on. I can't off the top of my head see why dropped items should act differently, once they are on the map they are just another item on the ground, and should be covered, especially if the timer shows up.
Weak noob feeder 19 Oct @ 7:22am 
i guess its not related with performance mod, i got the same issue like Samira with the vanilla environment (only this mod and harmony activated), BTW this mod is exactly what i am searching if it got ready to work,really nice work.
Samira 18 Oct @ 10:27am 
it maybe has to do with the perfomance mods im running like dubs analyzer (unlikely culprit but i think its wortth to mention), perfomance optimizer and slower pawn tick
Samira 18 Oct @ 10:26am 
@HeadWar yes it says starts deteriorating in x hours or x days and some items still take damage it seems very irregular when i try to emulate with one item of my stockpile like a weapon it doesnt seems to take damage but items from drops seems to always have 1 or 2 ticks of damage
HeadWar  [author] 18 Oct @ 8:31am 
Do you get the timer that says "Starts deteriorating in [x] hours"?

If so, does the item take deterioration damage during that time? Once the time is up, the message should change to the normal Deteriorating and deteriorate normally.
Samira 17 Oct @ 6:09pm 
this mod (at least for me) doesnt really stop deterioration from weapons and components and medicine
HeadWar  [author] 7 Oct @ 4:40pm 
So, I've done some clocking. This mod has a completely negligible performance impact. Less than 0.01% of the tick time is spent on handling delays.

But that didn't stop me from doing an optimization! So in many scenarios, for example if there are a lot of rocks and trees about, I've now cut the processing time in half.
HeadWar  [author] 7 Oct @ 4:05am 
aaabcehilllpty
Dealer Mangan 7 Oct @ 3:38am 
lmao
HeadWar  [author] 6 Oct @ 3:34pm 
Please, I prefer if we call it CDO. Can't abide letters that aren't sorted alphabetically.
Dealer Mangan 6 Oct @ 2:28pm 
GAAAAAAAAAAWD
take my :Dosh:
and the change too :10real:
balsam for my OCD soul...
veoba 6 Oct @ 4:54am 
Still not at my main rig, will answer later.
HeadWar  [author] 5 Oct @ 4:39pm 
If you've been playing today you should have had the updated version, 1.1.0 or 1.1.1. Do you still get the error if you save and load that save? If so, I'd love to see a log.
veoba 5 Oct @ 4:04pm 
Just wanted to tell about error on save load but its been already told. Will check update tomorrow.
HeadWar  [author] 5 Oct @ 11:18am 
Another small update, doing an internal cleanup periodically, even without auto-saving.
HeadWar  [author] 4 Oct @ 5:41pm 
Updated to 1.1.0.

Today has been a day of learning.

Should play nicer with other mods now, and with itself. There will likely be a number of errors when loading a previously saved game, null references most likely, perhaps complaints about mysteriously missing pawns, but after that things should settle down. (For some inexplicable reason the save engine thinks that when you say you don't want to save destroyed items, what you actually want to do is save a null value instead...)

After looking at it a bit, performance impact overall should be minimal, especially compared to the sinkhole that the normal deterioration checks appear to be. I am tempted to do a mod just to touch up some of the more egregious things, but I don't know how bad it actually is.
HeadWar  [author] 4 Oct @ 4:08am 
Ok, I think I see what's happening. Mostly my fault, and should go away in the upcoming version.
HeadWar  [author] 4 Oct @ 3:41am 
Possible workaround:
Before loading your save, go into the settings for Delayed Deterioration, set it to No delay, load the game, and then change the setting to Delay again.

It will give all deteriorating items a new delay, but it should avoid the crash.

Hopefully I'll have a new version out later today, but if the real error occurs in RimKeeper, I suspect my changes won't help.
HeadWar  [author] 4 Oct @ 3:32am 
If I'm reading that log right, I think technically it's RimKeeper (RimKeeperAnimals in the log) that fails, possibly because it wasn't expecting anyone to call FinalDeteriorationRate during loading, so it hasn't yet initialized properly.

I'm rewriting a bunch of stuff right now, though I suspect it won't help with this particular error. But with any luck my rewrite could create an even harsher mod conflict! =)

I'll take a quick look at RimKeeper and see if I can work out what's going on.

Thank you for the log!
Lemniscate_Mike 3 Oct @ 5:52pm 
I'm getting an error on launch pointing to the mod I think; full log link below!

https://gist.github.com/HugsLibRecordKeeper/c23bd8260a28d7411b495a7bc07fcb2f
HeadWar  [author] 30 Sep @ 5:02pm 
Shouldn't be much, I've tried to keep it lightweight, and it uses the same checks as the regular deterioration. But there is a little bit of extra overhead of course, which I'd expect to get worse the more deteriorating items you have, since it maintains a list of all deteriorating items. Once they stop deteriorating the list shrinks though, and one way or another, that will happen to all deteriorating items. (But now with a delay!)

If someone knows how to actually measure it, I'd be much obliged.
Eclipse 30 Sep @ 4:38pm 
Any impact on performance?
HeadWar  [author] 30 Sep @ 2:19pm 
I hadn't realized it before I started working on this mod, but the deterioration rate isn't a steady rate. 36 times per day the items in each cell are checked for deterioration, and the deterioration rate is the x/36 chance that it will lose one HP during that check. So if you are unlucky, an item could lose a hitpoint immediately after it's put down. If you are lucky (and the deterioration rate is below 36), you could go for days or weeks without any deterioration at all. It also means that an item can never deteriorate more than 36 HP in a single day, no matter how high the deterioration rate is.

And yes, this has been one of my most consistent pet peeves, I am so glad I've fixed it. =)
KawwaK 30 Sep @ 1:30pm 
@justydusty Me too, but I hate that we need mods to fix every single mechanic of the base game.
justydusty 30 Sep @ 12:52pm 
I love it when i see a simple qol mod like this that adds or tweaks a mechanic i have never even thought of before
KawwaK 30 Sep @ 12:05pm 
Thanks! This makes so much sense! Tings don't usually deteriorate in one second irl.
DeltaCortis 30 Sep @ 10:52am 
Perfect just what I was looking for