ID:1239761
 
Keywords: exp, formula, help, monster, stats
Currently I am stuck on what to do for Exp Formula and monster stats, so I came to the Design Philosophy to ask you guys how you go about it? So how would you guys about character exp formulas?

Character

-Exp: 0
-Exp Needed: ??

Levelup

-Exp */+ ???

And for monster stats?

Basic Slime
Strength: ?
Defense: ?
Accuracy: ?
Exp Give: ?
This is what I use, it's a smooth consistent curve I designed myself for exp. If the starting exp is too high, say maybe you'd like the starting exp at level 1 to be 950 instead of 1950 then add 1000 to that number at the end of the formula which is currently 15627. That basically tweaks where you start from.

Exp curves aren't too hard to make, the key is having some basic algebra skills, a graphing program like GeoGebra and the knowledge that ln()+ x^2.5 is the sort of curve used in games.

Level 99 : 1.85 Mill
Level 90 : 1.50 Mill
Level 80 : 1.14 Mill
Level 70 : 841,751
Level 60 : 598,501
Level 40 : 259,000
Level 30 : 150,750
Level 20 : 75,500
Level 10 : 27,250
Level 5 : 11,375
Level 1 : 1,950

mob
var
level = 1
nextExp = 0

proc
Calc_Next_Exp()
var/adjustedLevel = level + 25
nextExp = (log(sqrt(adjustedLevel * 2)) + adjustedLevel ** 3) - 15627
Why the numbers so high at start o_o?
In response to ImmeasurableHate
Actually you're right, here's a better version. Made this last night in a hurry lol.

        Calc_Next_Exp()
var/adjustedLevel = level + 14
nextExp = round(log(sqrt(adjustedLevel * 2)) + adjustedLevel ** 3) - 2745
Depends on how complex you want it.

You could do something like this though.

Levelup()
while(exp>=exp_needed)
exp-=exp_needed
//levelup
exp_needed=min(round(exp_needed*1.05),exp_needed+(level*50))
//this increases experience needed by 5%, or by the level times 50, whichever is the smallest number..
sleep(1)
In response to Dariuc
What's the exp like with that though?

Like have you tested it, does it have a good curve?
There's all kinds of ways you can go about this. Look up growth formulas and find one that suits you. I recommend exponential or cubic.
There is an alternative to exponentially increasing required EXP. Many games work on a base "100 / 1000 EXP levels up" but alter the EXP gain depending on the difficulty of the enemy.

An early enemy on a low-level character for example might give 25 EXP for a kill, 4 kills for a level up, but later on it might only give 3 EXP, 33ish kills for a level up.

There is several ways of setting this up, you could have a monster level variable that compares to a player level. A higher monster than player level gives more EXP, and a lower monster level gives less EXP.
In response to Acebloke
This actually holds a certain technical sense also, seen as you do have practical limits on your numbers that exponential growth hits much much more easily.
In response to Acebloke
If you ask me, this is how exp should be done. How much exp is 1 million? Is it a lot? Is it a little? Who knows unless you know how much exp a monster gives you.

The amount of exp needed and had is just a way for the player to see their progress towards the next level. It exists for this purpose only and is secondary to the actual exp system.

What you should be doing, is tracking how many kills is needed to level up. As an example, you make it so a monster gives you exp needed / 5 + 5 * level. At level 1 you need to kill 5 things, 10 at level 2 and so on.

After this, the amount of exp needed to level up doesn't really matter, it's a filler number and something as simple as 1000 * level would work.

Also if you ask me, you should keep numbers (relatively) small. I'm dumb and when I need 1,368,662,954 exp and a monster gives me 834,456 I cannot work out how many kills this is without a calculator.
Here's a litle something something, Stephen made it for me a while back. The numbers behind the "//" are some good scale/growth rates.. I tend to use (100, 68) often, it seems more reasonable. Just try it out, and you'll find something you like.

ExperienceCalculator
var/scale, growth

New(var/scale as num, var/growth as num)
src.scale = scale
src.growth = growth

proc/calculate_next_level_experience(var/current_level as num)
return scale + ((current_level - 1) * growth)



mob/verb
Test_XP(var/scale as num, var/growth as num)
set hidden = 1 //(1276, 83), (100, 68), (700, 68)
var/ExperienceCalculator/E = new(scale, growth), total = 0
src << text("<br>[] / []", scale, growth)
for(var/i in 1 to 20)
var/next = E.calculate_next_level_experience(i)
total += next
src << "Level [i]: Next level at [next], total currently [total]"
Usually, what I prefer to do is square the delta of the desired position, and multiply the product of the square against a specific endpoint.

Set up your arbitrary values:

max_level = 100
max_exp = 1000000

delta = (next_level)/(max_level)

exp_next = delta*delta*max_exp


This is more or less how the curve works:

2 = 400xp
3 = 900xp
4 = 1600xp
5 = 2500xp
10 = 10,000xp
20 = 40,000xp
30 = 90,000xp
40 = 160,000xp
50 = 250,000xp
75 = 562,500xp
99 = 980,100xp
100 = 1,000,000xp
In response to Ter13
Very nice concept Ter, I like it. Simple but effective, a nice curve.

Props man, that's good.
Thanks, Zecronious.

Another thing here. You can modulate curves pretty easily.

The exponential curve does really well for experience systems, but isn't really suited for stat systems due to the massive gains between levels.

Let's talk about modulating curves for a minute.

Linear curves are kind of boring for stat systems, but square curves are a bit harsh on your lowbies. So, let's combine the two in a stat system:

max_level = 100
str_max = 500


Let's get our delta:

delta = next_lvl/max_level

Now, let's look at a linear, and a square curve:

square = delta*delta
linear = delta

Okay, so how do we smooth them out? Well, we average them, of course!

smooth = (square + linear)/2

Now, we have a slightly more linear curve.


Want it a bit more linear?

smooth = (square + linear*x)/(x+1)


Want it a bit more square?

smooth = (square*x + linear)/(x+1)


The above two iterations use x as the number of times you want the square or linear to have more dominance than the other.


A simpler equation to get your curve:

x = square weight
y = linear weight
curve = (delta*delta*x + delta*y)/(x+y)

Alright, so now we've got our curve reigned in a little bit, but still a little more interesting than a linear curve.

Red = Linear
Blue = Square
Green = Modulated 1:1

Your confusing me..
I think we found what Ter loves, he is soaking this up :p

on another note very nice formulas ter might even use them
There's most certainly no doubt. Ter is very good with his math.
Now just make it in terms i can understand
In response to ImmeasurableHate
ImmeasurableHate wrote:
Now just make it in terms i can understand

I have the same problem.. lol.
In response to Ter13
Very cool, no I get you. This math isn't really very difficult but I found I needed to write it down and do the simplification that way.

Good ways to adjust it. It's basically just playing around with what part of the function is dominant when and how you can make one part more or less dominant.

The way I make my functions for exp curves is in a graphical program and I adjust it using different techniques until it's just the right shape then I take a slice of it. To take the slice I don't start from x = 0, I use something like x = 25 and go to x = 124 for 99 levels.

It's more complicated than what you're doing so it's nice to have a more simple approach.
Page: 1 2