ID:943670
 
Hello BYOND Community, does anyone have ideas on how I could do the level/health/enemy stat calculations on my game? I'm not good with Math (even though it's basic math), I'm not good at deciding calculations concerning these things ;-; If you have good calculations, please post them I might use them your idea ;3
I would like to suggest something somewhat based around enemy difficulty. For example, rank your enemy mobs from a power level of 1-10.

The first power ranking(Level 1), the enemies falling into this rank would have +1/2 of the base(default) player health and their stats would be the same as someone just starting the game. Then, multiply each rankings' stats by 2 and their health keep remaining +1/2 of the average health of a character at the level needed to battle that enemy.

As for bosses, I would suggest making them excel in one(of a few similar[not all] stat(s)). Their health could be x2 of the health of a character at the level required to face that boss.
You could also use a formula that uses the level and base stats to determine what each stat is. It's best to try googling some formulas if you are having trouble. Look up the different types (Linear, exponential, cubic, etc) and find one that you like. Port it into your code and adjust it however you need to.
In response to Albro1
Albro1 wrote:
Look up the different types (Linear, exponential, cubic, etc)

What do you mean by this? I'm confused ;-;
Use a bone & organ system instead of health :D
In response to Flysbad
Growth formulas. Linear growth is like adding 2 to their health every level. Exponential would be like putting their current health to the power of 2 every level. Cubic is a bit more complicated. As I said before, use Google. It is your friend.
The best way I find is to look up games of similar genre's and see how they handle various mechanical formula's. You're going to be using very different mathematics with an RPG compared to a Shooter.
You can define what you want stats to be at few specific levels, for example: level 1 - 10 health, level 10 - 90 health, level 100 - 2000 health, then use polynomial interpolation, spline interpolation, or even kriging to create formula for these values.
Or... don't use math at all, handcraft the values for yourself:

var/global/list/experience_needed = list(50, 100, 175, 245, 350, 600, 790, ...)
A fully linear system is, I think, a good starting point. To simplify, let's say you have the following stats: level, experience, health, and strength. Both health and strength would be constants times level.

proc/MaxHealth(level)
return 10*level


proc/Strength(level)
return 4*level


Once you have a functional system, tweak is as seems appropriate until it feels right. My own preference is to have most stats grow linearly in level, except that experience needed to gain levels grows quadratically in level (to deter power-grinders). I use exponential functions rarely and think they might be better to avoid altogether.
The way I did it in the game, was....

Enemy Stats
src.Health = 25 * src.Level
src.Max_Health = src.Health
src.Strength = 3 * src.Level
src.Defense = 2 * src.Level
src.Gold = rand(50,75) * src.Level


Damage
var/Damage = round(src.Strength*2 - A.Defense/4) + rand(-3,5)


Level Up
src.Max_Experience += src.Level * 100


I feel like it's still not good enough ;/
We can't tell you what's good enough for your game. That's what you have to figure out to keep your game balanced. I might suggest taking a look at the mechanical calculations for World of Warcraft and Pokemon to see how the professional teams do it. You'll be amazed at the complexity of the calculations for such a simple childhood game like Pokemon.
No need to be complicated. Take the lowest stats a player can have at level one, and compare it to the highest possible stats of the highest level player.

How much difference do you want? How fast should the bigger player be able to kill the little player? Watch,
level 1;
life = 23
strength = 5
defense = 5

level 10 (highest)
life = 87
strength = 35
defense = 29

Let's say those are good for the major extremes, feels like it could be fairly balanced game-play. Write a formula,

(87-23)/10 = 6.4 life per level.
(35-5)/10 = 3 strength per level.

As for damage calculations, lets take 2 players who are both level 10. How fast can they kill each other with continuous attacking?

Lets say you want 10 seconds to be able to kill a level 10. They have (in theory) 87 health, so lets do 87/10 = 8.7 damage per second will be the maximum damage rate for the best weapon in the game.

Knowing that, you calculate and adjust for different weapons in the game, etc etc until you've built a fairly balanced environment. And then test it out! If its not what you like then tweak or scrap the entire system and start again.
Personally I prefer non traditional leveling.
Let's say you have an action game. Each time the character successfully hits another character, they gain exp towards leveling strength. Likewise the character who got struck gains experience towards gaining more HP.

This would require each attribute having it's own exp/tolevelexp vars.

More work but, very different.
Really the values that you put in there don't matter as much as their application, and balancing.

Using your calculation a level 1 enemy will have 25 hit points. But if a level 1 player is doing 0-1 damage per hit, that still takes 25 whacks to defeat the enemy, which might become tedious if all you are doing is waiting while your character auto-attacks the poor baddie once per second.

Pokemon relies heavily on damage types, resistances, and weaknesses. Many battles in those games are excruciatingly hard with one pokemon...but as soon as you switch to another pokemon you are getting one-hit KOs. I kinda like the way they set that up, because the battles involve a lot of strategy (and not just about which kind of attack, but what status effects you might want to use).
In response to Magicsofa
You're right that the main point is the effect of the values. How many hits something takes to die. However I would have to say the actual number values play a bigger part than we might realize.

A good example of this can be found in Runescape. Health in this game is handled by a player's constitution skill level. This skill level can be raised from 1 to 99. Back in the day the lowest amount an enemy could damage you for was 1.

It makes sense right? 0.4 damage is an icky number. People don't like decimals. We like whole numbers. However the developers of Runescape made an interesting change. What the developers wanted to do was to have a way of handling more values of damage without adding in decimals.

Their solution was simple. Health and Constitution were made separate. Now instead of having 40 Cons and so 40 Health. You now have 40 Cons and 400 health.

This also means that if before the change your maximum damage was 20, when you came back after the update your maximum damage was 200. Do remember though now that everything was increased by 10 times, including the health of everything else.

So.. To conclude this. I think players like variety ,predictability and correct scale in their statistics.

P.S
X/1000 might work well for Runescape but if you're someone making a game about star destroyers then talking about damage in terms of X/100,000 might better fit your environment.
In response to Red Hall Dev
0.4 damage is an icky number. People don't like decimals. We like whole numbers.

Here we go again, that's your opinion. I love decimals and there are a few games that use them for raising skills and the such.
In response to A.T.H.K
That's a bit aggressive? You have misunderstood what I said anyway. When I talked about decimals I was talking about them in the context of Runescape. In which case it's fact that axes doing 0.4 damage is not nice because it makes math related to combat harder.

Also this is backed up by the fact that I didn't make the decision for Runescape to change. The lead developers at Jagex did. Jagex being one of the most successful MMORPG developers of all time.

I'm sorry but saying I'm wrong is saying they are wrong. I disagree with Jagex sometimes but this idea was unquestionably the right thing to do.

I also just need to say that I said "correct scale in their statistics".

If correct scale in your current game is decimals then use them. But if your axe does 0.345 damage over 0.4 seconds while the sword does 0.642 over 0.242 seconds then you can see quite obviously decimals can become icky and tricky. Not greatly more all the time. There are ways of using decimals which are quite simple and like I said if you want to use that because it fits then go ahead but don't tell me people are annoyed at your game when you're using decimals and shouldn't be.
I think decimals would be particularly annoying in on-map damage numbers. Unless you put .00 after whole numbers, something like 12.34 looks very similar to 1234.

For stats it can be okay, as long as it's not too hard to understand what the number actually means. Internal numbers are a different story... for mathematical reasons it is often convenient to use values between 0 and 1.
I would find it strange that a game with whole number health would have decimals in their damage.
Page: 1 2