Public Group

# Mathematical system for experience

This topic is 4336 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

First of all, Thank you very much for reading. Okay, I usually use OpenGL for making games, but by the request of a younger sibling I am making a text RPG as a birthday present. Sadly games I have made are games such as, pong, tetris, side scroller ( Super Mario type). Sadly I've been afraid to delve into RPG's of any type strictly because of complexity. Which brings me to my only problem, What would be a good way to create a Experience system. I have toyed with this for hours, and the most I get is that it works for the early level ( 1-45 ), but gets out of hand at high levels ( 45+ ). I use the C++ language. Thank you very much for your help.

##### Share on other sites
Can you describe what system you've come up with? Why does it get out of hand after level 45? I've never really dealt with experience systems myself, but I think they generally scale exponentially, so higher levels are going to be dealing with large amounts of experience no matter what you do, unless you come up with something really out of the ordinary.

##### Share on other sites
One systems which usually works quite well is just to take the triangular numbers times some constant factor. That makes sure that for each level the player has to get the same amount of experience as in the last level, plus the constant factor. For instance if you have 100 as the constant factor you'd get 100, 300, 600, 1000, 1500, 2100, 2800, 3600, 4500, 5500, etc.

It can be determined with, c*n*(n+1)/2, where n is the level and c is the constant factor.

Of course the system used will depend on the game mechanics and design.

##### Share on other sites
What is your objective? Spending a fixed amount of time on each level, or making the higher levels more difficult to achieve?

The general solution is to classify all experience-giving actions (killing monsters, resolving quests and so on), and determine for each level the frequency of that action (mostly based on difficulty and design considerations). How frequently will a 4-th level character be bashing a fluffy rodent? What about a rampaging murderous demon-lich?

Let N(action,level) be the number of times that an action is performed on a level, on average, for an hour, T(level) the time (in hours) to be spent at a given level on average, XP(level) the experience required to move on to the next level, and XP(action) the experience gained from an action. Then, using the expectation of experience gain:

∀ level, XP(level) / T(level) = (Σ N(action,level) XP(action)) / (Σ N(action,level))

The bold values are the variables which you need to solve for. OLS minimization would generally give you good results, and it can be automated.

T(level) should be straightforward to decide on (same duration? longer durations for higher levels?), but the difficulty resides in the N(action,level). The form I use for this is:

F(action,level) / D(action,level)

Where F(action,level) is the physical frequency at which the action can be performed at a given level during an hour (including going back to town to replenish, finding the monster, going after it, and so on), and D(action,level) is the design component for doing this action at a given level. The higher the design component, the higher the experience received from the action. In the basic situation where D = 1 in all situations, the player will be able to grind at fluffy rabbits at level 45 and still get his level as fast as he would by killing deadly dreadful demons. So, when you want to prevent the player from doing things they shouldn't, you reduce D. Example values: 1 when the player should be doing this, 0.5 when the player should probably move on to something else, 0.1 when the player should really be doing something else, 0.01 when doing this is beyond unacceptable.

##### Share on other sites
The idea I have in mind is based on character level depends on the amount of experience received from any action. Such a quest meant for a level 1 that is completed at level 10 will have rewarded exp degraded. Or a level 50 killing a level 20 will receive little if any experience. The system I was using was similar to that CTar replied with but, my constant value did not remain contant it changed according to game situation, but taking out that modification it worked, but as ToohrVyk stated that will not work in the sense that I need it to.

##### Share on other sites
The first thing I always consider when using experience rewards is how the rest of the game will scale against the character's level. Does the difficulty of encounters increase as level increases? Though it may be complex, making this happen would be a great equalizer for any level character, since some players will simply play through the game while others might spend a lot of time leveling their characters between encounters.

If you want ideas on balancing encouters with character level, go to a local book store and buy a D&D Dungeon Master's Guide, and perhaps a Monster Manual. Both books have a solid set of rules (and ideas for customization) for scaling encounters, as well as an XP scale that scales exponentially. While it might not be what you're looking for, it will at least give you an idea of how balancing any RPG can be done.

##### Share on other sites
Thank you I will take that into consideration.

##### Share on other sites
Quote:
 Original post by CTarOne systems which usually works quite well is just to take the triangular numbers times some constant factor. That makes sure that for each level the player has to get the same amount of experience as in the last level, plus the constant factor. For instance if you have 100 as the constant factor you'd get 100, 300, 600, 1000, 1500, 2100, 2800, 3600, 4500, 5500, etc.It can be determined with, c*n*(n+1)/2, where n is the level and c is the constant factor.Of course the system used will depend on the game mechanics and design.

So it's basically a formula in n2, where n is the level. I'm not sure what you try to achieve here - ToohrVyk's post might be helpfull.

If you want to go the D&D way, make sure to understand a basic of the game: the xp reward for the exact same creature varies in function of your own level (to simulate the fact that a weak creature is not likely to hurt you when you are powefull, so you won't gain much by facing it. In the same time, the xp progression is linear (the exact formula is xp(n) = xp(n-1) + (n-1)*100, with xp(1) = 0 (you begin at level 1)) and the number of actions you need to perform (fighting monsters that are roughly of the same level than you) is nearly constant IIRC. The result is that the progression goes quite fast, because you often challenge creatures/characters that makes you earn a lot of xp. A fast progression means that you have to cap it to a small value, otherwise you go in the land of the Uncontrolled Gros Billisme(1).

Alternatives is to use a system which is similar to the one used in Morrowind or Oblivion (it's more or less a refinment of the Basic System from Chaosium: when you success, the used competence is raised by a small amount. In Morrowing/Oblivion, this small amount (roughly 0.1 point) decreases when the competence is higher. In the Chaosium system where competences goes from 1 to 100, the small amount (1d6) is computed once, at the end of the game (if you survived), but is only added if you roll a d100 which is greater than the competence (which would be a failure during the game)). As a consequence, the higher you are, the better you'll succeed, but the harder it will be to progress. Such system is naturally capped.

There are multiple other scheme you could use. But the biggest threat to your game will be balancing this experience management, invention being the easy part.

(1) "Gros Bill" was one of the early French role player. He used to overmax his characters in a way that you wouldn't believe. He is the kind of guy who could have said "I killed all the Gods in the Deities & Demi-Gods; when will number 2 be out?".

##### Share on other sites
Quote:
 Original post by Emmanuel Deloget(the exact formula is xp(n) = xp(n-1) + (n-1)*100, with xp(1) = 0 (you begin at level 1))

Isn't it illegal to mention this formula?

Quote:
 (1) "Gros Bill" was one of the early French role player. He used to overmax his characters in a way that you wouldn't believe. He is the kind of guy who could have said "I killed all the Gods in the Deities & Demi-Gods; when will number 2 be out?".

And he was a student at my current school (École normale supérieure), he's some kind of legend around here. The english version of this is a munchkin.

1. 1
2. 2
3. 3
Rutin
12
4. 4
5. 5

• 26
• 10
• 9
• 9
• 11
• ### Forum Statistics

• Total Topics
633695
• Total Posts
3013385
×