Sunday, December 29, 2019

game design - How to implement an experience system?


I'm currently writing a small game that is based on earning experience when killing enemies. As usual, each level requires more experience gain than the level before, and on higher levels, killing enemies awards more experience.



But I have a problem balancing this system. Are there any prebuilt algorithms that help to calculate how the experience curve required for each level should look like? And how much experience an average enemy on a specific level should provide?



Answer



You would want some kind of exponential curve, probably something like:


base_xp * (level_to_get ^ factor)

base_xp is a constant that decides how much xp you need to go up a level.
level_to_get is the level you are aiming for; at level 1, this will be level 2.
factor is another constant that decides how much of an increase of xp you need for each level.


Having a base_xp of 200 and a factor of, say, 2 gives something like this:


enter image description here



Whereas a base_xp of 50 and a factor of 2.6 gives:


enter image description here


The second has a much lower starting xp rate, but you need more xp very quickly.


As for monster xp, this is something you want to test. Try out various values. You want something that is not too high (you'll quickly become overpowered) yet not too low (players don't want to grind). Think about how many 'standard' enemies you would want the player to kill for level 10->11, for example.


No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...