Stat Gain Question (spoilers possible)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bpleshek
    Apprentice
    • Sep 2008
    • 59

    Stat Gain Question (spoilers possible)

    In one of tables in the spoilers file for character creation list the following table:

    skill lvl Gain
    -----------------------
    to 18 +1/+2
    18/01 to /69 5+d15
    18/70 to /89 2+d6
    18/90+ 1

    Is this the same formula that is used when drinking stat gain potions as well?

    Brian
  • PowerDiver
    Prophet
    • Mar 2008
    • 2820

    #2
    Originally posted by bpleshek
    In one of tables in the spoilers file for character creation list the following table:

    skill lvl Gain
    -----------------------
    to 18 +1/+2
    18/01 to /69 5+d15
    18/70 to /89 2+d6
    18/90+ 1

    Is this the same formula that is used when drinking stat gain potions as well?

    Brian
    I have no idea what that is. It looks kind of similar to gains from stat potions, but except for the "to 18" I think you can gain more. E.g. I konw I have gone from 18/97 to 18/99 with one potion.

    Comment

    • bpleshek
      Apprentice
      • Sep 2008
      • 59

      #3
      I found it in Ability.SPO.

      But my question is, are those values correct for gaining stats with potions or is there another table instead?

      Thanks,

      Brian

      Comment

      • bpleshek
        Apprentice
        • Sep 2008
        • 59

        #4
        i went from 18/01 to 18/31 in 1 pot. Is that a good roll ?

        Brian

        Comment

        • aeneas
          Adept
          • Jun 2007
          • 158

          #5
          Originally posted by bpleshek
          i went from 18/01 to 18/31 in 1 pot. Is that a good roll ?
          Yep- not all that unusual, I don't think, but I think that's about as much as you can gain at that point. I don't know the exact formula but as PowerDiver pointed out the above is definitely not it (for stat potions)- you can certainly gain more than 1 point even when over 18/90, and you just gained 30 when over 18, so... The progression is quite similar to that though, but the values are a bit larger.

          Comment

          • zaimoni
            Knight
            • Apr 2007
            • 590

            #6
            Originally posted by bpleshek
            In one of tables in the spoilers file for character creation list the following table:

            skill lvl Gain
            -----------------------
            to 18 +1/+2
            18/01 to /69 5+d15
            18/70 to /89 2+d6
            18/90+ 1

            Is this the same formula that is used when drinking stat gain potions as well?

            Brian
            Almost. A stat gain potion first rolls whether to apply that table once or twice (1 in 4 chance, assuming recent versions have not deviated in this from when I last checked).
            Zaiband: end the "I shouldn't have survived that" experience. V3.0.6 fork on Hg.
            Zaiband 3.0.10 ETA Mar. 7 2011 (Yes, schedule slipped. Latest testing indicates not enough assert() calls to allow release.)
            Z.C++: pre-alpha C/C++ compiler system (usable preprocessor). Also on Hg. Z.C++ 0.0.10 ETA December 31 2011

            Comment

            • bpleshek
              Apprentice
              • Sep 2008
              • 59

              #7
              Well this is what i found in the code:

              bool inc_stat(int stat)
              {
              int value, gain;

              /* Then augment the current/max stat */
              value = p_ptr->stat_cur[stat];

              /* Cannot go above 18/100 */
              if (value < 18+100)
              {
              /* Gain one (sometimes two) points */
              if (value < 18)
              {
              gain = ((rand_int(100) < 75) ? 1 : 2);
              value += gain;

              }

              /* Gain 1/6 to 1/3 of distance to 18/100 */
              else if (value < 18+98)
              {
              /* Approximate gain value */
              gain = (((18+100) - value) / 2 + 3) / 2; /* Paranoia */
              if (gain < 1) gain = 1;

              /* Apply the bonus */
              value += randint(gain) + gain / 2;
              /* Maximal value */
              if (value > 18+99) value = 18 + 99;
              }

              /* Gain one point at a time */
              else
              {
              value++;
              }

              /* Save the new value */
              p_ptr->stat_cur[stat] = value;

              /* Bring up the maximum too */
              if (value > p_ptr->stat_max[stat])
              {
              p_ptr->stat_max[stat] = value;
              }

              /* Recalculate bonuses */
              p_ptr->update |= (PU_BONUS);

              /* Success */
              return (TRUE);
              }

              /* Nothing to gain */
              return (FALSE);
              }


              Based on this, my max gain should be:

              ((118-19)/2 + 3)/2 = 51

              RandINT (51) + 25 (51/2) or 26 - 76 stat points in the first potion if starting at 18/01(19).

              Then it gets harder each other time. Assuming that i roll(or cheat to roll) the max of 76, then for my next potion my start value is 18/77 or 95. Applying the formula, the next potion will give me:

              ((118-95)/2 +3)/2 = 7(.25)

              RANDINT(7)+3(7/2) would give me a range of 4-10 for the next potion.

              Am I understanding this correctly ?

              Approximately how many stat gain potions do i need of each stat once I get to 18 so I can gauge how long i need to stay at 1600'.

              Brian

              Comment

              • bron
                Knight
                • May 2008
                • 515

                #8
                > Am I understanding this correctly
                The idea is correct, but your math is a little off.

                > ((118-19)/2 + 3)/2 = 51
                > RandINT (51) + 25 (51/2) or 26 - 76 stat points in the first potion if starting at 18/01(19)
                That should be ((118 - 18)/2 + 3)/2 = 26 and
                randint(26) + (26)/2 = 14 - 39 for the first potion if starting at 18

                There is also a bug here (well, at least I think it is a bug). If your stat starts out
                at 17, and the RNG decides to give you and extra +1, your stat goes to 18/01
                rather than going first to 18 and then to 18/14 - 18/39.

                I am also personally annoyed by the comment in the code. If they want the stat to
                increase by between 1/6 and 1/3 of the distance to 18/100, then that's what the code
                ought to do. Instead, it is actually increasing the stat by between 1/8 and 3/8 of
                the distance to 18/100 (with a little rounding error thrown in). Probably someone
                had the mistaken idea that dividing by something other than a power of two would be
                slow. Either the code or the comment should be changed. Preferably both.
                [I actually wrote code to fix both these issues in my personal version of the source,
                but never submitted it.]

                Comment

                • takkaria
                  Veteran
                  • Apr 2007
                  • 1951

                  #9
                  Originally posted by bron
                  > Am I understanding this correctly
                  The idea is correct, but your math is a little off.

                  > ((118-19)/2 + 3)/2 = 51
                  > RandINT (51) + 25 (51/2) or 26 - 76 stat points in the first potion if starting at 18/01(19)
                  That should be ((118 - 18)/2 + 3)/2 = 26 and
                  randint(26) + (26)/2 = 14 - 39 for the first potion if starting at 18

                  There is also a bug here (well, at least I think it is a bug). If your stat starts out
                  at 17, and the RNG decides to give you and extra +1, your stat goes to 18/01
                  rather than going first to 18 and then to 18/14 - 18/39.

                  I am also personally annoyed by the comment in the code. If they want the stat to
                  increase by between 1/6 and 1/3 of the distance to 18/100, then that's what the code
                  ought to do. Instead, it is actually increasing the stat by between 1/8 and 3/8 of
                  the distance to 18/100 (with a little rounding error thrown in). Probably someone
                  had the mistaken idea that dividing by something other than a power of two would be
                  slow. Either the code or the comment should be changed. Preferably both.
                  [I actually wrote code to fix both these issues in my personal version of the source,
                  but never submitted it.]
                  I think by far the best solution here is to make stat gain potions gain one point up to 18, and 10 points at a time after that. This would simplify a fair amount of source with it. I expect to do this in 3.1.1.
                  takkaria whispers something about options. -more-

                  Comment

                  • Narvius
                    Knight
                    • Dec 2007
                    • 589

                    #10
                    Can't we just have linear stats...?
                    If you can convincingly pretend you're crazy, you probably are.

                    Comment

                    • PowerDiver
                      Prophet
                      • Mar 2008
                      • 2820

                      #11
                      Originally posted by Narvius
                      Can't we just have linear stats...?
                      That requires rebalancing time attacks, but IMO they need rebalancing anyway.

                      I hate the 18/xxx thing.

                      Comment

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