#xp and level stuff

1 messages · Page 1 of 1 (latest)

twin forum
#

so this is how I currently get the totalxp needed to get a level:

int Base = LV * (100 * LV);
        float B = Base;
        B /= 980100;
        float L = LV;
        B *= 250 * (L * 100);
        float bBase = Base;
        bBase = bBase + B;
        Base = Mathf.RoundToInt(bBase);
edgy sage
#

You're doing some weird stuff I don't really follow. Why not just have an int for currentExp, another for expToLevel, and reset currentExp when you level, and raise expToLevel?

#
// When you level
expToLevel = someMethod(level);
int someMethod(int inputLevel){
  return inputLevel*1.1; //exponential
}
twin forum
#

I've probably overcomplicated things, but this is what my.. weirdness looks like graphed atm

#

it's because I'm trying to make it exponential, but also not jump too quickly. if that makes sense.
I've been having difficulty balancing this

edgy sage
#

Yeah, just incrementing expToLevel like that should yield a curve like that

#

Just vary how you generate them via someMethod

twin forum
#

my current calculation thingy is happening inside a function called XPNeeded. where it passes LV as the argument

#

there's a bunch of different stats

edgy sage
#

Yeah basically sounds like what I'm suggesting, varying XPNeeded will give you the exponential exp you want

twin forum
#

I get the xp to level by taking the totalxp and subtracting the total XPNeeded for the next level

#

for example, if I need 5000 xp for level 10 [from level 1], and I have 4000 xp at level 9, the xp to level is 1000.

#

but the xpneeded for level 10 would be 5000

#

not 1000

#

maybe I'm going about this the wrong way but this is how I've been doing it so far lol

#

in case I was confusing: I'm wanting to change how the totalxp to a level is calculated
[ie from level 1 to level X = how much xp]. the xp per level is simply the result of the total

edgy sage
#

Yeah, I'm saying scrap all that, total exp sounds like a pain to deal with to me /shrug

#

CurrentExp, ExpToLevel, all you need it seems

tawdry slate
#

you could make it easy and just use an animation curve. that way, you can create/control the curve for experience and use that instead calculating a formula . . .

twin forum
#

wait what? that sounds incredible. how do I do this exactly? @tawdry slate I have never heard of this until now

edgy sage
#

Yeah, curves sound perfect for this. Evaluate the curve per level

tawdry slate
#

this is an animation curve, the same you'd use for any type of growth . . .

tawdry slate
#

the only difference is you need to scale the value received from the curve . . .

#

since the value is from 0-1 (vertical). the 0-1 (horizontal) is the level; that's easy to convert . . .

edgy sage
#

Something along the lines of float ExpToLevel = curve.Evaluate(currentLevel/MaxLevel)*someBaseAmountofExp;

#

Or some calculation to achieve a perfectly curved total exp like I think you're wanting. Depends which value you want to curve, total exp or exp to level, or both I guess

low garnet
#

probably best to create your custom curve inspector, with base exponential, and weights that deform the curve,