Angband Forums maximum treasure amount?
 Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 September 12, 2016, 08:35 #1 mrfy Swordsman   Join Date: Jul 2015 Location: Seattle, WA Posts: 298 maximum treasure amount? I've seen this twice now in my several years of Angband dungeoning: "You have found 32767 gold pieces worth of adamantite." I'm assuming that 32767 is the maximum amount of treasure you can find at a time? That would make sense if the value is represented by a 16 bit integer. What are the odds of finding this amount of treasure?
September 12, 2016, 12:30   #2
PowerWyrm
Prophet

Join Date: Apr 2008
Posts: 2,924
Quote:
 Originally Posted by mrfy I've seen this twice now in my several years of Angband dungeoning: "You have found 32767 gold pieces worth of adamantite." I'm assuming that 32767 is the maximum amount of treasure you can find at a time? That would make sense if the value is represented by a 16 bit integer. What are the odds of finding this amount of treasure?
Probably not that low if you find a hydra pit and kill them all in the same corner.
__________________

September 14, 2016, 21:08   #3
hein
Rookie

Join Date: Jul 2015
Posts: 14
Quote:
 Originally Posted by PowerWyrm Probably not that low if you find a hydra pit and kill them all in the same corner.
Ive seen this two times too - I´m pretty sure one of them was a drop from a baby dragon, and the other one just some random treasure on the floor - I think this might be an odd bug(?)

September 14, 2016, 22:04   #4
takkaria
Veteran

Join Date: Apr 2007
Posts: 1,947
Donated: \$40
Quote:
 Originally Posted by hein Ive seen this two times too - I´m pretty sure one of them was a drop from a baby dragon, and the other one just some random treasure on the floor - I think this might be an odd bug(?)
It's intentional! In obj-make.c, make_gold():

Code:
```    /* Cap gold at max short (or alternatively make pvals s32b) */
if (value > SHRT_MAX)
value = SHRT_MAX;```
This is because the value stored in the savefile is a 16 bit value and is unchanged probably since Moria... it could safely be changed, I think.
__________________
takkaria whispers something about options. -more-

September 14, 2016, 23:34   #5
Derakon
Prophet

Join Date: Dec 2009
Posts: 9,024
Quote:
 Originally Posted by takkaria It's intentional!
It's intentional to cap max drop size at 32767, but is it intentional to generate piles that size? Without being in a situation like a hydra pit where multiple piles get combined, that is.

I'm pretty sure gold drops can get "supercharged" potentially without limit, allowing unusually large gold drops from ordinary enemies, but unless the supercharging is really strongly exponential, you'd expect to see drop sizes in the 5k+, 10k+, and 20k+ range. Which you don't, really -- you just see normal-sized gold drops, and the exceptionally rare 32767 drop. I've seen exactly one of those, that I can recall, though I don't remember the context.

 September 15, 2016, 12:06 #6 Carnivean Knight   Join Date: Sep 2013 Posts: 527 I suspect that the adamantite multiplier boosts it to that level. I've gotten it a few times, and I'd be fairly sure it's adamantite each time.
September 15, 2016, 12:13   #7
takkaria
Veteran

Join Date: Apr 2007
Posts: 1,947
Donated: \$40
Quote:
 Originally Posted by Derakon It's intentional to cap max drop size at 32767, but is it intentional to generate piles that size? Without being in a situation like a hydra pit where multiple piles get combined, that is. I'm pretty sure gold drops can get "supercharged" potentially without limit, allowing unusually large gold drops from ordinary enemies, but unless the supercharging is really strongly exponential, you'd expect to see drop sizes in the 5k+, 10k+, and 20k+ range. Which you don't, really -- you just see normal-sized gold drops, and the exceptionally rare 32767 drop. I've seen exactly one of those, that I can recall, though I don't remember the context.
Hm, yeah, I see your point. The supercharging has a 1% chance of happening (and if it happens, it has another 1% chance of happening etc) and it should limit itself so it never reaches MAX_SHORT. So I have no idea what's going on here.
__________________
takkaria whispers something about options. -more-

 September 15, 2016, 12:14 #8 MattB Veteran   Join Date: Mar 2013 Location: Berkshire, UK Posts: 1,213 I'm pretty sure I've had exactly 32000 quite a few times. How does that work? (Or am I going stark raving mad??)
September 15, 2016, 16:17   #9
Derakon
Prophet

Join Date: Dec 2009
Posts: 9,024
Quote:
 Originally Posted by Carnivean I suspect that the adamantite multiplier boosts it to that level. I've gotten it a few times, and I'd be fairly sure it's adamantite each time.
If I recall correctly, the quantity of money determines the material used, not the other way around. In other words, the game decides to generate 583 money, then looks up the various ranges and determines that it should use "rubies" as the descriptor, say.

September 15, 2016, 21:51   #10
Nick
Vanilla maintainer

Join Date: Apr 2007
Location: Canberra, Australia
Age: 56
Posts: 9,351
Donated: \$60
Quote:
 Originally Posted by Derakon If I recall correctly, the quantity of money determines the material used, not the other way around. In other words, the game decides to generate 583 money, then looks up the various ranges and determines that it should use "rubies" as the descriptor, say.
Yeah, that's right. I'll file this as a bug.
__________________
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.

 Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Angband     AAR     Vanilla     Development     ToME     Sil     Variants     Competition The real world     Idle chatter     Oook! Obsolete     v4

 Similar Threads Thread Thread Starter Forum Replies Last Post BlueFish Vanilla 1 February 2, 2013 21:47 fruviad Development 12 September 29, 2011 03:28 Thraalbee Vanilla 2 September 23, 2011 22:37 Dranken Vanilla 4 August 31, 2011 19:24 steeg1234321 Vanilla 11 April 4, 2008 14:28

All times are GMT +1. The time now is 00:35.