Skip to main content
GameDev.net gamedev.net
🔒 Locked 🤖 Godot

Exp Question

Started by drseuss Sep 5, 2010 at 6:14 PM 3 replies 850+ views
Original Post
drseuss
drseuss
So I have an EXP equation thing here. I want peoples opinion about it.

It is written in PHP

for($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)."
";
}


?>

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.
ZER0 C00L
ZER0 C00L
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]
I hope I can make a living out of this.
drseuss
drseuss
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.
Geoffrey
Geoffrey
Quote:
Original post by drseuss
for($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
phresnel
phresnel
Please not that programmers refer to code as "program", " snippet" or "code", but never as "formula" or "equation". An equation is more something like

<img src="http://upload.wikimedia.org/math/9/b/8/9b85ef5e67b77c3ac679e00b7643a5e9.png"/>

. Surely, programs are math and closely follow lambda calculus or turing machines, but we don't refer to them as "equations" ;)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.