Potential Rounding Issues with XP Split (Minatours + Archers)

XP from a Grunt or Archer = 4

This value is divided by the number demigods on the killing team in the area (conquest.lua:UnitKilled), and passed to HeroUnit.lua:GainExperience. There, that value is added to current XP and then floored.

So 3 demigods in the area = 1XP each, with 1XP total (.33 each) jettisoned into the void. That's probably not a big issue.
The slightly bigger issue is 5 demigods = 0 XP each due to the flooring. This is likely a very rare case, but it's something to look into for the future.

I came across this when I quadrupled the number of creeps (and quartered their XP and bounty, such that Grunt/Archer=1XP), and suddenly found myself not getting any XP when a friendly demigod was around. This lead to further code-delving into the exact mechanics.

5,866 views 11 replies
Reply #1 Top

Xp shouldn't even split like that imo..

 

With 2 people it should split like 75% each person.
With 3 people it should split like 66% per person.

 

Good point though on your post though.  If the xp didn't split linearly it wouldn't come up as much. :P

Reply #2 Top

Yea thats bad, perhaps they can have an exponetial curve (like above) or work on their math? Perhaps include the tenths decimal in the number, but not actually show it?

Reply #4 Top

I dont like the exp sharing.

My opinion is remove xp splitting but increase the xp needed to level, leveling is too fast.

Reply #5 Top

Leveling is fine as it is.  I've never played a game that I got past level 15.  From the posts that I've read here, that seems to be the case for most others as well.

Reply #6 Top

I think they should keep the amount of xp any given monster can give out at a set amount, like it is now, to keep the metagaming down.  If they're worth more exp as a total when killed by a team than an individual, it's wasting exp to fight alone.  In other words, if a team of 2 gets a combined total of 6 exp rather than 4, as suggested above, then forming such groups would give the players an unnatural advantage.  It would probably only be really relevant at the beginning where the enemies are essentially just free experience points though.

I can understand fewer experience points for large groups of players just because there's no risk or challenge involved.  Do 5 demigods all jumping one minotaur really deserve any kind of reward for such an effortless task?

I think the best solution is probably for the game to give the same amount of exp out for each monster, regardless of how many demigods were involved in the kill, and to divide that number as evenly as possible.  In 3 demigods vs 1 minotaur, if the game can do fractions of experience points, then 1 1/3 points to each, and if not, then 1 experience point to 2 demigods, and 2 experience points to the third.  They could have it go to the demigod who did the most damage, who got the killing blow, or just by picking one randomly.  I don't think the method of selecting who is awarded the extra point would be a big deal, since the game is supposed to be about teamwork anyway.

Reply #7 Top

Good catch.  This wouldn't even require a flooring math.  Assuming they are using something that handles math like c a simple float assigned to an int will result in the floor math.

 

Perhaps they need a float(yadayadayad) in the line.  If the xp of creeps is an int and # demigods is an int this will happen also.

 

No reason exp shouldn't be a simple single precision float.  There probably arn't that many calculations on it and I believe we all have a math coprocessor anyway.  We are only talking 1 command per kill and like 8 bytes of memory per game (to store the demigod values).

Reply #8 Top

Maybe the amount of experience should be based on the percentage of damage dealt to the creature times it's xp value. Keep the floating point, but only display the integer value of XP. That should eliminate any issues with XP.

Reply #9 Top

Quoting Insanetitan, reply 5
Leveling is fine as it is.  I've never played a game that I got past level 15.  From the posts that I've read here, that seems to be the case for most others as well.
End of Insanetitan's quote

a regular game always gets me to at least lvl 17 when most people are like 12 i wonder why this is

Reply #10 Top

Quoting Yakinasac, reply 7
Perhaps they need a float(yadayadayad) in the line.  If the xp of creeps is an int and # demigods is an int this will happen also.

 

No reason exp shouldn't be a simple single precision float.  There probably arn't that many calculations on it and I believe we all have a math coprocessor anyway.  We are only talking 1 command per kill and like 8 bytes of memory per game (to store the demigod values).
End of Yakinasac's quote

aye, all it is is 'local yadayadayad' and it's a float, or an int, or whatever you happen to give it. that's the beauty of Lua.

i actually think removing the floor from the code with do it perfectly, the only problem i could possibly forsee is with the experience bar (it directly pulls the experience off the hero, however it's rather robustly coded so it might weather the change anyhow).

*EDIT: OMG! i just got the edit button working.

Reply #11 Top

Thanks for bringing this up, there are changes coming that will make this a non-issue.