PDA

View Full Version : buyout button


PowerDiver
December 10, 2009, 01:39
I was planning on waiting to get some birth options done, but I've been lazy. I got a request, so rather than making anyone wait any longer, here's a perl script that should modify the code to add a buyout button. Run it in .../src

I use 4 char suffixes, and don't know about newlines, so maybe things will need to be changed to get it to work in windows. Surely anyone with a clue should be able to fix it.

I removed some broken stuff about options, hopefully it should work as is. I had to change the suffix to .txt to get oook to upload it.

Hopefully this should continue to work as the codebase evolves.

Derakon
December 10, 2009, 02:07
...I think that's the first time I've seen a patch distributed as a Perl script. Okay.

PowerDiver
December 10, 2009, 02:41
...I think that's the first time I've seen a patch distributed as a Perl script. Okay.

How would you distribute a patch that needs to work on everything from 3.1.1.1626 to the latest nightly? They have significantly different code.

Marble Dice
December 10, 2009, 07:35
Or if you prefer, here's a patch file in Unix file format. Change directory to "src" and apply it with this command:


patch < /path/to/pd_buyout.txt

PowerDiver
December 10, 2009, 18:34
Way to make me look silly!

The variable stuff was in the options code. Things like some revisions [properly IMO] comma-terminating enums and some not. I suppose once I cut down to just the buyout button I should have realized a simple diff would work.

Marble Dice
December 10, 2009, 19:12
Way to make me look silly!

Don't worry, I felt pretty silly too since I don't actually have perl in my (Windows) development environment. I had to upload the script and source file to one of my unix boxes, execute it, and then download the result!

tigen
December 10, 2009, 23:22
Is it really desirable for a buyout to induce a restock? It doesn't seem intuitive to me, and I don't see what it adds to the game.

Why shouldn't the store just stay empty until the next normal restock?

Derakon
December 10, 2009, 23:37
There needs to be some way to force a restock, or to obviate the need for restocks. Townscumming is a tedius waste of time, and the game should not reward tedium. My personally-preferred approach would be to have the stores stock infinite quantities of basic goods (rations, oil, WoR scrolls, C*W potions, unenchanted ammo, etc.), but that's admittedly significantly trickier than the buyout button.

Marble Dice
December 10, 2009, 23:41
The game's been that way for a long while, this patch just makes it easy to do (buy out every item in a store manually and they'll restock for you).

I think variable stock (excepting the black market) is annoying. With scumming you can trivially force the stores to cycle stock, so the player just has to waste lots of keystrokes, game time, and RL time because they got unlucky with random stock.

Derakon is on the money, but it's not a technical difficulty so much as a balance one. Shops are due for an overhaul sometime in the near future, so these problems might be addressed then. This button isn't going into V, which is why PowerDiver posted it here as a patch. In the mean time, if you need a spellbook, a stat restore potion, or a scroll of remove curse, and it doesn't happen to be there, your choices are scumming, buyout the store, or live with what might be a critical deficiency in your kit.

tigen
December 10, 2009, 23:50
There needs to be some way to force a restock, or to obviate the need for restocks. Townscumming is a tedius waste of time, and the game should not reward tedium. My personally-preferred approach would be to have the stores stock infinite quantities of basic goods (rations, oil, WoR scrolls, C*W potions, unenchanted ammo, etc.), but that's admittedly significantly trickier than the buyout button.

Sounds good to me!

You could have the general store only sell basic stuff, and never run out of stock. It could sell only food, oil, torches, and standard ammo. I don't think the other items are strictly necessary, and you have the ability to stock up on them/conserve them.

Even with buyouts, the game still "rewards" townscumming in that you can restock without spending the gold on buyouts. Right? You could have an "automatic townscum" button too, which makes about as much sense as a buyout button.

Derakon
December 11, 2009, 00:14
Well, townscumming takes gametime, while the buyout button takes money. It's not that uncommon, particularly in competitions, to be willing to use money in preference to gametime.

As for what items would be stocked by a hypothetical "infinite stock" store, personally I'd include the following:

General Store: rations; torches; lanterns; oil; unenchanted ammo
Weapons store: unenchanted ammo
Temple: Restore Stat / Life Levels; Cure Light/Serious/Critical Wounds; Heroism; first four priest books
Alchemist: ID; Phase Door; Word of Recall; Satisfy Hunger
Magic Store: First four mage books

My basic philosophy here is "If the missing item would make you feel like your kit is incomplete or you aren't fully prepared to return to the dungeon, then the item should always be stocked by a store." Of course, the "you" in this case needs to be fairly broad to cover most players; personally I don't usually care if my experience is partiall drained (I'll buy a !Restore Life Levels if it's available, but I won't townscum for it), but I know other players who are much more stringent about it.

Magnate
December 11, 2009, 19:45
Dudes, there have been several looooong threads on the subject of store stocking within the last 6 months or so. They ran the gamut from gameplay implications to economic realism and back. It's one of those issues where the views on all sides are pretty well known, and we're just waiting for Takkaria to tell us which side he comes down on. All we know at the moment is that he doesn't want a buyout button and he doesn't want people to need to buy out the store manually. We don't know what he thinks should be infinite and what should be dungeon-only (never available for purchase). We also don't know his view on the whole economic realism argument (i.e. whether prices should change during the game).

pav
December 13, 2009, 22:49
General Store: rations; torches; lanterns; oil; unenchanted ammo
Weapons store: unenchanted ammo
Temple: Restore Stat / Life Levels; Cure Light/Serious/Critical Wounds; Heroism; first four priest books
Alchemist: ID; Phase Door; Word of Recall; Satisfy Hunger
Magic Store: First four mage books
You totally don't need restore stat or exp. It is no big deal to spend a recall or two with drained stats. Easily survivable. Also, have spare books and ID at home. The rest is IIRC already guaranteed available.

Derakon
December 14, 2009, 03:39
Drained stats: definitely depends on the situation. I've had warriors get drained from 4 attacks/round down to 1 because they had to fight a drainer in melee combat; they're sure as hell not going back in gimped to a fourth their normal offensive capability. Likewise, a mage who's gotten badly INT-drained is going to want to get that restored first. Sure, these might be survivable -- if you're going to avoid getting into any remotely nontrivial fights. But then what are you down in the dungeon for?

ID: I'll grant I haven't played with the recent ID changes, but for older variants I'll generally buy all of the ID scrolls available in the alchemist's shop and still regularly run out.

There are two reasons to return to town: to re-equip, and to sell off loot. Restoring stats is part of re-equipping, and having an adequate supply of ID is part of selling off loot. (Okay, there's a third reason: as a last-ditch escape from a fight. But that doesn't affect this discussion)

JonnyOThan
December 24, 2009, 16:23
I recently lost a level 23 ranger in the most unlucky game I've ever played. I never found any artifacts...but relevant to this discussion I was -4 DEX for pretty much the entire game. !Restore <everything but DEX> were readily available.

One of my biggest frustrations is spell failure rates. It's quite tedious to sit in one spot and cast Identify 10 times in a row without success, when the fail rate is 63%. I don't know how the code actually works, but I'm guessing it's independent random number generation? What if you instead randomly generate a number which is how many failures you'll have in a row before succeeding (for failure rate >50%)?

And you could apply this technique to store inventory. Some things should have infinite supply, but !restore stats, I'm not so sure. But it would be pretty cool if you never had to restock the store more than X times before getting what you needed.

Pete Mack
December 31, 2009, 08:20
Don't cast the spell, if the failure rate is 63%. ID is easy to find in stores, so stock up on it. (20 or more scrolls of ID is not an unreasonable burden, especially for rangers...)

Derakon
December 31, 2009, 09:05
JonnyOThan was more complaining that 63% failure rate spells seem to fail a lot more often than 63% of the time, and suggesting that there should be a cap on the maximal number of failures in a row before getting a success (though it seems to me like that would need some rules to prevent it being abusable, i.e. "cast" the failures, then save the success for when you need it).

Pete Mack
December 31, 2009, 09:09
I don't think this is a good idea-- imagine applying it to a 5% fail spell...

zaimoni
December 31, 2009, 10:34
JonnyOThan was more complaining that 63% failure rate spells seem to fail a lot more often than 63% of the time, and suggesting that there should be a cap on the maximal number of failures in a row before getting a successWhile there are some subtle issues with the current RNG exposable by careful savescumming, this is not one I can empirically document. The problems have more to do with excessively long sequences of highly probable events. (Generally, anything less probable ~1/27 with expected probability p, has little trouble problem attaining a streak of 3/p failures far more than 5% of the time.)(though it seems to me like that would need some rules to prevent it being abusable, i.e. "cast" the failures, then save the success for when you need it).True. I've considered something like this in reverse. (Infer savescumming by severe deviations between expected probability and measured incidence, then "dissipate" the accumulated karma.)

Pete Mack
January 2, 2010, 09:45
Finally installed this after failing to get !rLife twice. Minor code fix:

menu.cmd_keys = "K\n\x04\x10\r?={}~CEIPTdegilpswx\x8B\x8C"; /* \x10 = ^p , \x04 = ^D */

Please use ascii order for these -- it's insanely hard to read otherwise.