Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old March 12, 2018, 20:29   #1
konijn_
Hellband maintainer
 
konijn_'s Avatar
 
Join Date: Jul 2007
Location: New York, the Big Apple
Age: 41
Posts: 367
Donated: $120
konijn_ is on a distinguished road
Question Dummy question on k_info allocation lines

Greetings,

I do not understand what these numbers represent:
N:12:Restoring
G:,:d
I:80:19:500
W:20:0:1:1000
A:20/8:30/4:40/1
D:Eating this rare mushroom will restore your body and mind.

I can see a list of 'locale' and 'chance', for each kind, but what do these numbers do in the game?
__________________
* Are you ready for something else ? Hellband 0.8.8 is out! *
konijn_ is offline   Reply With Quote
Old March 12, 2018, 20:47   #2
Derakon
Prophet
 
Derakon's Avatar
 
Join Date: Dec 2009
Posts: 8,374
Derakon is on a distinguished road
This is saying "at depth 20, this item has rarity 8, at 30 it has rarity 4, at 40 it has rarity 1". When the game chooses to allocate an item, it sums up rarities of all items in the game, scaled by how out-of-depth they would be, then picks one. For example, say the game only had two items: the Mushroom of Restoring, and a Dagger that had a flat rarity of 1 at every depth. At depth 20, then, the game would say "the mushroom is 8 times more likely to drop than the dagger", and generates an allocation range with 9 buckets in it. The first 8, covering values from 0 to .88888... (i.e. 8/9) go to the mushroom, the last 1 goes to the dagger. The game generates a random number between 0 and 1, looks in the allocation range, and generates whichever item corresponds to where it landed.

At depth 30, it does the same thing, except this time the mushroom is only 4 times more common than the dagger, so the mushroom gets values from 0 to .8, and the dagger the rest. And at depth 40, the two split the range 50/50.

In other words, rarity of one item always depends on rarities of every other item in the game. You can only make an item more (or less) common by comparison with other items, and you can't state anything about what percentages of all items are a given item without looking at the percentages of everything else.

(NB I'm not 100% certain that higher numbers are more common; it might be the reverse, in which case you'd need to invert the example so the mushroom is 1/8th as common as the dagger, then 1/4th, then 1:1, at the respective depths).
Derakon is offline   Reply With Quote
Old March 12, 2018, 20:54   #3
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 53
Posts: 7,110
Donated: $60
Nick is on a distinguished road
Quote:
Originally Posted by Derakon View Post
(NB I'm not 100% certain that higher numbers are more common; it might be the reverse, in which case you'd need to invert the example so the mushroom is 1/8th as common as the dagger, then 1/4th, then 1:1, at the respective depths).
Higher numbers are in fact less common; this makes sense with the ,Restoring entry because it gets more common the deeper you go.
__________________
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.
Nick is offline   Reply With Quote
Old March 12, 2018, 21:04   #4
konijn_
Hellband maintainer
 
konijn_'s Avatar
 
Join Date: Jul 2007
Location: New York, the Big Apple
Age: 41
Posts: 367
Donated: $120
konijn_ is on a distinguished road
Got it, thanks guys!

Quote:
Originally Posted by Nick View Post
Higher numbers are in fact less common; this makes sense with the ,Restoring entry because it gets more common the deeper you go.
__________________
* Are you ready for something else ? Hellband 0.8.8 is out! *
konijn_ is offline   Reply With Quote
Reply


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

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 Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Competition-agnostic item allocation Derakon Development 14 December 14, 2016 21:27
dummy question: diff will_asher Development 14 September 19, 2010 05:12


All times are GMT +1. The time now is 03:18.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.