[advanced search]
Results from the most recent live auction are here.
21 members in the live chat room. Join Chat!
Register Rules & FAQ NP$ Store Active Threads Mark Forums Read
Go Back   NamePros.Com > Design and Development > Programming
User Name
Password

Old 05-07-2008, 04:55 AM   · #1
liam_d
The original NP Emo Kid
 
liam_d's Avatar
 
Name: Liam Dawe
Location: Plymouth, UK
Trader Rating: (27)
Join Date: Jan 2005
Posts: 1,538
NP$: 12.00 (Donate)
liam_d is a name known to allliam_d is a name known to allliam_d is a name known to allliam_d is a name known to allliam_d is a name known to allliam_d is a name known to all
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?


Please register or log-in into NamePros to hide ads
liam_d is offline   Reply With Quote
Old 05-08-2008, 06:31 PM   · #2
mholt
DNOA Member
 
Name: Matthew Holt
Location: 127.0.0.1
Trader Rating: (75)
Join Date: May 2004
Posts: 4,863
NP$: 17.21 (Donate)
mholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant future
Autism Marrow Donor Program 9/11/01 :: Never Forget Multiple Sclerosis Adoption Alzheimer's Lou Gehrig's Disease (ALS)
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) ...
__________________
FREE: Help With Code

Includes other technical topics:
programming, development, Windows, domain names, and Internet
mholt is offline   Reply With Quote
Old 05-09-2008, 12:58 AM   · #3
Palyriot
NamePros Regular
 
Palyriot's Avatar
 
Name: Derek
Location: Seattle, Wa
Trader Rating: (14)
Join Date: Jul 2004
Posts: 596
NP$: 67.00 (Donate)
Palyriot is a jewel in the roughPalyriot is a jewel in the roughPalyriot is a jewel in the rough
This is the formula I use for my game

$k is level.

PHP Code:
<?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>";
}
?>


Levels 1-1000

Just change the formula a little bit depending on your liking.

Last edited by Palyriot : 05-09-2008 at 01:12 AM.
Palyriot is offline   Reply With Quote
Old 05-09-2008, 07:58 AM   · #4
hyped
NamePros Member
 
Trader Rating: (0)
Join Date: Sep 2007
Posts: 101
NP$: 290.75 (Donate)
hyped will become famous soon enoughhyped will become famous soon enough
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
hyped is offline   Reply With Quote
Old 05-09-2008, 09:09 AM   · #5
Palyriot
NamePros Regular
 
Palyriot's Avatar
 
Name: Derek
Location: Seattle, Wa
Trader Rating: (14)
Join Date: Jul 2004
Posts: 596
NP$: 67.00 (Donate)
Palyriot is a jewel in the roughPalyriot is a jewel in the roughPalyriot is a jewel in the rough
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.
Palyriot is offline   Reply With Quote
Old 05-21-2008, 12:30 PM   · #6
Dreads
NamePros Member
 
Trader Rating: (4)
Join Date: Aug 2006
Posts: 160
NP$: 74.20 (Donate)
Dreads is an unknown quantity at this point
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>";
}
?>
Dreads is offline   Reply With Quote
Old 05-22-2008, 12:43 AM   · #7
Palyriot
NamePros Regular
 
Palyriot's Avatar
 
Name: Derek
Location: Seattle, Wa
Trader Rating: (14)
Join Date: Jul 2004
Posts: 596
NP$: 67.00 (Donate)
Palyriot is a jewel in the roughPalyriot is a jewel in the roughPalyriot is a jewel in the rough
Originally Posted by Dreads
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.
Palyriot is offline   Reply With Quote
Old 05-23-2008, 07:29 PM   · #8
Dreads
NamePros Member
 
Trader Rating: (4)
Join Date: Aug 2006
Posts: 160
NP$: 74.20 (Donate)
Dreads is an unknown quantity at this point
well yeah i know that, you can make it pull $level from a database.
Dreads is offline   Reply With Quote
Old 05-25-2008, 03:57 PM   · #9
Palyriot
NamePros Regular
 
Palyriot's Avatar
 
Name: Derek
Location: Seattle, Wa
Trader Rating: (14)
Join Date: Jul 2004
Posts: 596
NP$: 67.00 (Donate)
Palyriot is a jewel in the roughPalyriot is a jewel in the roughPalyriot is a jewel in the rough
Originally Posted by Dreads
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.
Palyriot is offline   Reply With Quote
Reply

NamePros is a revenue sharing forum.

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


Site Sponsors
http://www.dnfinder.com http://www.dnfinder.com Buy Flash Arcade Game Script
Advertise your business at NamePros
All times are GMT -7. The time now is 01:09 AM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0