Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Vanilla

Reply
 
Thread Tools Display Modes
Old September 4, 2008, 18:35   #1
bpleshek
Apprentice
 
Join Date: Sep 2008
Posts: 59
bpleshek is on a distinguished road
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
bpleshek is offline   Reply With Quote
Old September 4, 2008, 19:16   #2
PowerDiver
Prophet
 
Join Date: Mar 2008
Posts: 2,799
PowerDiver is on a distinguished road
Quote:
Originally Posted by bpleshek View Post
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.
PowerDiver is offline   Reply With Quote
Old September 4, 2008, 19:23   #3
bpleshek
Apprentice
 
Join Date: Sep 2008
Posts: 59
bpleshek is on a distinguished road
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
bpleshek is offline   Reply With Quote
Old September 4, 2008, 23:52   #4
bpleshek
Apprentice
 
Join Date: Sep 2008
Posts: 59
bpleshek is on a distinguished road
i went from 18/01 to 18/31 in 1 pot. Is that a good roll ?

Brian
bpleshek is offline   Reply With Quote
Old September 5, 2008, 00:19   #5
aeneas
Adept
 
Join Date: Jun 2007
Location: The place of virtuous unbelievers
Posts: 158
aeneas is on a distinguished road
Quote:
Originally Posted by bpleshek View Post
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.
aeneas is offline   Reply With Quote
Old September 5, 2008, 15:15   #6
zaimoni
Knight
 
zaimoni's Avatar
 
Join Date: Apr 2007
Posts: 590
zaimoni is on a distinguished road
Quote:
Originally Posted by bpleshek View Post
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).
zaimoni is offline   Reply With Quote
Old September 5, 2008, 15:53   #7
bpleshek
Apprentice
 
Join Date: Sep 2008
Posts: 59
bpleshek is on a distinguished road
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
bpleshek is offline   Reply With Quote
Old September 23, 2008, 05:45   #8
bron
Knight
 
Join Date: May 2008
Location: Saratoga, California (in the midst of Silicon Valley)
Posts: 515
bron is on a distinguished road
> 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.]
bron is offline   Reply With Quote
Old October 1, 2008, 08:24   #9
takkaria
Veteran
 
takkaria's Avatar
 
Join Date: Apr 2007
Posts: 1,951
Donated: $40
takkaria is on a distinguished road
Quote:
Originally Posted by bron View Post
> 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 is offline   Reply With Quote
Old October 1, 2008, 14:21   #10
Narvius
Knight
 
Narvius's Avatar
 
Join Date: Dec 2007
Location: Poland, Katowice
Age: 31
Posts: 589
Narvius is on a distinguished road
Can't we just have linear stats...?
__________________
If you can convincingly pretend you're crazy, you probably are.
Narvius 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
Anyone gain more plev at one kill? AR_chie AAR 18 April 17, 2009 16:08
Stat Potion Idea Greebley Vanilla 4 May 29, 2008 10:24
Stat hacking Old Man Vanilla 1 October 12, 2007 15:13
advice: dive vs stat gain smee Vanilla 11 October 6, 2007 07:18
Spoilers updated for Vanilla 3.0.8! Hugo Vanilla 23 July 21, 2007 08:12


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


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