====== CalcCorrectGraph ======
Outputs a value based on input value run through calculations. Used for things like weapon stat scaling,
soul level cost, max HP, resistances, etc.
Calculations can be simplified by using [[https://github.com/kingborehaha/CalcCorrectGraph-Calculation-Tool | CalcCorrectGraph Calculation Tool]]
==== Example ====
**Relevant values for example**
calcCorrectGraph is being used for 200 strength scaling, 0 dexterity scaling weapon.
Players strength stat (input) is 10
* ''stageMaxVal0 = 0''
* ''stageMaxVal1 = 20''
* ''stageMaxGrowVal0 = 12''
* ''stageMaxGrowVal1 = 50''
Since the player's strength stat is 10, parameter fields for stage 0 to stage 1 will be used, as it lies between ''stageMaxVal0(0)'' and ''stageMaxVal1(20)''
output = stageMaxGrowVal0 + ((stageMaxGrowVal1 - stageMaxGrowVal0) * ((input - stageMaxVal0) / (stageMaxVal1 - stageMaxVal0)))
**Calculate ratio of input value and maximum output stage value**
Max output stage value for stage 0 to 1: ''stageMaxVal1(20)''
Input = PlayerStrengthStat(10)
(Input(10) - stageMaxVal0(0)) / (stageMaxVal1(20) - stageMaxVal0(0)) = .5, aka 50%
This means that the final output value will be 50% of the output value potential.
(note: this part is affected by adjPt_maxGrowVal0-5 when present, which adds an additional calculation making ratio growth non-linear)
**Calculate output value potential for stage 0 to 1**
Min output stage value for stage 0 to 1: ''stageMaxGrowVal0(12)''
Max output stage value for stage 0 to 1: ''stageMaxGrowVal1(50)''
Output value potential for stage 0 to 1: ''stageMaxGrowVal1(50)-stageMaxGrowVal0(12) = 38''
**Calculate Output**
Calculate input value ratio (.5 aka 50%) with output value potential, then add output stage value minimum for final output value
OutputValuePotential(38) * InputRatio(.5) = 19 + MinimumOutputValue(12) = 31
The final output value is 31, which in the case of weapon stat calculations will be applied as a multiplier to stat scaling. Meaning the weapon will effectively use 31% of the maximum stat scaling. ''31% of StrengthStatScaling(200) = 62''
===== Fields =====
^ Field ^ Type ^ Offset ^ Description ^ Notes ^
| stageMaxVal0 | ''f32'' | ''0x0'' | Stat Level Cap corresponds to the level of a certain stat | |
| stageMaxVal1 | ''f32'' | ''0x4'' | Stage cap corresponds to the level of a certain stat | |
| stageMaxVal2 | ''f32'' | ''0x8'' | Stage cap corresponds to the level of a certain stat | |
| stageMaxVal3 | ''f32'' | ''0xc'' | Stage cap corresponds to the level of a certain stat | |
| stageMaxVal4 | ''f32'' | ''0x10'' | Stage cap corresponds to the level of a certain stat | |
| stageMaxGrowVal0 | ''f32'' | ''0x14'' | Stage growth is a multiplier of the maximum growth that will occur in a certain stage, as an example a chart such as this: Growth Stage 0 - Growth = 20 - 20% of the total scaling is reached at stage 0. Growth Stage 1 - Growth = 25 - 25% of the total scaling is reached at stage 1. Growth Stage 2 - Growth = 50 - 50% of the total scaling is reached at stage 2. Growth Stage 3 - Growth = 80 - 80% of the total scaling is reached at stage 3. Growth Stage 4 - Growth = 90 - 90% of the total scaling is reached at stage 4. As you can see, in this specific chart 100% is never reached, 100% could be reached if only the value of growth stage 4 was 100% This is not limited to 100% as an example growth stage 4 could reach 200%. The level cap of a growth stage is specified in the corresponding Stat Level Cap Field | |
| stageMaxGrowVal1 | ''f32'' | ''0x18'' | Stage growth is a multiplier of the maximum growth that will occur in a certain stage, as an example a chart such as this: Growth Stage 0 - Growth = 20 - 20% of the total scaling is reached at stage 0. Growth Stage 1 - Growth = 25 - 25% of the total scaling is reached at stage 1. Growth Stage 2 - Growth = 50 - 50% of the total scaling is reached at stage 2. Growth Stage 3 - Growth = 80 - 80% of the total scaling is reached at stage 3. Growth Stage 4 - Growth = 90 - 90% of the total scaling is reached at stage 4. As you can see, in this specific chart 100% is never reached, 100% could be reached if only the value of growth stage 4 was 100% This is not limited to 100% as an example growth stage 4 could reach 200%. The level cap of a growth stage is specified in the corresponding Stat Level Cap Field | |
| stageMaxGrowVal2 | ''f32'' | ''0x1c'' | Stage growth is a multiplier of the maximum growth that will occur in a certain stage, as an example a chart such as this: Growth Stage 0 - Growth = 20 - 20% of the total scaling is reached at stage 0. Growth Stage 1 - Growth = 25 - 25% of the total scaling is reached at stage 1. Growth Stage 2 - Growth = 50 - 50% of the total scaling is reached at stage 2. Growth Stage 3 - Growth = 80 - 80% of the total scaling is reached at stage 3. Growth Stage 4 - Growth = 90 - 90% of the total scaling is reached at stage 4. As you can see, in this specific chart 100% is never reached, 100% could be reached if only the value of growth stage 4 was 100% This is not limited to 100% as an example growth stage 4 could reach 200%. The level cap of a growth stage is specified in the corresponding Stat Level Cap Field | |
| stageMaxGrowVal3 | ''f32'' | ''0x20'' | Stage growth is a multiplier of the maximum growth that will occur in a certain stage, as an example a chart such as this: Growth Stage 0 - Growth = 20 - 20% of the total scaling is reached at stage 0. Growth Stage 1 - Growth = 25 - 25% of the total scaling is reached at stage 1. Growth Stage 2 - Growth = 50 - 50% of the total scaling is reached at stage 2. Growth Stage 3 - Growth = 80 - 80% of the total scaling is reached at stage 3. Growth Stage 4 - Growth = 90 - 90% of the total scaling is reached at stage 4. As you can see, in this specific chart 100% is never reached, 100% could be reached if only the value of growth stage 4 was 100% This is not limited to 100% as an example growth stage 4 could reach 200%. The level cap of a growth stage is specified in the corresponding Stat Level Cap Field | |
| stageMaxGrowVal4 | ''f32'' | ''0x24'' | Stage growth is a multiplier of the maximum growth that will occur in a certain stage, as an example a chart such as this: Growth Stage 0 - Growth = 20 - 20% of the total scaling is reached at stage 0. Growth Stage 1 - Growth = 25 - 25% of the total scaling is reached at stage 1. Growth Stage 2 - Growth = 50 - 50% of the total scaling is reached at stage 2. Growth Stage 3 - Growth = 80 - 80% of the total scaling is reached at stage 3. Growth Stage 4 - Growth = 90 - 90% of the total scaling is reached at stage 4. As you can see, in this specific chart 100% is never reached, 100% could be reached if only the value of growth stage 4 was 100% This is not limited to 100% as an example growth stage 4 could reach 200%. The level cap of a growth stage is specified in the corresponding Stat Level Cap Field | |
| adjPt_maxGrowVal0 | ''f32'' | ''0x28'' | Determines the exponent used to calculate the curve. The growth values are normalised to be between the level range and the growth range dictated, Such that: 0 level is the lower bound of the stage, and 1 level is the upper bound 0 growth is the lower bound of the stage, and 1 growth is the upper bound This curve is, at a value of 1, linear, meaning direct proportion between each stage. At a value of 2, it is quadratic (in fact, it will be flat exactly at 0, and have steepness 2 at 1) Note that a steepness of 2 means the growth per level is double the average growth per level. At a value of 0.5, it is a square root. Below 0, negative powers are not used as this would create asymptotes and infinite values. Instead, the axes are flipped. If you consider the graph 0 to 1 by 0 to 1, it is rotated 180 degrees. At a value of -1, it is linear again. At a value of -2, it is quadratic, however the origin is at the upper bound. Note this means there is a steepness of 2 at the lower bound and it is flat at the upper bound. At a value of -0.5, it is a square root graph again, but rotated 180. | |
| adjPt_maxGrowVal1 | ''f32'' | ''0x2c'' | Determines the exponent used to calculate the curve. The growth values are normalised to be between the level range and the growth range dictated, Such that: 0 level is the lower bound of the stage, and 1 level is the upper bound 0 growth is the lower bound of the stage, and 1 growth is the upper bound This curve is, at a value of 1, linear, meaning direct proportion between each stage. At a value of 2, it is quadratic (in fact, it will be flat exactly at 0, and have steepness 2 at 1) Note that a steepness of 2 means the growth per level is double the average growth per level. At a value of 0.5, it is a square root. Below 0, negative powers are not used as this would create asymptotes and infinite values. Instead, the axes are flipped. If you consider the graph 0 to 1 by 0 to 1, it is rotated 180 degrees. At a value of -1, it is linear again. At a value of -2, it is quadratic, however the origin is at the upper bound. Note this means there is a steepness of 2 at the lower bound and it is flat at the upper bound. At a value of -0.5, it is a square root graph again, but rotated 180. | |
| adjPt_maxGrowVal2 | ''f32'' | ''0x30'' | Determines the exponent used to calculate the curve. The growth values are normalised to be between the level range and the growth range dictated, Such that: 0 level is the lower bound of the stage, and 1 level is the upper bound 0 growth is the lower bound of the stage, and 1 growth is the upper bound This curve is, at a value of 1, linear, meaning direct proportion between each stage. At a value of 2, it is quadratic (in fact, it will be flat exactly at 0, and have steepness 2 at 1) Note that a steepness of 2 means the growth per level is double the average growth per level. At a value of 0.5, it is a square root. Below 0, negative powers are not used as this would create asymptotes and infinite values. Instead, the axes are flipped. If you consider the graph 0 to 1 by 0 to 1, it is rotated 180 degrees. At a value of -1, it is linear again. At a value of -2, it is quadratic, however the origin is at the upper bound. Note this means there is a steepness of 2 at the lower bound and it is flat at the upper bound. At a value of -0.5, it is a square root graph again, but rotated 180. | |
| adjPt_maxGrowVal3 | ''f32'' | ''0x34'' | Determines the exponent used to calculate the curve. The growth values are normalised to be between the level range and the growth range dictated, Such that: 0 level is the lower bound of the stage, and 1 level is the upper bound 0 growth is the lower bound of the stage, and 1 growth is the upper bound This curve is, at a value of 1, linear, meaning direct proportion between each stage. At a value of 2, it is quadratic (in fact, it will be flat exactly at 0, and have steepness 2 at 1) Note that a steepness of 2 means the growth per level is double the average growth per level. At a value of 0.5, it is a square root. Below 0, negative powers are not used as this would create asymptotes and infinite values. Instead, the axes are flipped. If you consider the graph 0 to 1 by 0 to 1, it is rotated 180 degrees. At a value of -1, it is linear again. At a value of -2, it is quadratic, however the origin is at the upper bound. Note this means there is a steepness of 2 at the lower bound and it is flat at the upper bound. At a value of -0.5, it is a square root graph again, but rotated 180. | |
| adjPt_maxGrowVal4 | ''f32'' | ''0x38'' | This value is not used. | |
| init_inclination_soul | ''f32'' | ''0x3c'' | Growth Soul Slope of the early graph 1 | |
| adjustment_value | ''f32'' | ''0x40'' | Growth soul Early soul adjustment 2 | |
| boundry_inclination_soul | ''f32'' | ''0x44'' | Affects the slope of the graph after the growth soul threshold 3 | |
| boundry_value | ''f32'' | ''0x48'' | Growth soul threshold t | |
| pad | ''dummy8'' | ''0x4c'' | | This field is padding. |