View Single Post
  #12  
Old 07-10-2009, 11:27 AM
Shendare
Dragon
 
Join Date: Apr 2009
Location: California
Posts: 814
Default

The XP formula in EQEmu appears to be (Level - 1) cubed times LevelMod times 1000.

Level mod above 60 is 3.1.

So, Experience to get to the cap levels would be:

88: (87*87*87)*3.1*1000 = 2,041,359,300
89: (88*88*88)*3.1*1000 = 2,112,563,200
90: (89*89*89)*3.1*1000 = 2,185,403,900

The maximum value for a signed int32 is 2,147,483,648, about halfway between 89 and 90.

It looks to me like something in exp.cpp is using a signed int32 in its experience calculations.

I checked Client::AddExp(), Client::SetExp(), Group::SplitExp(), Raid::SplitExp(), and NPC::Death(), and didn't find an sint32 reference in any of them.

I thought at first there was a problem because I was seeing references to uint32 and int32, and assumed int32 was a signed int32, but I was mistaken. int32 and uint32 are both typedefs of unsigned int, according to common/types.h.

So further investigation will be necessary.

This unrelated code in SetExp, however, may need a review:

File: exp.cpp, Line 212 - SetExp()
Code:
	//check_level represents the level we should be when we have
	//this ammount of exp (once these loops complete)
	int16 check_level = GetLevel()+1;
	//see if we gained any levels
	while (set_exp >= GetEXPForLevel(check_level)) {
		check_level++;
		if (check_level > 127) {	//hard level cap
			check_level = 127;
			break;
		}
	}
- Shendare
Reply With Quote