View Single Post
  #15  
Old 11-03-2010, 10:13 AM
MaroonMaurader MaroonMaurader is offline
Approved Member
 
Join Date: Jan 2010
Posts: 91
Default

Ok, here it is: the answer to all questions about how combat experience is gained. There are a few small points I had to make an educated guess about, but almost all of this is directly from the game files.

Experience gain after battles is controlled by a little function called arena.lua which is packaged into sessions.kfs. That function also handles gold earned from battles and a lot of record-keeping for end of game stats, and it might manage a few other things too (there are a few lines of code I wasn't too clear on). However, the basic formula is as follows:

experienceGained = [(total enemy leadership)*(leadership multiplier) + (boss experience)] * (1 + experience bonuses) * (enemy hero multiplier) * ("fake win" multiplier)

Total enemy leadership is the total pre-battle leadership of the enemy stack. It doesn't count summoned units, nor does it count the increase in leadership ghosts get from attacking, nor does it count anything else that might come up during the battle.

Boss experience is exactly what it looks like. Bosses are worth experience. You can read exactly how much if you want to check their .atom files in \data\data.kfs: 8000 for toad, 10000 for driller, 16000 for gremlion, 20000 for k'tahu, and 26000 for Baal.

The leadership multiplier is 0.017; you can find it in logic.txt in session.kfs. There's a little comment indicating that they might have thought it was actually 0.16, but I'm pretty sure that's not true - ivra's numbers don't add up if you use a 0.016 multiplier.

The experience bonuses are additive, not multiplicative. So a 20% leadership boost, plus a 5% boost from the medal, gives you (1 + .2 + .05) = 1.25 as a multiplier, not (1.2*1.05)=1.26.

The enemy hero multiplier is 1 if there is no enemy hero or if there is an enemy hero of level 0 (I'm not sure if this ever exists). Otherwise, it's 1.5 + 0.03*(enemy hero level); to give an example, a level-10 enemy hero boosts experience by a factor of (1.5 + 0.03*10) = 1.8.

I'm not totally sure what the "fake win" multiplier applies to, but I think it's for keeper battles (and maybe a few other weird battles?). It's 0.7 if your victory was a "fake win," and 1 if it was a normal win. You can check that too in logic.txt. Also, I'm pretty sure that gremlin towers in keeper battles don't give experience (their .atom files have no leadership entry and no experience entry, so I'm not sure where the game could get an experience value for them from).

Anyhow. I'm not sure how useful any of this information is, but I've been curious for a while about it so I went and looked into it, and now I figured I'd post it in case anyone else was curious.
Reply With Quote