![]() | |||||||
doing a rpg experience system Hi all i am just wondering what is a good way to calculate experience when levelling up in a php rpg game? |
Uhhh it depends on the game and how it works. Who are the characters, what is the plot, what do you do in the game, what's the main source of "player persistence" (how does a player "keep going" - usually a type of money or something) ... |
This is the formula I use for my game $k is level. PHP Code: Levels 1-1000 Just change the formula a little bit depending on your liking. |
it depends how fast you want people to be able to level, and how much experience users are able to obtain per kill or quest or whatever. in some games, like asherons call, the experience scale was exponential (i think). I believe there were 126 levels, and after about level 100, it seemed like it would take decades to get to the next level. in other games, like everquest 1, the first 10 or 15 levels were very quick and easy, and then it just became increasingly difficult to level, but not unbearable. you're going to have to decide what you want the user experience to be like, and then you can choose a basic algorithm and spend a lot of time tweaking it until you're satisfied |
Well, unless the experience you get from each kill gets less and less, it has to be exponential. The speed of your system not only depends on your experience formula, but also how much experience you give for each kill. |
Wouldnt it bee better to replace $k = 1 to $k = $level ? <?php for($k = 1; $k <= 1000; $k++) { $exp = (3/4) * ((50/3) * pow($k, 3) - 100 * pow($k, 2) + ((850/3) * $k) - 200); echo $k.": ".$exp."<br>"; } ?> |
If you mean changing $k to $level, then that's just preference. That won't change the program, just the code. If you mean physically changing $k = 1 to $k = $level, the variable $level isn't initialized yet. It would most likely just be the same as $k = 0. |
well yeah i know that, you can make it pull $level from a database. |
The script I wrote has nothing to do with a database. In my game I use that script to add each level to a database and then I check what level they are by comparing their experience with the database. |
| All times are GMT -7. The time now is 10:30 AM. |
Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0