Dynamic Merchant as a gold sink

It Does What It Says on the Tin: Resolved Issues

Moderators: Moderator, Quality Control, Developer, DM

User avatar
khaevil
Posts: 136
Joined: Thu Sep 03, 2009 7:00 pm
Location: East Coast USA

Dynamic Merchant as a gold sink

Unread post by khaevil »

Demo posted on the neverwinter vault:
http://neverwintervault.org/project/nwn ... c-merchant

Have a merchant that has a chance at stocking some of the rare items from the loot table, at exorbitant prices.

The store inventory changes over time, so checking the merchant at any time has a chance of revealing something desired, not just after reset. For my demo module he doesn't have anything for sale right after reset.

I think this could also be an opportunity to add a gold sink. A scripted store that will stock items from a list, but it has to be able to afford to purchase the item to stock it. It will also sell off stock randomly, so that the inventory doesn't stagnate.

Initially the store is too poor to be able to stock any highly valuable items. But, as players do business with the store the store is able to use the profits to stock more valuable items. Wealthy players with lots of gold, but wanting epic items, will have an incentive to dump gold at the store to pump up its resources, in hopes it will stock something good. My hope is this will create a gold sink that is proportional to the excess wealth, in a manner that doesn't just benefit the super wealthy.

Right after dumping a large amount of gold on the store would be the best time to find high quality items, as the store has a large surplus of gold and can afford a really expensive item if it comes up. Over time the store will tend to spread that capital over a bunch of mid range items. So while the quality of goods will increase overall until reset, the person dumping gold on the store and waiting to see what comes up next will be able to spike the quality.

I scripted it to just pull items off a list from a .2DA file. But it would be straight forward to use another loot generation script instead. There're a few lines for creating the item, just replace them with whatever loot generation is desired.

Some of the randomly created items have a very high gold value, but are really rather useless. These would end up being sold to the store, and the store would eventually sell them and rapidly boost assets. This would reduce the store's ability to act as a gold sink, so I'd cap the value of randomly generated items when exchanging them for store gold. I'm guessing they're recognizable by tag or something, if not that's an easy fix. Set all randomly generated items to a specific tag, and fix the appearance changer to also copy item tags. Then check the item tag when selling off inventory.

The demo starts out with no inventory, but lots of gold. If you watch for awhile you'll notice at first it buys some expensive items, but over time it ends up with higher quantity but lower quality.

Inspired by something I saw in Karond's thread about the economy. I don't remember who had the idea for a merchant with a randomly generated inventory. I saw it in a quote followed by the contention someone had with it and immediately thought, that's a good idea and that problem is easy to address.
Kurvallaxion Brax - Knight of the Baldur's Gate Thayan Enclave
User avatar
Xorena
Posts: 725
Joined: Wed Mar 30, 2016 8:21 am
Location: East Coast US

Re: Dynamic Merchant as a gold sink

Unread post by Xorena »

Khaevil neglected to mention that his merchant, Fred Drumpf, has recently arrived from Waterdeep and he brings his business acumen to the Sword Coast! We really should examine what he has to offer. He makes the best deals.
Eroica Hersbrucker, dungeon scout and hired blade

Helpful references:
Complete arcane spell list.
User avatar
Maximvs
Posts: 282
Joined: Sun May 17, 2009 3:45 pm

Re: Dynamic Merchant as a gold sink

Unread post by Maximvs »

With the ability to transfer items and gold from one toon to the next, no amount of gold sink will ever fix anything. Too little too late.
MmmmMMMMmmm, tasty humanz, hmmmmMMM!!!
User avatar
khaevil
Posts: 136
Joined: Thu Sep 03, 2009 7:00 pm
Location: East Coast USA

Re: Dynamic Merchant as a gold sink

Unread post by khaevil »

Muling is a separate issue. I'm not trying to suggest a way to prevent people from gearing out new characters and trivializing content. The industry has been trying to mitigate that for years, with limited success. There are some decent methods, but that's a discussion for another thread.

I'm suggesting a way to prevent gold from becoming worthless. As it stands players accumulate gold faster than they can spend it in any meaningful way, so it becomes worthless. Muling redistributes the problem, but it doesn't create it.

For preventing game currency obsolescence there is a proven solution: add a very expensive way to sink massive amounts of currency for a small chance at a marginal reward. In some games the reward is purely aesthetic, and it's still effective.
Kurvallaxion Brax - Knight of the Baldur's Gate Thayan Enclave
User avatar
Planehopper
Posts: 2298
Joined: Sun Oct 09, 2011 4:50 pm

Re: Dynamic Merchant as a gold sink

Unread post by Planehopper »

I like the idea. They have (or had) something similar on Sigil, I think it was. It isn't a cure-all, but it would definitely offer an outlet for spending gold, without punishing those that have little gold.

If you want to talk gold sinks though, try RCRing a wizard or two. Maaan. That added up real quick. :lol:
User avatar
Theodore01
Recognized Donor
Posts: 2927
Joined: Wed Feb 16, 2011 5:32 pm

Re: Dynamic Merchant as a gold sink

Unread post by Theodore01 »

I really like the idea.
Is it possible to make a vendor with random magical items that are not identified ?
(something like the gambler from Diablo)
User avatar
Ariella
Retired Staff
Posts: 1412
Joined: Sat Jul 20, 2013 11:57 am
Location: Australia

Re: Dynamic Merchant as a gold sink

Unread post by Ariella »

Theodore01 wrote:I really like the idea.
Is it possible to make a vendor with random magical items that are not identified ?
(something like the gambler from Diablo)
I would waste all my money on that
ctothep
Posts: 484
Joined: Sun Nov 30, 2014 7:06 pm

Re: Dynamic Merchant as a gold sink

Unread post by ctothep »

Ariella wrote:
Theodore01 wrote:I really like the idea.
Is it possible to make a vendor with random magical items that are not identified ?
(something like the gambler from Diablo)
I would waste all my money on that

same
Characters:

Zaraun - Vhaeraunite Deathsinger, School of Illusions and Phantasm

Retired Characters:

Iston - Lost within the void ... (deceased)
NeOmega
Posts: 769
Joined: Fri Feb 17, 2012 12:13 pm
Location: Seattle

Re: Dynamic Merchant as a gold sink

Unread post by NeOmega »

khaevil wrote:Muling is a separate issue. I'm not trying to suggest a way to prevent people from gearing out new characters and trivializing content. The industry has been trying to mitigate that for years, with limited success. There are some decent methods, but that's a discussion for another thread.

I'm suggesting a way to prevent gold from becoming worthless. As it stands players accumulate gold faster than they can spend it in any meaningful way, so it becomes worthless. Muling redistributes the problem, but it doesn't create it.

For preventing game currency obsolescence there is a proven solution: add a very expensive way to sink massive amounts of currency for a small chance at a marginal reward. In some games the reward is purely aesthetic, and it's still effective.
if you cant spend gold well, you arent playing right, or you are level 25+, and near the end of "the game" anyway.

All my characters find ways to spend gold. I have probably amassed about 50 bracers of the blinding strike, (the weak kind) between them, a dozen industrious hands of pim, 40 or 50 masks of death for my necromantic characters, and of course the always fun usables of high level summons. And I haven't even got into crafting/buying custom wands and potions.

I don't see any "currency" obsolescence. In fact, right now a mithral full plate is having a hard time selling at 600,000, when those oft go for 1,000,000. It may seem like everyone has millions to throw around, I assure you, they do not.

Later, I plan on spending excess gold on real bracers of the blinding strike for some (the +4 kind) and bracers of retribution for some (the ones with issacs missile storm), as well as some of those symbols of the thundergod which give call lightning storm charges.

Boots of speed come up often, with 3 shots of 10 round haste, those are nice too... cant afford those yet, as they auction at about 25,000. boots of etherialness are nice too... can never have too many of those...
User avatar
Akroma666
Posts: 1888
Joined: Mon Jan 16, 2012 2:24 pm
Location: California

Re: Dynamic Merchant as a gold sink

Unread post by Akroma666 »

ctothep wrote:
Ariella wrote:
Theodore01 wrote:I really like the idea.
Is it possible to make a vendor with random magical items that are not identified ?
(something like the gambler from Diablo)
I would waste all my money on that

same
Count me in
Storm - The Blade Flurry
Druegar Grizzleclaw - The Mountain Ruin Tsar
Akroma Thuul - The Creepy Enchanter
Liliana Duskblade - The B*tch of Bane
Jamie Dawnbringer - The Light in the Darkness
User avatar
khaevil
Posts: 136
Joined: Thu Sep 03, 2009 7:00 pm
Location: East Coast USA

Re: Dynamic Merchant as a gold sink

Unread post by khaevil »

Theodore01 wrote: Is it possible to make a vendor with random magical items that are not identified ?
(something like the gambler from Diablo)
Yes.

The first way that comes to mind is make an item called unidentified bracer that has an on acquire script. The script destroys the item and gives the possessor a random unidentified bracer to replace it.

I modified my merchant script real quick to test if unidentified items can just be placed in a merchants inventory, and it works. I was able to set the identification of an item on the merchant to false and it appears unidentified in his inventory. But the price is also what would be expected for an unidentified item. I think the scripted item method would be better, as the item value can be modified without affecting the value of the resulting item once identified.

Also, sometimes when the item is inspected in the merchant window it gives the identified description. So it seems a little buggy.
Kurvallaxion Brax - Knight of the Baldur's Gate Thayan Enclave
User avatar
khaevil
Posts: 136
Joined: Thu Sep 03, 2009 7:00 pm
Location: East Coast USA

Re: Dynamic Merchant as a gold sink

Unread post by khaevil »

I went ahead and wrote a script for selling "unidentified" items on merchants. Requires .2DA files with the name of unid<baseitemlabel>.2DA, with a ResRef column of possible results. Tested it and it worked just fine. Most of the work would be in making the possible result lists.

I'm going to do this for a bunch more stuff, I just did bracer so far, put it on my Fred Drumpf module and update the one on the vault. I really like the idea and think it should be shared with the NWN2 community. Probably won't get around to that until Saturday though.

// i_unidentifieditem_aq
/*
Script to replace an item with an unidentified item of the same type. Used to allow store to
sell unidentified magic items.
*/
// Eric_M 11 May 2016

void main()
{
object oPC = GetModuleItemAcquiredBy();
object oItem = GetModuleItemAcquired();
int nStackSize = GetModuleItemAcquiredStackSize();

if (!GetIsPC(oPC)) return;

string s2DAFileName = "unid" + Get2DAString("baseitems","label",GetBaseItemType(oItem));

DestroyObject(oItem,0.0,FALSE);
oItem = CreateItemOnObject(Get2DAString(s2DAFileName,"ResRef",Random(GetNum2DARows(s2DAFileName))),oPC,nStackSize,"",FALSE);
SetIdentified(oItem,FALSE);
}
Kurvallaxion Brax - Knight of the Baldur's Gate Thayan Enclave
Dagesh
Posts: 891
Joined: Mon Jan 16, 2012 11:03 pm

Re: Dynamic Merchant as a gold sink

Unread post by Dagesh »

Doesn't CopyItem work or GetResRef if creating from the palette?
ουκ εστιν ωδε, ηγερθη γαρ καθως ειπεν



PCs:
Rorick Runegraph (Check out Rorick's Rune of Light)
Ckalthea Chenfur
Aeric
Squire Brevin of Lathander
User avatar
khaevil
Posts: 136
Joined: Thu Sep 03, 2009 7:00 pm
Location: East Coast USA

Re: Dynamic Merchant as a gold sink

Unread post by khaevil »

I'm not seeing how either of those functions would be helpful in this context.

The NWNX4 extender would be a better way to get the template name for the item, instead of 2DA files. It should require less of the 4GB of memory the game can use, and be a little faster. But I'm just trying to demonstrate the idea in a module, and I wouldn't want anyone to need the extender just for that.
Kurvallaxion Brax - Knight of the Baldur's Gate Thayan Enclave
Dagesh
Posts: 891
Joined: Mon Jan 16, 2012 11:03 pm

Re: Dynamic Merchant as a gold sink

Unread post by Dagesh »

I have a sneaking suspicion they use NWNX4.
ουκ εστιν ωδε, ηγερθη γαρ καθως ειπεν



PCs:
Rorick Runegraph (Check out Rorick's Rune of Light)
Ckalthea Chenfur
Aeric
Squire Brevin of Lathander
Post Reply

Return to “Solved Problems”