   Exp Question
  So I have an EXP equation thing here. I want peoples opinion about it.It is written in PHP<?PHPfor($currentLvl=50;$currentLvl<=100;$currentLvl++) {$randMax = $currentLvl*10;$randMin = $currentLvl*5;$randNum = rand($randMin,$randMax);$exp = $currentLvl * $currentLvl + $randNum / 5 * 10;echo "Level: ".$currentLvl." Exp Needed to next Lvl:".number_format($exp)."<br />";}?>The EXP is suppose to be random so that LVL exp is never the same.I was wondering what everyone else thinks about the equation and if they have any suggestions.One more thing, The level cap is 99999 and the EXP will be pretty high.   
  I don't know PHP, but:If this is the total XP needed t level, why make it random?If this is XP earned per kill, it doesnt take into account the enemies level, meaning killing a lvl 1 and killing a lvl 1000 yields the same XP regardless of your level, correct?Random XP just seem pointless to me, especially since its exponential, meaning the XP from level 999 to 1000 could be 24,960,015 or 99,820,080, a VERY significant difference.[Edited by - ZER0 C00L on September 6, 2010 1:12:46 AM];  No no. The enemy will also have a random amount of exp to give to attacking players. The randomness will allow for more chances to need less exp than normal to level next time around. The equation you see is only the basic form. There will soon be multipliers depending on how the battles go.   ;Quote:Original post by drseuss<?PHPfor($currentLvl=50;$currentLvl<=100;$currentLvl++) {$randMax = $currentLvl*10;$randMin = $currentLvl*5;$randNum = rand($randMin,$randMax);$exp = $currentLvl * $currentLvl + $randNum / 5 * 10;}?>I think you're going to get strange / unwanted behaviour when the target for level N plus 1 happens to be lower than the target for level N.  e.g. if I've got the order of evaluation right: - target for level 99 could be 99 * 99 * ((99 * 10) / 5 * 10) = 19,405,980 - target for level 100 could be 100 * 100 * ((100 * 5) / 5 * 10) = 10,000,000   ;  Please not that programmers refer to code as "program", " snippet" or "code", but never as "formula" or "equation". An equation is more something like . Surely, programs are math and closely follow lambda calculus or turing machines, but we don't refer to them as "equations" ;)