quote:
Original post by rhuala killratio=EnemiesKilled/FriendliesKilled; ExperienceGained=Killratio*EnemiesKilled/100;
Division by zero if no casualties on hero side.
Anyway, is this a turn-based fight, or real time? If it''s turn-based, it may work OK, but if it''s real time, I doubt it would (at one instant, a division by zero may occur).
Current project: A puzzle game. % completed: ~0% Status: Active.
Why should you always give them zero experience when they retreat? If you think about it, many commander throughout history have only lived to be great because they knew when to retreat. As a matter of fact, knowing when to retreat could be considered knowledge gained from experience. How about a victory bonus?
Victory Bonus = some value determined at the start of the battle factored from the relative experience differences between the opponents such as differences in army size, unit strenth totals, experience levels of heroes and commanders -- this could actually turn out negative so you should have a floor of zero for it.
In my opinion, you should always get experience from a battle, no matter the size of the battle and whether you win or loose(or if it''s a draw). That said, of course a won battle should give more experience (in most cases).
The experience gained should depend on (you could have a billion of factors but these are the main ones I think):
Enemy strength before the battle - EA(Enemy Army). Enemy losses - EL. Your army before the battle - FA(Friendly Army). Your losses - FL(Friendly Losses) Hero level - HL
The formula could look something like this (this could be tweaked a great bit to get a good experience ''curve'' as someone else said):
Exp = 100*(EA*EL)/(FA*FL*HL)
This would mean that a hit-and-run attack on a larger army could give much experience even though you didn''t "win"(ie annihilate the enemy). It also means that if you beat another army that is smaller than yours or if you have a high-level hero you won''t get very much experience.
Oh well, just my thoughts.
"The whole problem with the world is that fools and fanatics are always so certain of themselves, but wiser people so full of doubts."
"The whole problem with the world is that fools and fanatics arealways so certain of themselves, but wiser people so full of doubts."