Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: [Maths] Gaining EXP Formula  (Read 1595 times)

0 Members and 1 Guest are viewing this topic.

King Tetiro

Leader of Phoenix Heart
[Maths] Gaining EXP Formula
« on: January 14, 2012, 03:08:13 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3549
Howdy folks, Tetiro here. I need some help with a maths formula and seeing as this is a Programming and Maths sub-forum, I thought this is the best place to gain help on this.

I've recently been working on the programming side of my team's Turn Based RPG for the Android/iPhone devices. And I've gotten stuck on Experience.

I have this formula for the EXP curve.

Quote
ROUND( 10 * ( 1.1 ^ n ) )
Red = The Experience required at Level 1
Blue = The Percentage increase every time the player levels up
Green = The Current level

Now the formula works but now I'm working on the formula to determine the amount of EXP the player gains when they defeat an enemy. Now the problem is my formulas are too much of an overkill or they barely give any EXP at all.

I was wondering if I could get some help working out a formula? I'm going to be working on this as well. Here's some things about the gameplay that could affect the EXP formula. I think.

  • The player can control up to 3 warriors in battle
  • There are up to 3 enemies in each battle
  • When a character levels up, their current_exp is reset to 0
  • Enemies level up to 65 whilst Characters level up to 100. Meaning once the Characters are level 65+, the enemies with the highest EXP will be at level 65 experience
Logged
  • Phoenix Heart
Re: [Maths] Gaining EXP Formula
« Reply #1 on: January 14, 2012, 07:14:09 pm »
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3725
It is a bit difficult without the full details of what is involved in battle. And whether each warrior has its own stats in level and experience or that the level and stats belong to the player.

Assuming that the stat belong to the player:
Code: [Select]
// base_gain: The base value of experience gain from the highest level monster that the player gets.
                 Or it is the sum over all the monsters' base values.
// lev_m:     The level of the highest level monster
// lev_p:     The level of the player
// gain:      The total amount of experience gained by the player

gain = (lev_m / lev_p) * base_gain

This is when assuming that each warrior has its own.
Code: [Select]
*** Calculating total gain
// base_gain: It is the sum over all the monsters' base values for experience gain.
// lev_m:     The sum of levels over all the monsters
// lev_p:     The sum of levels over all the warriors
// gain:      The total amount of experience gained by the player

gain = (lev_m / lev_p) * base_gain

*** Calculating the gain per warrior
// gain_w:    The total gain in experience for the specific warrior
// lev_w:     The level of that specific warrior

gain_w = (1 - (lev_w / lev_p)) * gain

This is some basic math, with the assumption that base_gain is an attribute of the monsters. If other things in battle like class and some classes are weaker than others; or even elements (fire/water/earth/wind) matter, you might want to reconsider how you determine base_gain.


When a character levels up, their current_exp is reset to 0
I would not do this. I would set the experience to the remainder of what was left over aftyer the level gain. But then again it is your game.
« Last Edit: January 14, 2012, 07:17:10 pm by Niek »
Logged

Miles07

Knight of ERA
Re: [Maths] Gaining EXP Formula
« Reply #2 on: January 22, 2012, 03:50:08 am »
  • Long live the Chaos!!
  • *
  • Reputation: +14/-0
  • Offline Offline
  • Gender: Male
  • Posts: 608
Sounds like a Pokemon engine problem.
In Pokemon, a specific enemy of a specific level (Lv) would give a certain amount of experience points (EXP) if you beat it.
- Same species, higher Lv = higher EXP by a certain unknown factor.
- Different species, same Lv = different EXP gain, different growth factor.

I would define a base EXP requirement for a Lv. 1 enemy of every enemy "species", as well as a unique growth factor to either multiply [base x factor^(Lv-1)] or add [base + factor x (Lv-1)] based on the level of the foe. More data, yes, but this makes the game / project more thought-out than to simply make EXP gain from a foe to be constant. 
Logged
I was talking to my friend last night, and he was mentioning about how in 1980, he thought the internet would become this amazing place where people from across the world would share ideas. I was telling him about how this project [KOT] has worked, lurching along for years and drawn by different people from across the globe, and he thought it was beautiful. And he was right, it's awesome. :D

Zelda Items Spritesheet album (OUT OF DATE) - (link here)
A Link Across Time project - (link here)
Boss Keys project (Metroid) - (link here)
Boss Keys project (Zelda) - (link here)
Boss Keys project Trello Board - (link here)
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.037 seconds with 43 queries.

anything