lolet" wrote:Yes you're right about MMX, i wrote because i had seen a function calling IsProcessorFeaturePresent and i thought its checks if MMX is available but it checks PF_FLOATING_POINT_PRECISION_ERRATA.
Thanks a lot for reply, but are you sure it multiplies by 79? I work on 1.11b and there is
Code: Select all
PartyExp_6FC9DFD0+84 imul eax, esi
PartyExp_6FC9DFD0+87 imul eax, 59h
I don't think the code has changed since 1.10
yip, you'd be right, forgot about an extra multiplier early on:
Code: Select all
6FCC2E1A |. 0FAFCE IMUL ECX,ESI ; nExp * (nPlayers - 1)
6FCC2E1D |. 8D0489 LEA EAX,DWORD PTR DS:[ECX+ECX*4] ; (nExp * (nPlayers - 1)) * 5
6FCC2E20 |. 8D04C0 LEA EAX,DWORD PTR DS:[EAX+EAX*8] ; ((nExp * nPlayers) - 1) * 45
6FCC2E23 |. 03C0 ADD EAX,EAX ; ((nExp * nPlayers) - 1) * 90
6FCC2E25 |. 2BC1 SUB EAX,ECX ; ((nExp * nPlayers) - 1) * 89
I have tested your formula and exp is still too low. When I exp in party I get 1/3 of exp which I would gain out of party (8 players, every char has 90 lvl). I don't know is it a big difference if you exp 1/8 in vanilla?
you sure its cause your not messing up the percentage boni increases or something in D2GAME_GetExpGained? though IMO, just replaced D2's formula, its terrible, changed it to something way more simple.
Code: Select all
/*
Date: Tue Dec 08 08:26:20 2009
Author: Necrolis
Function: EXPERIENCE_CalculateDecay
Address:
Comments:
*/
int __fastcall EXPERIENCE_CalculateDecay(int nAttackerLevel, int nDefenderLevel)
{
if(nAttackerLevel == nDefenderLevel || nAttackerLevel == 1)
return 100;
int nDifferance = nAttackerLevel - nDefenderLevel;
if(nDifferance < EXPERIENCE_DECAY_START)
return 100;
return (nDifferance > 100 / EXPERIENCE_DECAY_AMOUNT) ? 0 : 100 - (nDifferance * EXPERIENCE_DECAY_AMOUNT);
}
/*
Date: Thu May 28 10:42:34 2009
Author: Necrolis
Function: EXPERIENCE_Calculate
Address: D2Game.0x6FCC2EC0
Comments: Highly Different
*/
DWORD __fastcall EXPERIENCE_Calculate(D2GameStrc* pGame, D2UnitStrc* pAttacker, int nAttackerLevel, int nDefenderLevel, DWORD dwExp)
{
if(pGame == NULL || pAttacker == NULL || nAttackerLevel < 1 || nDefenderLevel < 1 || dwExp == 0)
return EXPERIENCE_MIN_GAIN;
if(nAttackerLevel >= PLAYERS_GetMaxLevel(pAttacker))
return EXPERIENCE_MIN_GAIN;
int nRatio = PLAYERS_GetExperienceRatio(pAttacker,nAttackerLevel);
dwExp = INLINE_ApplyPercent(dwExp,100,EXPERIENCE_CalculateDecay(nAttackerLevel,nDefenderLevel));
return EXPERIENCE_Normalize((dwExp * nRatio) / 1024);
}
though ATM I give party members the full share of the exp that the killer gains, only adjusted for their level vs the defender level, gonna probably add a distance based decay to it when I revise it some time in the future