Experience Gain

Started by
7 comments, last by Fournicolas 18 years, 5 months ago
I'm not quite sure if this belongs in the math forum.... the game programming forum... or here. I guess I'll find out if a moderator decides to move it. At any rate, I'm building a Mud in which a combat unit gains experience (via combat) in proportion to 3 different factors. They are 1) the units wisdom, 2) number of attack turns the player uses, 3) the relative rank/expereince of the army you're attacking. I'm having trouble with the last one, but let me give some background info first. Wisdom is a trainable aspect of all combat units. It does not assist the unit in battle (as all the other trainable skills do), but it determines how much exp the unit gets post battle. Its good to have lots of wisdom as higher level units 'can' be more powerful, plus it keeps training costs down. Attack turns are generated 2 per hour and are considered a kind of currency (since this game is turn based, turns can be quite valuable). The more you use attacking someone, the higher the payback (in fact, the payback is exponential). However, if you use a bunch of turns and lose the battle, you're pretty much screwed for the day. The last factor of ranking (my rank vs. the enemies rank) should let a unit gain additional exp if he wins vs. a higher ranked opponent. Conversely, a higher ranked player should get a lower exp yield for attacking down. I wanted to do it this way to help prevent bottom feeding as well as letting late joiners to the game have a chance of catching up. But... I'm not sure how to factor it in. So far, the equation is exp_gain = wisdom * turns ^ (1.5)... but thats all I've got. Any ideas would be appreciated.
Advertisement
To further facilitate the "catch-up" and reduce the "bottom-feeding", why not award XP for battles lost as well? With the turns factored in, you get XP for "hanging in there" against a far more powerful opposing force.

As to working out how differences in level will affect XP, I don' tthink I can contribute anything worthwhile without knowing more about your system. Will you have numerically designated levels? Level 10 vs. Level 57 is different that 39827 XP versus 84749 XP.

I liked the system Tactics Ogre used, where you got XP per action, so if you manage to hit a guy six levels ahead of you, you get forty XP, but you can beat on a guy six levels below you all day long and only get a few dozen.
Actually, your post is exactly the type of thing I was looking for. I've been playing with the numbers for quite a while, and its given me a BIG headache trying to determine how to balance everything (and if I wrote the game, and I can't get a good grasp on it... I'm sure no one else can do much better). I could post a link to an excel spread sheet that would let you play around with how all the stats effect combat... but I really doubt it would help. So, I'm more or less looking for ideas as to how to approach it.

Anyways, the only thing I don't like about giving EXP even if you lose is that if 1000's of people decided to gang up on one guy, he'd suddenly (and almost over night) become the strongest player in the game. If somone were to register multiple accounts (and there is a lot I can do to help prevent it, but I don't believe there is any way of stopping it completely), it would make cheating in that mannor a lot more powerful.

So... that leaves me sorta back where I started. For the sake of discussion, the formula for experience is $LvL * ($LvL + 1) * 50. Thus, a level 1 unit would have a minimum exp of 100, a level 2 unit would have a minimum exp of 150, a level 3 unit would have a minimum exp of 600... etc. My last attempt at solving this delimma was to use the function:

$ExpMod = pow($DefenderExp / $AttackerExp, .5);

Thus, if the defender had 4 times the experience you did, you'd get 2x experience whereas if the defender had 1/4 the exp you did, you'd get 1/2x exp. I"m just not 100% happy with it though.
Anonymous Poster... what the heck? Guess I got logged out somehow.
Just to clarify, it takes more XP to reach level 1 (0-100) than to reach level 2 (100-150)?

To refer back to Tactics Ogre, they abandoned the notion of cumulative XP, and used a percentage scale instead. You always needed 100 XP between levels; it just got tougher to get them.

I don't remember the math, but it was something like this: If he was above you, you got ten XP for each level difference. So if he's one above you, you get ten XP per hit. If he's ten levels above you and you manage to hit him, it's an instant level up. If he's your equal, it's 5 XP. For each level below you he is, it's one less, so you get 4 XP for a guy one level below you, 3, 2, or 1. 1 XP is the minimum, so it's possible to level by fighting peons, but it's unbearably tedious.

It would be a simple matter to modify this rudimentary system to take your Wisdom stat into account, and to balance it such that it would fit with your game's style. In TO, it wasn't uncommon for a character to only get three or four moves in a twenty minute battle, due to the size of the teams and the need to move without acting sometimes. If yours will have more action, then you'll probably want to award smaller bites of XP.

Good luck.
I played Ogre Battle, but not Ogre Tactics... its one of my more favorite RTS. Ironically, the Mud I'm building was partially inspired by that game.

And just to clarify the level thing... each unit starts with 50 exp. So.. a level 1 unit starts with 50 exp and needs 150 exp to reach level 2. A level 2 unit starts with 150 exp and needs 600 exp to reach level 3. A level 4 unit starts at 1000... etc.

Anyways, I'm going to try the 'exp based on level' thing to see how it plays out. But the more I talk/think about it, the more I feel like I need to go back and rethink my entire system. At least I'll have pleanty of things to do this weekend....

[Edited by - Cygnus_X on October 22, 2005 12:30:56 AM]
Here's how the exp system I'm thinking of using works. Instead of having each level needing progressively more exp to level up, each level needs the same amount of exp to level up. Each monster you kill will give you it's total exp divided by the amount of damage your highest damage hit did.
The reasons I'm thinking of using using this is to make the game more balanced for characters who want to play as characters that excel in non-battle skills and can then more easily level up, and after defeating an enemy that took you a lot of work to defeat you're more rewarded by it.

If you're a rogue at a certain level and a warrior at the same level can easily get more exp, from monsters that will give you both the same exp, because of his much higher strength, it can be a little frustrating.

Also if you take down 'Oh Nos Super Dragon X!' through lots of skill and it's a lot of effort, you should be more rewarded than if you just stomped in with your massive strength stats and killed it in one hit.
Hmm... thats actually a pretty good idea. I'm going to have to put some thought into how that would play out in my game.... thanks.



Well, look at it this way: You DO get rewarded for each action that you DO, no the ones you trigger.
The game I am working on currently has no "character level" as a whole, but the levels are put back on each ability, which means that, a little like in Morrowind, whenevre you use an ability, you gain experience for that ability only. And through gaining points in abilities, you gain some basic points in stats, which retro-affect everything (a sort of circular movement for exp, only not in the usual sense)
SO what I did was to give XP according to, both the difference between some abilities levels, and to limit the number of characters being able to gang up on someone. Maximum four people are to gang up on any character, except for Troll-like creature, who are larger than most, and can receive up to six opponents at once.
But if you have, say, the "Hard-Boiled" ability, even receiving ablow will make you even more hard-boiled. The trouble is, once you DO get a blow, you are more likely to get another one, because it alters all your stats. It lowers your speed, it affects your strength, and it also slightly modifies your abilities, since your are a little knocked out. WHich means that to survive, you mainly need to EVADE combat, and report most of your skills on non-combat skills. It is still possible to create a combattant-only character, and to train him to be a tank. Only, this will leave the RolePlaying out of the game.

Think about overpowering someone. How many people can successfully land a blow on you, even if you are lying low? Four? Five at once? And what happns once you're knocked out? You don't get more XP for anything, because your brain is not connected to your body anymore. They can kee going on hitting you forver, whatever they may achieve is killing you, but never teaching you anything.

SO I adopted the opposite reasonning. You are rewarded for what you consciously do. Once in a while, you can get extremely lucky, but wil that luck affect the way you fight afterwards? I doubt it, since you won't even know what happened and made you lucky. So you calculate an average of damage, or of efficiency, or whatever have you, and decide the distribution of XP will be about the distance between this average and the dealt damage. You ponderate this with the difference of levels, and you get a formula which looks very much like :

((DamDealt-AvgDamage)*(Opponent's level/MyLevel)) = ExpGain

Whenever the result is under Zero, you gain either zero or one XP, meaning, you can keep killing rats forever, that won't make you much more proficient at fighting wolves or dragons, but will harden your arm, on the whole.
But on the other hand, successfully landing a blow on an opponent way stronger than yourself will be a reward in itself, because it may give you an insight into the next level of fighting.

You can also use the same formula, or slightly modified, to gain Experience through being beaten.

((DamReceived-AvgDamageReceived)*(Opponent's Level/MyLevel)) = ExpGain

Which means that if you keep fighting the same opponent, sooner or later, you'll end up receiving one XP for each blow it lands on you, and one for each blow you land on him. And you won't even get that if it's too low. A rookie coming and bashing your skull through potluck won't get you any XP, since you probably didn't see it coming anyway. Won't teach you anything. But a Giant Squid you've fought for hours on end, you've dodged for a while, and that finally smacks you, well, that's a smack you're going to remember for a while, and are less likely to reproduce.

But that's only me saying it. Here are my 0.02$...
Yours faithfully, Nicolas FOURNIALS

This topic is closed to new replies.

Advertisement