Jump to content
  • Advertisement
JoAndRoPo

Calculating Expierence - Logic? Formula?

Recommended Posts

Hi! 

How is XP calculated? For example, to reach level 4, the player should reach 200 XP and to reach level 5 player requires 450 XP. 

Is there a formula? Is there a tutorial available online? Any source where I can learn how XP is calculated?

Can you give me a simple example from any existing game where the XP increases whether the player wins or loses?

Thanks!

Share this post


Link to post
Share on other sites
Advertisement
Posted (edited)

Xp is is usually decided by the goal, design and testing of the game. There is no predefined rules, it is something that you keep working on as you advance.

Let's say for example you want the player to feel like each level is twice as powerful as the last:

A enemy gives 10XP and has 6HP. Player Damage: Lv1 1dmg, Lv2 2dmg, Lv3 4dmg, Lv4 8dmg. Exp needed follows the same pattern: Lv1 10xp, Lv2 20xp, Lv3 40xp, Lv4 80xp.

Lv1 player kills enemy in 6 hits, Lv2 3 hits, Lv3 2 hits -oops. Now my goal is messed up; I am not getting what i want. So I change the enemy HP to 8 because it is a power of two.

Lv1 8 hits, Lv2 4 hits, Lv3 2 hits, Lv4 1 hits.

 

Good so damage is what I want now, except when I test the game I notice something: Lv2 defeats 1 enemy to level. Lv3 2 enemies, Lv4 4 enemies, Lv5 8 enemies.

Meaning it took exactly the same amount of hits to reach level 2 as it took to reach level 5. This means I missed my goal, the player feels as weak as in the beginning.

 

This happened to me in one of my first RPG games, using larger and more complex numbers. Players felt that they weren't really leveling up. I fixed it by reducing the amount of XP needed for the next level. It was something that could only be fixed by testing what amount of XP felt right.

 

Maybe if you can tell us what the goal of leveling up is, for you, we can help you find a formula.

Edited by Scouting Ninja

Share this post


Link to post
Share on other sites
18 minutes ago, Scouting Ninja said:

Xp is is usually decided by the goal, design and testing of the game. There is no predefined rules, it is something that you keep working on as you advance.

Let's say for example you want the player to feel like each level is twice as powerful as the last:

A enemy gives 10XP and has 6HP. Player Damage: Lv1 1dmg, Lv2 2dmg, Lv3 4dmg, Lv4 8dmg. Exp needed follows the same pattern: Lv1 10xp, Lv2 20xp, Lv3 40xp, Lv4 80xp.

Lv1 player kills enemy in 6 hits, Lv2 3 hits, Lv3 2 hits -oops. Now my goal is messed up; I am not getting what i want. So I change the enemy HP to 8 because it is a power of two.

Lv1 8 hits, Lv2 4 hits, Lv3 2 hits, Lv4 1 hits.

 

Good so damage is what I want now, except when I test the game I notice something: Lv1 defeats 1 enemy to level. Lv2 2 enemies, Lv3 4 enemies, Lv4 8 enemies.

Meaning it took exactly the same amount of hits to reach level 1 as it took to reach level 4. This means I missed my goal, the player feels as weak as in the beginning.

 

This happened to me in one of my first RPG games, using larger and more complex numbers. Players felt that they weren't really leveling up. I fixed it by reducing the amount of XP needed for the next level. It was something that could only be fixed by testing what amount of XP felt right.

 

Maybe if you can tell us what the goal of leveling up is, for you, we can help you find a formula.

Hi Scouting Ninja, Thanks for replying... 

I'm creating a card game (something like spider solitaire) where the XP increases whether the player wins or loses the game. After the player reaches the XP target, the player is rewarded. The next XP target is displayed that the player should reach, which is more than the previous target. 

I don't think the game I'm creating is that complex. But I would like to learn/study if there are any tips/tricks I should know about.

Share this post


Link to post
Share on other sites
42 minutes ago, JoAndRoPo said:

After the player reaches the XP target, the player is rewarded.

The XP system you are looking for is one based on skinner box principles. A kind of award system that pushes the player to play more. You can search "skinner box"

Remember skinner box mechanics isn't evil, however if abused can be used to cause harm. As a developer harming your players is like poisoning your own game. You should read up on skinner box tricks as well as how to avoid the pains of implementing skinner box mechanics.

Resources: https://gamedevelopment.tutsplus.com/articles/numbers-getting-bigger-the-design-and-math-of-incremental-games--cms-24023

https://blog.kongregate.com/the-math-of-idle-games-part-i/

 

The two links shows some case studies as graphs. You will want to graph between min and max XP, that shows how player reward and costs are related. Also learn what you can about difficulty curves.

The key is to steadily increase the difficulty of leveling up. As humans we actually enjoy this, because in the real world the more we progress, the harder it gets to progress more. Our brains reward us for pushing that little bit more to reach the next goal.

 

In your case, how many games a player has to play before leveling up. This you will want to compare against how many times a average person can play per day.

Lets take the basic formula from the first link: 1.4 games = 0.7 levels and 1.7 games = 1.2 levels. Using this we can see that the player should either level up +/- 50% into the second game or level up after the second game.

 

Take a look at the case studies. Do your research and see what you think will work best for your game. There is a lot of studies on incremental systems to read on the net. I recommend: https://www.academia.edu/

Share this post


Link to post
Share on other sites

A solitaire card game doesn't lend itself to the scaling considerations involved in the traditional RPG feedback loop between character level, player stats, enemy toughness, XP gained per enemy and XP needed per level: the challenge of an "encounter" and the rate at which the player defeats them are fundamentally constant. A higher level player is as strong as a low level one.

Instead of earning pointless levels, experience can instead give the player purely ornamental trophies like special card decks or consumable "items" (peek at a card, swap cards, etc.).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!