Template:Cts-solve

From Tales of Maj'Eyal
Jump to: navigation, search


This template is used to generate values for scaling which uses the combatTalentScale function. See also: Template:cts.

Format

{{cts-solve
|high=  
|low=
|t= 
|x_high= (default 5, optional)
|x_low= (default 1, optional)
|power= (default 0.5, optional)
|shift= (default 0, optional)
|add= (default 0, optional)
|digit= (default 0, optional)
}}

Use

When given a function of type:

combatTalentScale(t, 4, 15, 0.75, 1, 2, true)

These values map to:

combatTalentScale(t, low, high, power, shift, add)

And 'raw' or 'log' is not currently implemented. t is always the talent level value you want to generate the final result for!

Therefore, we can use the following:

combatTalentScale(t, 4, 15, 0.75, 1, 2) for t=3 is 11.86


Other parameters

x_low is the talent level for which we expect the result to be low, and defaults to 1

x_high is the talent level for which we expect to result to be high, and defaults to 5

digit defines the rounding of the final result. If digit=1, it will be rounded to the nearest whole number. Otherwise (if omitted), it will be rounded to two decimal places.

You should not usually need to override these.


Math

Input: power(=0), add(=0), shift(=0), x_low (=1), x_high(=5), low, high, (raw or log), t

Psuedo code for m:

  • m = (high - low) / ( (x_high+shift)^power - (x_low+shift)^power )
  • Expr for m: {{#expr:( ( {{{high|0}}} - {{{low|0}}} )/( ( {{{x_high|5}}} + {{{shift|0}}} )^ {{{power|0.5}}} - ( {{{x_low|1}}} + {{{shift|0}}} )^ {{{power|0.5}}} )) }}

Psuedo code for b:

  • b = low - m*(x_low+shift)^power
  • Expr for b (unexpanded): {{#expr:{{{low|0}}} - (m)*({{{xlow|1}}}+{{{shift|0}}})^{{{power|0.75}}} }}
  • Expr for b (expanded): {{#expr:{{{low|0}}} - ({{#expr:( ( {{{high|0}}} - {{{low|0}}} )/( ( {{{x_high|5}}} + {{{shift|0}}} )^ {{{power|0.5}}} - ( {{{x_low|1}}} + {{{shift|0}}} )^ {{{power|0.5}}} )) }} )*({{{x_low|1}}}+{{{shift|0}}})^{{{power|0.75}}} }}

Psuedo code for the whole thing:

  • Output = m * (t+shift)^power + b + add
  • Expr for output (unexpanded): (m)* {{#expr:({{{t|0}}}+{{{shift|0}}})^{{{power|0.5}}} }} + (b) + add
  • Expr for output (expanded): {{#expr: ({{#expr:( ( {{{high|0}}} - {{{low|0}}} )/( ( {{{x_high|5}}} + {{{shift|0}}} )^ {{{power|0.5}}} - ( {{{x_low|1}}} + {{{shift|0}}} )^ {{{power|0.5}}} )) }} ) * {{#expr:({{{t|0}}}+{{{shift|0}}})^{{{power|0.5}}} }} + ({{#expr:{{{low|0}}} - ({{#expr:( ( {{{high|0}}} - {{{low|0}}} )/( ( {{{x_high|5}}} + {{{shift|0}}} )^ {{{power|0.5}}} - ( {{{x_low|1}}} + {{{shift|0}}} )^ {{{power|0.5}}} )) }} ) *({{{x_low|1}}}+{{{shift|0}}})^{{{power|0.50}}} }}) + {{{add|0.5}}} }}