Did You Know/Realize?: Guild and Temple "Shops" Restock After Closing Trade Window

Discuss Daggerfall Unity and Daggerfall Tools for Unity.
Post Reply
User avatar
Magicono43
Posts: 1141
Joined: Tue Nov 06, 2018 7:06 am

Did You Know/Realize?: Guild and Temple "Shops" Restock After Closing Trade Window

Post by Magicono43 »

So was just bug testing my current mod and realized something that I was for a moment afraid my mod was causing, but I was wrong. That thing being that Merchants inside Guild Halls and Temples restock their supply instantly after their trade-window is closed and re-opened.

It's different for some though, the magic item vendor at the mages guild restocks their EXACT supply as it was before you bought from them, so you can rebuy the same enchanted item they were just stocking as many times as you wish. Potion vendors however, they seem to get a new random stock of potions every-time their trade window is reopened, so if you don't like what they are selling, just reopen the window and try again.

This is completely different from how "normal" shops work, where the shelves persist to some extent, you can actually clear out a shop if you would like, but this is not the case with the individual vendors.

I'm guessing this behavior has something to do with the way these trade windows and their populated items are generated and what they are attached to. Like the shelves at "normal" shops are sort of like item-piles in that they persist for some amount of time no matter how many times they have been accessed, but the individual vendors don't sell from shelves/loot-piles, but instead from their flat themselves, they are the inventory in a sense, I suppose.

Just an interesting note, that maybe not everyone has noticed. I might want to try and mod this myself at some point, but I doubt it's that big of a deal for most player honestly, but still something to consider when stocking up on potions!

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

Re: Did You Know/Realize?: Guild and Temple "Shops" Restock After Closing Trade Window

Post by pango »

Yes, that's a generalization of this bug report; I don't know if all shops stocks are persistent in classic, but they're probably some more cases were DFU doesn't exactly match classic's behavior...
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

User avatar
Jay_H
Posts: 4072
Joined: Tue Aug 25, 2015 1:54 am
Contact:

Re: Did You Know/Realize?: Guild and Temple "Shops" Restock After Closing Trade Window

Post by Jay_H »

In classic, shops restock if you leave the town boundaries and re-enter, including on foot; when it says you're entering the town, shop data is generated anew.

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

Re: Did You Know/Realize?: Guild and Temple "Shops" Restock After Closing Trade Window

Post by pango »

Thanks Jay_H.
Including, if I remember well, when you board your ship and back...
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

User avatar
Magicono43
Posts: 1141
Joined: Tue Nov 06, 2018 7:06 am

Re: Did You Know/Realize?: Guild and Temple "Shops" Restock After Closing Trade Window

Post by Magicono43 »

pango wrote: Mon May 18, 2020 5:43 am Yes, that's a generalization of this bug report; I don't know if all shops stocks are persistent in classic, but they're probably some more cases were DFU doesn't exactly match classic's behavior...
Ah, I had not actually tested this in DOS, so I figured maybe it was classic behavior honestly. From what Jay said, I also did not know that leaving the town boarders reset shop shelves. For some reason I thought it took like a few days in-game for the "loot-piles" in shops to re-generate themselves.

User avatar
Allerka
Posts: 65
Joined: Fri Apr 24, 2020 11:07 pm

Re: Did You Know/Realize?: Guild and Temple "Shops" Restock After Closing Trade Window

Post by Allerka »

Nope, it's a daily restock and when you exit the town. I discovered this when I came across a daedric longsword at a store, which would have been a huge upgrade for me, but didn't have enough gold on hand, so I ran to another town nearby to hit up the bank and came back (within the same day) to discover the shop's inventory completely changed and the sword was gone. Womp womp.

User avatar
Hazelnut
Posts: 3016
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Did You Know/Realize?: Guild and Temple "Shops" Restock After Closing Trade Window

Post by Hazelnut »

Guild stocks of magic items is an algorithm that has not been reverse engineered yet, the code is commented.

Code: Select all

            // Seed random from game time to rotate magic stock every 24 game hours
            // This more or less resolves issue of magic item stock not being deterministic every time player opens window
            // Doesn't match classic exactly as classic stocking method unknown, but should be "good enough" for now
For potions it matches classic, and stock is re-generated each time you access it. Comment from the code.

Code: Select all

        // TODO: classic seems to generate each time player select buy potions.. should we make more persistent for DFU?
There's been no clamor or call for it so I intend to leave it as is I think. TBH Potions are kinda an afterthought in DF so I don't think its a issue as it is.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

Post Reply