Experience scaled to losses/regeneration

What would you like to see in Freeciv? Do you have a good idea what should be improved or how?
Post Reply
Ignatus
Elite
Posts: 644
Joined: Mon Nov 06, 2017 12:05 pm
Location: St.Petersburg, Russia
Contact:

Experience scaled to losses/regeneration

Post by Ignatus »

An idea about how unit experience points would work, considering also non-lethal combat. Let's take into account that (a) when some soldiers of a unit die in battle, their knowledge is gone and (b) green recruits got as reinforcements on their place are not as experienced as soldiers that actually survived a battle.

Let experience got in a battle by unit with strength s against unit with strength s_e that took r rounds of fighting be proportional to r * s_e / (s + s_e). But if some rounds were lost and health h0 is reduced on Dh, some of this experience gets gone; moreover, a part of pre-existent experience E0 will be also lost. Considering that more experienced warriors survive more often, the experience after the battle

E1 = (h0 - k1 * Dh) * (E0 + r * s_e / (s + s_e))

where k1 is a coefficiency below 1.

Then, when a unit regenerates, let some experience be added by what the recruits have learned in barracks (warrior pits, their sandbox - city and player effects are to influence it), e per health point, and let more experienced soldiers teach something the less experienced. The formula involved should work mostly the same independent of how many turns were spent on the regeneration if the effects were the same. If no experience exchange is involved,

E2 = E1 + e * Dh

otherwise some exponents are going to soften the bitter.
Post Reply