Dummy question on k_info allocation lines

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • konijn_
    Hellband maintainer
    • Jul 2007
    • 367

    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! *
  • Derakon
    Prophet
    • Dec 2009
    • 9022

    #2
    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).

    Comment

    • Nick
      Vanilla maintainer
      • Apr 2007
      • 9634

      #3
      Originally posted by Derakon
      (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.

      Comment

      • konijn_
        Hellband maintainer
        • Jul 2007
        • 367

        #4
        Got it, thanks guys!

        Originally posted by Nick
        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! *

        Comment

        • tangar
          Veteran
          • Mar 2015
          • 1004

          #5
          Yet Another Dummy There...

          I'm trying to figure out how alloc works, please help



          After past messager, it seems format changed.. Now it's
          # alloc: commonness : min " to " max
          # 'alloc' is for allocation - depth and rarity, in pairs. It is used to
          # ensure that certain vital items such as food and recall scrolls
          # are found throughout the dungeon. The "allocation" depth need not
          # match the depth as specified in the "properties:" line.
          Let's try at this two items (object.txt):

          Blade~ of Chaos
          alloc:10:70 to 100

          on depth 10, rarity of this blade is from 70 to 100..


          VS

          Dagger
          alloc:20:0 to 100

          on depth 20, rarity of dagger is from 0 to 100

          I'm trying to figure out how it works.. In previous message there was different structure, eg A:20/8:30/4:40/1 - is like the deeper we go - the more often we would meet mushroom...

          "Higher numbers are in fact less common", so the higher rarity - the more rare item.

          Back to dagger&blade:
          at depth 10: blade got ~85 rarity; dagger got ~(50/2)=25 rarity, right? So dagger would be in ~3.5 times more often than blade.

          at depth 20: blade got ~170 (?) rarity; dagger got ~50

          at depth 40 blade got ~ 340 rarity; dagger got ~100 ?

          Wierd.

          It seems I make something wrong.

          Lets take a lantern:
          alloc:70:5 to 100

          So at depth 70.. wait. Depth 70 for a lantern? D
          https://tangaria.com - Angband multiplayer variant
          tangaria.com/variants - Angband variants table
          tangar.info - my website ⍽⍽⍽⍽⍽⍽⍽⍽⍽⍽⍽⍽
          youtube.com/GameGlaz — streams in English ⍽ youtube.com/StreamGuild — streams in Russian

          Comment

          • Sideways
            Knight
            • Nov 2008
            • 896

            #6
            The 10 is the rarity, the 70 to 100 is the depth, not the other way round.
            The Complainer worries about the lack of activity here these days.

            Comment

            • Nick
              Vanilla maintainer
              • Apr 2007
              • 9634

              #7
              There are two problems here. One is that the OP was talking about a variant (probably Hellband) which used an older way of specifying how items are found.

              The second problem is that the comment is out of date - I am changing it to
              # 'alloc' is for allocation - frequency and range of levels found.
              So

              Originally posted by tangar
              Blade~ of Chaos
              alloc:10:70 to 100
              means frequency of 10, found on levels 70 to 100

              Originally posted by tangar
              Dagger
              alloc:20:0 to 100
              means frequency of 20, found on levels 0 to 100.

              Note that frequency ranges from a high of 80:
              Code:
              name:Cure Light Wounds
              alloc:80:1 to 15
              down to 1:
              Code:
              name:Power Dragon Scale Mail~
              alloc:1:100 to 100
              One for the Dark Lord on his dark throne
              In the Land of Mordor where the Shadows lie.

              Comment

              • takkaria
                Veteran
                • Apr 2007
                • 1951

                #8
                Indeed, the file format changed rather a long time ago in Vanilla but not all variants have the newer syntax.

                # alloc: commonness : min " to " max
                So 'commonnness' is the opposite of rarity - i.e. the higher this number, the more common it is. Min depth to max depth is just that. Objects just have one commonness value for the whole dungeon, but cut off above and below their range.

                "Commonness" is how many entries it gets in the object generation table for a given depth. So if it has 100, it will get 100 entries, if it has 10, it'll get 10 entries. So

                Skull
                alloc:50:1 to 100

                Broken dagger
                alloc:100:1 to 100
                means that there is a 50/(100+50) chance of getting a skull (33%) and a 100/150 chance of getting a broken dagger (67%)

                The old syntax had 'rarity', where rarity of 1 = 100 entries, 2 = 50 entries, 4 = 25 entries, 8 = 12 entries etc., and you could specify multiple rarity/depth pairs to change the allocation through the dungeon.
                takkaria whispers something about options. -more-

                Comment

                • tangar
                  Veteran
                  • Mar 2015
                  • 1004

                  #9
                  Wow! Now it's clear! Thank you, friends!! DD

                  The problem was in description of this value, as there is two notes in object.txt:

                  1) # alloc: commonness : min " to " max

                  // good one; especially with your great comments which makes everything so clear!

                  2)
                  # 'alloc' is for allocation - depth and rarity, in pairs. It is used to
                  # ensure that certain vital items such as food and recall scrolls
                  # are found throughout the dungeon. The "allocation" depth need not
                  # match the depth as specified in the "properties:" line.

                  // got an error?
                  https://tangaria.com - Angband multiplayer variant
                  tangaria.com/variants - Angband variants table
                  tangar.info - my website ⍽⍽⍽⍽⍽⍽⍽⍽⍽⍽⍽⍽
                  youtube.com/GameGlaz — streams in English ⍽ youtube.com/StreamGuild — streams in Russian

                  Comment

                  • Derakon
                    Prophet
                    • Dec 2009
                    • 9022

                    #10
                    I want to highlight takkaria's answer, in particular the fact that how much of a given item you find depends on how much of other items you find. You can't change how many items are generated overall by changing the allocation rules, in other words; you can just make a particular item more or less likely than other items to get "chosen" when the game decides to produce an item.

                    This is part of why, for example, Potions of Speed are more common early on: they have a fairly flat distribution across the entire game, but at the top of the dungeon there are very few items that can get generated, so a relatively higher proportion of them are Potions of Speed.

                    Comment

                    • tangar
                      Veteran
                      • Mar 2015
                      • 1004

                      #11
                      Originally posted by Derakon
                      I want to highlight takkaria's answer, in particular the fact that how much of a given item you find depends on how much of other items you find. You can't change how many items are generated overall by changing the allocation rules, in other words; you can just make a particular item more or less likely than other items to get "chosen" when the game decides to produce an item.

                      This is part of why, for example, Potions of Speed are more common early on: they have a fairly flat distribution across the entire game, but at the top of the dungeon there are very few items that can get generated, so a relatively higher proportion of them are Potions of Speed.

                      Thank you for additional details, good example indeed with Potions of Speed!

                      It seems, it would take long years to learn all this beautiful stuff, but it definitely cost it! I've just started to realise that Angband is actually a roguelike GAME ENGINE. Thats why there are so much different variants! And it comes toward this (advancing it's game engine foundation) path more and more. Really awesome!
                      Last edited by tangar; January 26, 2019, 12:11.
                      https://tangaria.com - Angband multiplayer variant
                      tangaria.com/variants - Angband variants table
                      tangar.info - my website ⍽⍽⍽⍽⍽⍽⍽⍽⍽⍽⍽⍽
                      youtube.com/GameGlaz — streams in English ⍽ youtube.com/StreamGuild — streams in Russian

                      Comment

                      • Pete Mack
                        Prophet
                        • Apr 2007
                        • 6883

                        #12
                        Angband is not a game engine, or at least it wasn't til a very recent release. It used to be that every effect was hardcoded. Now it is done with a combination of code generation and edit files, aka confirguration-driven design. (The first variant to get most of the way there was UnAngband, but its code is not as clean as vanilla's.) That said, if you want genuinely new gameplay effects (behavior of locked doors, say, or melee details) you need to edit actual code.

                        ToME is a true engine. It means that there is excellent modularity between gameplay and all the neceessry bookkeeping. Unfortunately it also means that all effects are written as little subroutines in a scripting language. Configuation-driven design is much easier for casual modification, I agree.

                        Comment

                        • tangar
                          Veteran
                          • Mar 2015
                          • 1004

                          #13
                          Originally posted by Pete Mack
                          Angband is not a game engine, or at least it wasn't til a very recent release. It used to be that every effect was hardcoded. Now it is done with a combination of code generation and edit files, aka confirguration-driven design. (The first variant to get most of the way there was UnAngband, but its code is not as clean as vanilla's.) That said, if you want genuinely new gameplay effects (behavior of locked doors, say, or melee details) you need to edit actual code.
                          Angband as 'game engine'

                          I played for years in TomeNET which is based at very old version of MAngband (which is based at ancient version of Angband), and it didn't had 'game engine' component in it. Modern Angband is very different!

                          Considering 'configuration' aspect:
                          In contrast to 'regular' graphic-based games (eg modern RRG genre), roguelike genre 'game engine' is supposed to be configuration based. As the foundation of the roguelike game is to 'assemble' RNG dungeons, put there random objects and give player to deal with them - and it's all depends on certain formulas and constants. When we change such parameters in configuration - we change the most important part of the game; actually roguelike game could be considered as a 'mathematical model'.

                          Thats why current Angband gamedata configuration provide loads times more possibilities in game design than any existent _default_ (out-of-box) 'modern RPG' game engine, like Unity etc. of course, this fact mainly based at roguelikish RNG-based gamedesign, but still

                          And of course to implement some unusual staff you have to code.. But anyway right now you could do AMAZING things with current 'game engine' I enjoy working with it!
                          https://tangaria.com - Angband multiplayer variant
                          tangaria.com/variants - Angband variants table
                          tangar.info - my website ⍽⍽⍽⍽⍽⍽⍽⍽⍽⍽⍽⍽
                          youtube.com/GameGlaz — streams in English ⍽ youtube.com/StreamGuild — streams in Russian

                          Comment

                          Working...
                          😀
                          😂
                          🥰
                          😘
                          🤢
                          😎
                          😞
                          😡
                          👍
                          👎