GPWiki.org
GPWiki.org
It is currently Mon May 20, 2013 3:22 pm

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: RPG leveling system
PostPosted: Sat Apr 08, 2006 2:27 am 
Source Code Swashbuckler
User avatar

Joined: Sat Apr 08, 2006 2:10 am
Posts: 203
Location: Los Angeles, The land of plenty
I'm trying to design a RPG, and I am trying to figure out how to get a proper leveling algorithm or something. Instead of just setting up all these cases for the experience like:
Code:
switch(exp)
     {
          case 500: level++;
          case 1000: level++;
          //etc.
     }

Because, i don't know, I might want like 100 levels, or 60, or even 40, which might be a lot of cases to have.
Or, rather, how would you set up the experience and leveling system? (I open to any ideas.)


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 08, 2006 3:12 am 
Dexterous Droid

Joined: Fri Aug 19, 2005 10:34 am
Posts: 3650
Have these variables:

CurrentEXP
EXPtoLevel
CurrentLevel

When CurrentEXP >= EXPtoLevel, then CurrentLevel + 1, CurrentEXP = 0 and EXPtoLevel = X

X can be any equation, preferably a single-variable equation with CurrentLevel as the variable. For example, X = (CurrentLevel * 1000) would be 1000 exp for every level. Or X = (CurrentLevel * 1000) ^ 1.2 would add a larger range in exp required for higher levels.

_________________
NetGore - Open source online RPG engine


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 08, 2006 5:07 am 
King Code Monkey
User avatar

Joined: Wed Sep 01, 2004 3:05 pm
Posts: 11182
Location: Abingdon, MD
To handle the exp/level deal, create a simple table and check it when the player gains experience. If you keep the table in a file, it can easily be changed to ensure it's balanced when you're testing.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 08, 2006 11:40 am 
Bibliotherapist
User avatar

Joined: Wed Dec 21, 2005 6:23 pm
Posts: 6210
Location: Manchester, UK
or just have a simple formula, that you can show in a table in design documents fro clarity, but is expadable a lot easier than that. For example, the d20 system has a table with xp values for each level, but it follows a simple formula, which I think is something like (in code):

Code:
for (int i = 1; 1 <= level; i++)
   expForNextLevel += i;
expForNextLevel *= 1000;


or, in more english terms, times the level by 1000, and add that onto the previous value for the next level to gain the next experience point target.

_________________
God must love stupid people, he made so many.
theraje: 'God doesn't love stupid people, they're just easier to make'
http://sharedillusions.blogspot.com


Top
 Profile  
 
 Post subject: Re: RPG leveling system
PostPosted: Sun Jun 26, 2011 2:10 am 
I'm using a leveling system that starts by preset values up to lvl 6 then uses a formula like

nextLevel = (1,000 ^ (curLevel / 100 + 1.2))

anyway It's also a good Idea to save all of the values for the levels into some array in the init of the game. That way you won't have to constantly be running this formula for ever exp gained. At least thats how I did it.


Top
  
 
 Post subject: Re: RPG leveling system
PostPosted: Mon Apr 15, 2013 6:38 pm 
Level 1 Cleric
User avatar

Joined: Thu Apr 11, 2013 9:27 pm
Posts: 12
Location: Kansas
I prefer the algorithm : NextLevel = ((Previous Level * 2) + 1/2 Previous Level)

Level 2 general starting at 100 xp or 200 xp needed then extrapolating out to a max level of 100 or so.

_________________
“Man is still the most extraordinary computer of all.” – John Fitzgerald Kennedy


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group