[SCRIPTING] [RMVX ACE] EXP-BASED STAT GROWTH OUTSIDE OF LEVELING

Posts

Pages: 1
So, basically, what I want to do is set up a script that can replace the standard stat gain on level up system with a system that gradually increases each stat individually as a character gains experience.
For example, if a character will get 5 HP and 2 ATK in their next "level up" and it would take 100 XP to reach that next level, I want them to instead get 1 HP every 20 XP and 1 ATK every 50 XP. Then if the next "level up" after that needs 200 XP they'd get 1 HP every 40 XP and so on.
However, I'm not really familiar with the scripting system, but from what I can tell the way it handles stat changes seems to be hardcoded in a certain way, and I'm not sure how to work around that. Also, while I more or less know the code I'll need to write to handle the formulas, I'm not sure where to find what variables usually handle the stat curves for each actor.
If there are already scripts out there that do the same thing, I'd be fine with using those as well; I just haven't been able to find any yet.

Edit: To clarify, I'm okay with having the "level" stat, level up messages, and things like that still visible, I just don't want them to directly affect the stats in any way.
Marrend
Guardian of the Description Thread
21806
Would it be helpful if you could just set the amount of EXP that is needed to "level up", and be able to use the stat-curves in the database for the stat gains for the character/class?

*Edit: As a side-thought, I could totally see resetting EXP to 0 (or reducing it by the amount of EXP required) is totally a thing that could happen in the exp_for_level function of RPG::Class. I'm not quite sure about outright ignoring level, though!
author=Marrend
Would it be helpful if you could just set the amount of EXP that is needed to "level up", and be able to use the stat-curves in the database for the stat gains for the character/class?

*Edit: As a side-thought, I could totally see resetting EXP to 0 (or reducing it by the amount of EXP required) is totally a thing that could happen in the exp_for_level function of RPG::Class. I'm not quite sure about outright ignoring level, though!

I'm sure that could probably work, but I don't know how to access the stat curves in the code, or even how to use scripts to modify the stats of a character. I'm sure it's just some simple variables, but... again, I'm not familiar with the scripting system so I don't know what those variables are or where I might find them.
I think it's possible to use one of those derived stat scripts (that for example calculate evasion% based on SPD) and use it to associate stats curves to exp
it would require somewhat advanced math to make a non linear curve (I'm not sure on how to do it, but a quick research should fix it)

a simple example

mhp = ( 320 + exp * 0.5 ) something like this to make every 2 exp points raise hp by 1 while having 320 hp at exp 0

Exp0 = 320 HP
Exp100 = 370 HP
Exp10000= 5320 HP


mhp = ( 320 + ( exp * (exp * 0.2) * 0.2)) + ( exp * 0.5) )

Exp0 = 320 HP
Exp100 = 410 HP
Exp10000= 400320 HP LOLOLOLOLOLO (that's totally not what you want ROFL)

but yeah something like that idk? someone COME UP WITH A FORMULA NOW

i'm actually interested on that as well xD
Marrend
Guardian of the Description Thread
21806
Sorry, I kinda lost track of this thread. Anyway, the default formula for the EXP curve looks something like...

def exp_for_level(level)
  lv = level.to_f
  basis = @exp_params[0].to_f
  extra = @exp_params[1].to_f
  acc_a = @exp_params[2].to_f
  acc_b = @exp_params[3].to_f
  return (basis*((lv-1)**(0.9+acc_a/250))*lv*(lv+1)/
    (6+lv**2/50/acc_b)+(lv-1)*extra).round.to_i
end

...that mess. For Champs of the Bocca I replaced that with...

class RPG::Class < RPG::BaseItem
  def exp_for_level(level)
    return (level - 1) * level * 5
  end
end

...this. Which is ten times more manageable, and probably closer to what the OP might want anyway! As for stat-growth, I'm not 100% certain what the issue is with just using the stat-curve generator in the database?

*Edit: RPG::Class.params might be something to look into. The default definition, according to the help file, looks something like...

def initialize
  @params = Table.new(8,100)
    (1..99).each do |i|
      @params[0,i] = 400+i*50
      @params[1,i] = 80+i*10
      (2..5).each {|j| @params[j,i] = 15+i*5/4 }
      (6..7).each {|j| @params[j,i] = 30+i*5/2 }
    end
  # etc
end

...this. It also notes...
The format is params[param_id, level], and param_id is assigned as follows:
  • 0: Maximum hit points
  • 1: Maximum magic points
  • 2: Attack power
  • 3: Defense power
  • 4: Magic attack power
  • 5: Magic defense power
  • 6: Agility
  • 7: Luck

*Edit2: Which... might mean that it could look something like...
$game_actors[x].class.params[0, ($game_actors[x].param(0)*level*1.06).to_i]
# This causes Max HP to increase by 6% per level. In theory!

...this? Or... whatever?

*head hurts*

*Edit3: Never mind. Game_Actor has a class_id method, so... uuuuuuhhhhhh, yeah, it probably wouldn't look like that, but, I feel like I'm getting closer to something usable.


*Edit4: You know, I'm starting to think that a case/when statement (based on Class ID) in regards to the table-thingy might just be the best answer.
author=Sated
Edit: To clarify, I'm okay with having the "level" stat, level up messages, and things like that still visible, I just don't want them to directly affect the stats in any way.
If you're going to retain the concept of "levels" then how is what you're planning to do any different from simply making the gap between "levels" smaller, whilst also reducing how much each stat increases per level?
yeah, I know, I'm not really trying to go for any major differences mechanically; I'm just more interested in the aesthetic appeal of that little rewarding feeling that comes from having a few stat points go up after every few battles, rather than having to wait for a full level up to see the experience making any difference.
However, if I just made it with lots of level ups with a short distance between them, then that short distance would inevitably just grow into an average distance and then a long distance, bringing it right back to the thing I'm trying to avoid.

author=Marrend
*Edit: RPG::Class.params might be something to look into. The default definition, according to the help file, looks something like...

def initialize
  @params = Table.new(8,100)
    (1..99).each do |i|
      @params[0,i] = 400+i*50
      @params[1,i] = 80+i*10
      (2..5).each {|j| @params[j,i] = 15+i*5/4 }
      (6..7).each {|j| @params[j,i] = 30+i*5/2 }
    end
  # etc
end
I'm not sure, but from what I can see it looks like RPG maker handles stats by just taking the level of the character and then using it to directly take the stats off that level's point on the stat curves, right? That's more or less what I assumed it was, but that makes me wonder if what I'm trying to do might be more trouble than it's worth, huh...
Pages: 1