Win_64_0.7.120 Flail repair time is a huge negative number [RESOLVED]

Locked
chtujo
Posts: 67
Joined: Fri Sep 22, 2017 12:54 am
Location: Yeorth Burrowland

Win_64_0.7.120 Flail repair time is a huge negative number [RESOLVED]

Post by chtujo »

Save attached.

Not sure how this happened, it said it was going to take 5 days I think. Then after 5 days, I came back, and this happened. This was just after leveling up, but that probably has nothing to do with it.
Attachments
SAVE499.zip
(240.53 KiB) Downloaded 75 times

User avatar
pango
Posts: 3359
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: Win_64_0.7.120 Flail repair time is a huge negative number

Post by pango »

Damn, git bisect points at one of my commits, 230459f1
Before that the game displays a positive "2 days"
I'm not sure what's going on...

Code: Select all

                    "repairData": {
                        "sceneName": "DaggerfallInterior [MapID=311449835, BuildingKey=197632]",
                        "timeStarted": 12640122000,
                        "repairTime": 570585,
                        "$version": "v1"
                    },
...
    "dateAndTime": {
        "gameTime": 12640545794,
        "realTime": 636924459778822859,
        "$version": "v1"
    },
Estimated repair time 410313

For some reason the estimation shrank, so while the item is not repaired the estimation is past... mmmh
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

chtujo
Posts: 67
Joined: Fri Sep 22, 2017 12:54 am
Location: Yeorth Burrowland

Re: Win_64_0.7.120 Flail repair time is a huge negative number

Post by chtujo »

pango wrote: Fri May 03, 2019 4:02 am
Sorry to not have mentioned this earlier, but I did have several other items I was repairing earlier that only took a day or two, and they all finished fine. I was writing the first post in quite a rush, I only had about 6-8 minutes to locate, zip, and upload the save, and write the post. I should have also have mentioned that I had been periodically checking back to see if the item was repaired, and it was going fine up to about 1 day left. Then when I checked again in approximately a day, the bug appeared.

User avatar
pango
Posts: 3359
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: Win_64_0.7.120 Flail repair time is a huge negative number

Post by pango »

Does fighter's guild blacksmith accept to repair several items at once, once you are ranked high enough?
If so, then if you remove other items, now that would make sense that the estimation time drops.

I have a patch that displays the committed times instead of new estimates for items that are being repaired, but I will test it some more before submitting it for merge...
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

User avatar
pango
Posts: 3359
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: Win_64_0.7.120 Flail repair time is a huge negative number

Post by pango »

Ok, that's more complex than I thought.

To explain how repair times are computed: there's a base time for each item, proportional to the amount of damage it took. Then the time for the longest item to repair is increased by half the time taken by all the others (rationale, I assume, is that while working on other items, work on this item is slowed down by half. On the other hand all other items are worked on in parallel, mmh). Anyway, it gives some incentive to repair several items at once, yet it's not totally for free.

Now what happens if you add items when some repairs are already ongoing?
Implementation in DFU just reevaluates everything together; So old repair times may adjust if you add items to the mix (I've checked that classic does that too), and in the end you get the same times as if you put everything to repair at once, so it seems it's not possible to cheese the system that way.

Problems arise when some repairs complete, or worse if the repaired items are removed from the list: because if you keep reevaluating the repair times, suddenly the repair time for the longest repair goes down!
Tricky, tricky...

I'm considering just not to allow repair times to decrease... Should fix problem at hand, should prevent most exploits, in some obscure cases it will be unfair, but it will stay simple to implement...
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

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

Re: Win_64_0.7.120 Flail repair time is a huge negative number

Post by Interkarma »

Thanks for looking into that Pango, what an nteresting bug!

I'm happy with a simple and direct fixes here. :)

User avatar
pango
Posts: 3359
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: Win_64_0.7.120 Flail repair time is a huge negative number

Post by pango »

Even that is more complex than I expected, because checking that repair times did not decrease must be done after the longest time has been increased by 50% of the others, to prevent some cumulative effect when you commit repairs;
And at that point I no longer have the previous repair times, grr
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

User avatar
pango
Posts: 3359
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: Win_64_0.7.120 Flail repair time is a huge negative number

Post by pango »

I submitted a PR
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

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

Re: Win_64_0.7.120 Flail repair time is a huge negative number

Post by Interkarma »

Merged, thank you Pango!

Locked