Calculating experience
Can someone give me hand with calculating a hero''s experience after a battle in a RPG game. Here''s the situation:
1 Hero enters battle with
500 Spearmen
200 Calvary
100 Archers
is fighting...
50 Spearmen
400 Calvary
200 Achers
and wins, the remains are say...
100 spearmen
10 calvary
10 archers.
Anyone have a good way to calculate a value for the Heros experice gained. should take into account how many men are left and how many were killed. If the Hero entered the battle with a huge army he should receive minimal exp. Thanks.
rhuala
Here''s an idea.
For every enemy you kill, you get a certain amount of experience. Make different enemies worth differing amounts of EXP.
That alone could do it, but if you want your losses to have an impact as well (to make it more interesting, I guess), deduct some experience per troop (yours) from what you get from above.
If your lost experience is more than gained, you just get zero experience.
Just some suggestions.
Grant Palin
For every enemy you kill, you get a certain amount of experience. Make different enemies worth differing amounts of EXP.
That alone could do it, but if you want your losses to have an impact as well (to make it more interesting, I guess), deduct some experience per troop (yours) from what you get from above.
If your lost experience is more than gained, you just get zero experience.
Just some suggestions.
Grant Palin
Grant Palin
Yeah, you can assign two experience values to each unit: one that is gained when you kill a unit of that type and one that is lost when you have a unit that type killed. You could also accumulate the experience for the battle as it is going on, and weight experience for each kill based on factors such as the experience value of the killed unit and that of the unit that killed it so that you get more experience when weaker units kill stronger units and vice versa. There could also be some minimum experience gained for winning the battle which you can either set in stone or come up with some system for determining it on a per battle basis.
---------------------------------------------------There are 10 kinds of people in the world:Those that understand binary, and those that dont...Mage
So your basically saying:
Exp= Total killed Enemy exp - Total Killed Friendly exp
So what if your hero fought 30 huge battles yet in each his units loss slightly more than his opponent, yet he won the battle. That would mean he still has zero experience and is equivalent to a rookie/newbie. You would think after 30 battle victories a hero would have become a better fighter/leader?
rhuala
Exp= Total killed Enemy exp - Total Killed Friendly exp
So what if your hero fought 30 huge battles yet in each his units loss slightly more than his opponent, yet he won the battle. That would mean he still has zero experience and is equivalent to a rookie/newbie. You would think after 30 battle victories a hero would have become a better fighter/leader?
rhuala
April 22, 2003 02:52 PM
Maybe frienly casualties only could decrease your hero''s moral, not exp...
So make the experience gained or lost from/by each enemy doubled or or tripled or whatever if you end up winning the battle, and halved if you end up losing.
unkn.Enigma1625
quote: Original post by Enigma1625
So make the experience gained or lost from/by each enemy doubled or or tripled or whatever if you end up winning the battle, and halved if you end up losing.
That''s a good idea. You could do that too.
Grant Palin
Grant Palin
Thanks for the suggestions, but...
If he loses he''s flat out dead or if he retreats I''ll give him zero exp. But if I double or triple experience from each dead enemy that could spiral his exp out of control having him gain way too much at times. I guess I could put a cap on the upper limit he could possibly gain. The other thing I''m worried about is in the mid-game stage having a new younger hero enter the game, command a huge army and then advance too fast, i.e. gaining 14 levels after one battle. This is the kind of ideas I have been tossing around all morning, just feels like I''m re-inventing the wheel. I was kind if hoping someone had a system with all the bugs ironed out that worked already, since this has been done many times before...
so far I''ve come up with this system:
killratio=EnemiesKilled/FriendliesKilled;
ExperienceGained=Killratio*EnemiesKilled/100;
Then I''m capping total levels gained to 3. Can never gain more than 3 levels at a time. This way the bigger the battle the more exp gained, but also the more efficent the battle (less friendlies lost the more exp gained).
If you see any major flaw or problems with this concept please let me know. Thanks...
rhuala
If he loses he''s flat out dead or if he retreats I''ll give him zero exp. But if I double or triple experience from each dead enemy that could spiral his exp out of control having him gain way too much at times. I guess I could put a cap on the upper limit he could possibly gain. The other thing I''m worried about is in the mid-game stage having a new younger hero enter the game, command a huge army and then advance too fast, i.e. gaining 14 levels after one battle. This is the kind of ideas I have been tossing around all morning, just feels like I''m re-inventing the wheel. I was kind if hoping someone had a system with all the bugs ironed out that worked already, since this has been done many times before...
so far I''ve come up with this system:
killratio=EnemiesKilled/FriendliesKilled;
ExperienceGained=Killratio*EnemiesKilled/100;
Then I''m capping total levels gained to 3. Can never gain more than 3 levels at a time. This way the bigger the battle the more exp gained, but also the more efficent the battle (less friendlies lost the more exp gained).
If you see any major flaw or problems with this concept please let me know. Thanks...
rhuala
You could have the size of the army the hero "commmands" count ie. when your army is half the size of the opposing army, and you win, your experience is doubled. Likewise, when your army is thrice the size of the other army, the exp. yu gain if you win is divded by three. This will discourage too big armies, and reward you if you''ve done well.
You could, instead of counting the units in the army, make knights count twice or something so that weak units have less influence than strong ones.
You could, instead of counting the units in the army, make knights count twice or something so that weak units have less influence than strong ones.
<< killratio=EnemiesKilled/FriendliesKilled;
ExperienceGained=Killratio*EnemiesKilled/100; >>
What I like to do when I come up with a formula for experience is plug it into my graphing calculator and see what kind of curve I get. In most games you want to have some sort of exponential growth system, where as you gain higher levels, it takes more experience points to gain another level. So with the above equation you could just plug in some numbers and see what kind of results you get until you''re satisfied.
ExperienceGained=Killratio*EnemiesKilled/100; >>
What I like to do when I come up with a formula for experience is plug it into my graphing calculator and see what kind of curve I get. In most games you want to have some sort of exponential growth system, where as you gain higher levels, it takes more experience points to gain another level. So with the above equation you could just plug in some numbers and see what kind of results you get until you''re satisfied.
unkn.Enigma1625
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement