0.10.4: Magic item degrading

Curated user bug reports with enough information to reproduce issue. Moderators will move topics here from Help & Support once a bug is confirmed and enough information has been provided.
Post Reply
User avatar
Interkarma
Posts: 5472
Joined: Sun Mar 22, 2015 1:51 am

Re: 0.10.4: Magic item degrading

Post by Interkarma » Sun May 10, 2020 12:29 am

Just FYI, the current implementation is much too aggressive on item degradation.

viewtopic.php?f=24&t=3700

I'll review this ahead of 0.10.24 based on other information in this topic and further testing in classic.

User avatar
mikeprichard
Posts: 1028
Joined: Sun Feb 19, 2017 6:49 pm

Re: 0.10.4: Magic item degrading

Post by mikeprichard » Sun May 10, 2020 1:30 am

Thanks, Interkarma; this is indeed far from classic behavior. For reference here as explained elsewhere (though I believe you yourself already know this): the only enchanted items in classic that should ever possibly degrade are those with "Cast When Held", "Cast When Used", "Cast When Strikes", and "Item Deteriorates" enchantments, and most of the classic behavior for those enchantments has been confirmed per the information currently on UESP with the exception of a few of the "Cast When Held" mechanics (per the post earlier in this topic at viewtopic.php?f=24&t=2584&start=50#p42136). Just note that for these four enchantment types, it does appear from my fairly extensive testing linked above that more than one such enchantment on an item will in fact increase the item's durability loss by a factor of the number of such enchantments.

All in all, it's a fairly convoluted system as is usually the case with Daggerfall, but I know you guys will sort it out! :)
Last edited by mikeprichard on Sun May 10, 2020 1:33 am, edited 2 times in total.

User avatar
Interkarma
Posts: 5472
Joined: Sun Mar 22, 2015 1:51 am

Re: 0.10.4: Magic item degrading

Post by Interkarma » Sun May 10, 2020 1:32 am

Thanks Mike, that was my mental map as well. The bug now is that equipped degrade logic is triggering for all enchantment types, and even once per enchantment.

This is my fault for not picking up this outcome during code review. I'm working on fixing now.

User avatar
mikeprichard
Posts: 1028
Joined: Sun Feb 19, 2017 6:49 pm

Re: 0.10.4: Magic item degrading

Post by mikeprichard » Sun May 10, 2020 1:34 am

You're a bug-fixing machine, Interkarma - thank you and good luck!

User avatar
Interkarma
Posts: 5472
Joined: Sun Mar 22, 2015 1:51 am

Re: 0.10.4: Magic item degrading

Post by Interkarma » Sun May 10, 2020 6:40 am

I'll close out that other topic and continue here. To summarise what we found, timed durability loss was applied indiscriminately for every effect bundle on held items. This timed degrade logic should only have been applied by active CastWhenHeld enchantments on held items.

To fix this, I had to make three changes. The first was to create a MagicRound payload callback for enchantment effects. This rounds out the available payloads and gives us a better place to hook durability loss to this effect specifically.

https://github.com/Interkarma/daggerfal ... 826cb00a35

I then resolved the race condition Numidium experienced with IsResting and time-sensitive systems. I looked at a range of different solutions and the below was the simplest effective solution. Basically, the game is paused in rest UI and only systems that consume game time will be triggered by TickRest(). So it's safe just to raise the IsResting flag when rest UI opens and lower it again when rest UI closes.

https://github.com/Interkarma/daggerfal ... 08789b8256

Finally, I hooked up durability loss to CastWhenHeld's MagicRound payload callback. This now works nicely and applies durability loss on schedule for CastWhenHeld enchantments. Every CastWhenHeld enchantment on an item will contribute to durability loss.

https://github.com/Interkarma/daggerfal ... f5277f6b85

Another positive outcome from all this is we now have the means to reroll CastWhenHeld effects periodically. Did anyone confirm the timing for this reroll? I will implement ahead of new builds.

Edit: Went back through topic and found Pango's comments on rerolls: "Effects are rerolled at the end of loitering/resting/fast traveling if more than 6 hours have passed since the last reroll.". Thank you again, Pango. I'll work on this shortly.

User avatar
mikeprichard
Posts: 1028
Joined: Sun Feb 19, 2017 6:49 pm

Re: 0.10.4: Magic item degrading

Post by mikeprichard » Sun May 10, 2020 11:07 am

Interkarma wrote:
Sun May 10, 2020 6:40 am
Edit: Went back through topic and found Pango's comments on rerolls: "Effects are rerolled at the end of loitering/resting/fast traveling if more than 6 hours have passed since the last reroll.". Thank you again, Pango. I'll work on this shortly.
Good stuff! Re: "Cast When Held" item durability loss, the summary currently in the UESP (as developed in this topic after Pango's post you quoted above) appears to be correct to classic as far as is currently known, and pending numidium's ongoing research:

For "when held" enchantments, i.e. those that are applied as long as the item is equipped, the item's health will decrease when:
a) the item is equipped (with a resulting health decrease in the approximate range of 20 to 40 points, depending on the item, each time the item is equipped),
b) you wait/rest for a period of at least 7 in-game hours with the item equipped (with a resulting health decrease of 7 points, i.e. 1 point per 1 in-game hour), or
c) you are awake in the game world with the item equipped (with a resulting health decrease of 1 point per 4 in-game minutes).
(Note that the enchantment effect of a magical item with a "when held" enchantment is re-applied after each instance of waiting, resting, or fast-traveling for more than 6 hours, with the enchantment effect re-applied at a new value within the effect's range of values, if applicable. However, the item's health is not affected by this re-application of the effect.)

User avatar
Interkarma
Posts: 5472
Joined: Sun Mar 22, 2015 1:51 am

Re: 0.10.4: Magic item degrading

Post by Interkarma » Sun May 10, 2020 11:53 am

Thanks Mike. With the exception of "on equip" durability loss (which is still being researched by Numidium), that's how things are setup now. Equipped items with a CastWhenHeld enchantment will lose durability at the rate of 1 point every 4 game minutes, or 1 point every game hour while resting. They will not lose durability after fast travel or prison time. Each CastWhenHeld enchantment on item will contribute to durability loss.

I'm working on effect re-rolling after 6 hours now. Thanks for confirming that durability is not lost on reroll.

User avatar
mikeprichard
Posts: 1028
Joined: Sun Feb 19, 2017 6:49 pm

Re: 0.10.4: Magic item degrading

Post by mikeprichard » Sun May 10, 2020 2:30 pm

Great - the effect re-roll testing was done by the very reliable Pango earlier in this topic as you noted, so it looks like everything except the last piece ("on equip" durability loss, which Numidium is looking into) is shaping up like classic.

User avatar
Interkarma
Posts: 5472
Joined: Sun Mar 22, 2015 1:51 am

Re: 0.10.4: Magic item degrading

Post by Interkarma » Wed May 13, 2020 3:43 am

mikeprichard wrote:
Sun May 10, 2020 11:07 am
b) you wait/rest for a period of at least 7 in-game hours with the item equipped (with a resulting health decrease of 7 points, i.e. 1 point per 1 in-game hour)
Hi Mike, just a quick confirmation needed on this one. If player does not rest for a minimum of 7 hours with item equipped, e.g. they rest for 6 hours or loiter for 3 hours, then no durability is lost. But if player rests for 7 or more hours continuously, then item durability is lost at the rate of 1 point per hour rested. Is that correct?

User avatar
mikeprichard
Posts: 1028
Joined: Sun Feb 19, 2017 6:49 pm

Re: 0.10.4: Magic item degrading

Post by mikeprichard » Wed May 13, 2020 5:01 am

Interkarma wrote:
Wed May 13, 2020 3:43 am
mikeprichard wrote:
Sun May 10, 2020 11:07 am
b) you wait/rest for a period of at least 7 in-game hours with the item equipped (with a resulting health decrease of 7 points, i.e. 1 point per 1 in-game hour)
Hi Mike, just a quick confirmation needed on this one. If player does not rest for a minimum of 7 hours with item equipped, e.g. they rest for 6 hours or loiter for 3 hours, then no durability is lost. But if player rests for 7 or more hours continuously, then item durability is lost at the rate of 1 point per hour rested. Is that correct?
I'm unfortunately unable to test classic for this precisely (I can't manage to get a reliable save editor to work to view durability before and after each hour of rest), but I think my above note was actually a misinterpretation of Pango's earlier info in this topic at viewtopic.php?f=24&t=2584&start=40#p34675. I would appreciate Pango's confirmation, but I believe I was confusing the effect re-roll after at least 6 hours of resting/loitering/travel (which does not affect the item's durability) with durability loss that per Pango's notes actually appears to tick every single hour of resting/loitering. So, this may need to be another tweak to the wiki - sorry if it turns out I gave you misleading info on this!

Post Reply