Hi there, today generated xp requirements for hero level based on formula i found
I found it here
You must be registered to see links
The output looks like that :
You must be registered to see links
I'm quite sure that this is correct? if not please correct me. gonna work on points and levels today.
EDIT 1
Doesn't matter anymore, added auto calculations for xp and level no need predefined data anymore.
algorithms are.
Hero xp for level
And hero level from XP
And tested, everything works on live version.
EDIT 2
Added hero points interface (it's custom not like in real travian i know..) since all i do is from scratch understand me either. ;D (can't find the regeneration formula tho...)
Here is explanations of each column. (just note here, the calculations on websites shows that hero stats calculated + 0.02% after each upgrade based on value before, not from base value only. i don't know this...let me know if that's how it works, thanks !
- bonus - Bonus type
- value - current points spend on this upgrade
- modifier - current troop value (already modified by % of points spend)
- action - obvious.
Code:
$calculateOff = $basePoints['attack_value'] + $this->data['hero_off'] / 0.02;
$calculateDeffInfantry = $basePoints['defense_infantry'] + $this->data['hero_deff'] / 0.02;
$calculateDeffCavalry = $basePoints['defense_cavalry'] + $this->data['hero_deff'] / 0.02;
$calculateOffBonus = $this->data['hero_off_bonus'] * 0.02;
$calculateDeffBonus = $this->data['hero_deff_bonus'] * 0.02;
Not sure about one thing tho, based on values here :
You must be registered to see links
level 0 hero has all values already increased by 0.2% at least for attack and defense. not sure if that's the correct way of hero handling.
Also thinking about adding additional config for high speed servers to mutltiply hero experience requirements for level by following algorithm.
Code:
NeedXP = (50Level*(level+1)) * (serverSpeed / 10);
basically, it won't increase the exp requirements for slow servers such as 1-10 x , but after it will go up more and more. for example at 1000x server XP for level 1 hero goes up to
10.000 up from 100. that's equal to level 14 hero experience by default values. What do you think guys?