Omnigamer wrote:I made a couple of small programs for calculating raw stat probabilities for each growth rank. This was mainly for my own planning purposes, but if there's enough interest I can try porting it into an applet somewhere?
My programs do two main things:
-Provide a histogram distribution of the stat for a particular level and rank
-Provide the raw probability that the stat will be between a certain range at a particular level and rank
Code: Select all
double result[1000]; // zero initialize if not
int growth=
void probMassFrom(double mass, int value, int level)
{
if (level==1)
{
result[value]+=mass;
}
else
{
probMassFrom(mass*lowerprob(growth,level)/256,value+gain(growth,level),level-1);
probMassFrom(mass*(256-lowerprob(growth,level))/256,value+gain(growth,level)+1,level-1);
}
}
Code: Select all
double result[1030]; // zero initialize if not
int growth=9;
int targetlevel=99;
int initialstat=0;
double lowerprob(int growth,int level)
{
// fill in
}
int gain(int growth,int level)
{
// fill in
}
int main()
{
result[initialstat]=1;
int level=1;
while (level<targetlevel)
{
level++;
int i=999;
while (i>-1)
{
double oldmass=result[i];
result[i]=0;
result[i+gain(growth,level)]+=oldmass*lowerprob(growth,level)/256;
result[i+gain(growth,level)+1]+=oldmass*(256-lowerprob(growth,level))/256;
i--;
}
}
return 0;
}
Omnigamer wrote:For the game's purposes, everybody does start at Level 1. At level 1, their stats are exactly equal to the base for their growth rates. The progression from 1->2 is the first time their growth rate gets added in.
Also, for anybody trying to get to an actual formula, the final stat values follow a Rice distribution for each "Tier" in the growth rate. To get the raw probability, you'd have to combine all 3 distributions. For any given distribution, the mean = base+((level-offset)*(low_val + prob_high), and std is approximated as sqrt((level-offset)*prob_high*(1-prob_high)) .
base = base bonus. Initial bonus for tier 1 (levels 1-19), 0 for other tiers
offset = offset of levels before distribution starts. 1 For Tier 1, 19 for Tier 2, 59 for Tier 3
low_val = the lower value you might get on a levelup.
prob_high = the probability of getting a higher value on a levelup.
Of course, this still means you need to have a way to calculate the probability density function given these parameters, which is not trivial for the distribution. In most cases you're still better off brute-forcing in some manner than trying to calculate the raw probability.
Users browsing this forum: No registered users and 2 guests