Questions on How Ace Calculates Stat Increases (and a few other things)

Wyn Wizard

Arcane Specialist
Veteran
Joined
Feb 23, 2013
Messages
979
Reaction score
80
First Language
English
Primarily Uses
RMVXA
So I am wanting to make my new game in sort of like a vacuum where I can control most, if not all, aspects of calculations within the ace engine. Mainly, I want to find out how Ace calculates the amount a stat increases with each level, how much exp is needed to level, and how some of the things in the battle equations work (like what the bloody hell does collapse type mean?). If anyone could help me with this it would be awesome cause the way I want to build my armor, weapons, and items around a D&D based calculation style. All help is welcome. Thank you!
 

Reapergurl

Drummer Extraordinaire! xD
Veteran
Joined
Dec 15, 2016
Messages
534
Reaction score
552
First Language
British English
Primarily Uses
Other
Well, unless you use a script or external table method, Ace calculates EXP growth based upon a set of four variables, one base, one accelerator, and two exponential variables, the latter of those two affecting level 50+ and more visibly, level 70+.

As far as other stats go, these are actually set by you, the designer.

Battle equations, like the damage formulas, can be designed to your liking as well.

I only know of two collapse types. game_party, and game_troop, all_dead?

Yes, one can use such calculations.

Okay, a bow is typically attributed to a tetrahedron (four-sided) die. For this damage formula, a variable is required.

Code:
 a.agi * v[#] - b.def * v[##]
You would use two different variables for the dice because they are different types of dice and are also separate dice just like in D&D.

You would also 'roll' these dice before any damage is applied, which as far as I can tell, needs external scripts (I think Yanfly has some).
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,528
Reaction score
14,261
First Language
English
Primarily Uses
RMVXA
For how much a stat increases per level, it will increase the stat to what you set it up in the database. No more and no less. EXP is the only exception, as it follows some formula inside the system (which I don't know it I'm afraid), but you can find a script or plug-in to let you set up the EXP in a spreadsheet and then have the game read that instead.
 

Wyn Wizard

Arcane Specialist
Veteran
Joined
Feb 23, 2013
Messages
979
Reaction score
80
First Language
English
Primarily Uses
RMVXA
@Reapergurl - Could you explain a little more on how to use variables in battle calculations? Also, is there any non-script way to calculate those values during combat?

@bgillisp - I understand it will increase up to that max number, but where is it calculated to add a value per level? Like since I set my max values on all stats to 255 (pokemon stat reference) so will it increase the stat by the (max - base) / 100 yes? I am asking this cause I would assume it would stretch out the values over 100 levels yes?
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,528
Reaction score
14,261
First Language
English
Primarily Uses
RMVXA
Yes, unless you tell it otherwise. There are ways to set curves so it does less added at lower levels or less added at higher levels, and that formula I don't know (and it's a little buggy, as it can occasionally slip and decrease a stat), but otherwise it is a linear extrapolation.

For example, if you set ATK to 10 at level 1 and 108 at level 99, then since:

(108 - 10) / (99 - 1) = (98/98) = 1, it will increase your ATK by 1 per level.

As far as I can tell, decimal values are handled by the engine rounding the value. So you might get 98.2 ATK at level 55 and 99.7 ATK at level 56 with a formula, which is treated as 98 and 100 ATK respectively.
 

Wyn Wizard

Arcane Specialist
Veteran
Joined
Feb 23, 2013
Messages
979
Reaction score
80
First Language
English
Primarily Uses
RMVXA
@bgillisp - thank you, that actually offers quite a bit of insight into what I'm trying to accomplish. As another question, is there a guide on here on how to break down damage (or health regen depending) formulas for skills? I wanna make sure I can use everything that is at my disposal since this is going to be a short (ish) game. Since it won't have much in the way of game play (maybe 5-6 hours at best) I want to make sure I pull out all the stops on the mechanics and overall feel of the game.
 

Reapergurl

Drummer Extraordinaire! xD
Veteran
Joined
Dec 15, 2016
Messages
534
Reaction score
552
First Language
British English
Primarily Uses
Other
It could be done through a mess of common eventing, sure.

Basically, the variables are set up beforehand. I mean, give that variable a set value, it will act as set value.

Code:
a.agi * v[32] - b.def * v[33]
Let us say these variables are set to the following...
Code:
a.agi * 2 - b.def * 5
The resulting damage will calculate accordingly, however, the variable values will not be seen until the damage is applied in game.

If a.agi = 13 and b.def = 6, then the resulting damage will be nil, because 26 - 30 equals < 0 which means no damage.

But what if the defense die variable rolled a 2?

The resulting damage will be 14, because 26 - 12 ... you get the idea.
 

Wyn Wizard

Arcane Specialist
Veteran
Joined
Feb 23, 2013
Messages
979
Reaction score
80
First Language
English
Primarily Uses
RMVXA
@Kes - Thank you for the heads up. I can't ever seem to pick the right forum cause I always feel like while it should go in one, i always second guess myself on it and move it to another. Also, thanks for the link. Your help is deeply appreciated!

@Reapergurl - Thank you for the explanation, and it seems I may have to figure out how to script a way to calculate it.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,713
First Language
English
Primarily Uses
RMVXA
@Wyn Wizard It can at times be confusing, yes. The notion I keep in mind when deciding between General Discussion and Game Mechanics Design is that if it is a discussion about the conceptual level of an aspect of game play, then it is likely to be Game Mechanics Design forum. Aspects of battle, classes, stats, things like that will almost certainly be G.M.D. Very broad brush for General Discussion is that it is for general principles of game making. But there can be grey areas between those two.
 

Wyn Wizard

Arcane Specialist
Veteran
Joined
Feb 23, 2013
Messages
979
Reaction score
80
First Language
English
Primarily Uses
RMVXA
So I was conversing with @Andar and he told me you could use script calls in the battle formulas. If this is so, then this
Code:
v[x] == 1 ? rand(1..4) : rand(2..8)
should work.
 

deilin

Ranger/Elementalist
Veteran
Joined
Mar 13, 2012
Messages
1,188
Reaction score
172
First Language
English
If you must know the code for EXP:

Code:
class RPG::Class < RPG::BaseItem
  def initialize
   super
   @exp_params = [30,20,30,30]
   @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
   @learnings = []
   @features.push(RPG::BaseItem::Feature.new(23, 0, 1))
   @features.push(RPG::BaseItem::Feature.new(22, 0, 0.95))
   @features.push(RPG::BaseItem::Feature.new(22, 1, 0.05))
   @features.push(RPG::BaseItem::Feature.new(22, 2, 0.04))
   @features.push(RPG::BaseItem::Feature.new(41, 1))
   @features.push(RPG::BaseItem::Feature.new(51, 1))
   @features.push(RPG::BaseItem::Feature.new(52, 1))
  end
  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
  attr_accessor :exp_params
  attr_accessor :params
  attr_accessor :learnings
end

although, for most of my games I use this:
Code:
class RPG::Class < RPG::BaseItem
  attr_reader :classes
  attr_reader :class_id
  attr_reader :actor
  def exp_for_level(level)
    return (level * 100) - 100
  end
end

As far as weapons and stuff go, I have each weapon with their own attack skill and disable the standard attack (skill #1)

My formulas usually look like this:
(a.atk + (rand(#)+1)) - (rand(b.def)+1)

# is the size of die.
a.atk attackers attack value
b.def is the defender defence/armor value

Quick edit/addon: the +1 after the rand() is because rand(4) would be 0~3, instead of 1~4 like a regular 4d.
 
Last edited:

Wyn Wizard

Arcane Specialist
Veteran
Joined
Feb 23, 2013
Messages
979
Reaction score
80
First Language
English
Primarily Uses
RMVXA
@deilin - Where did you get that first quoted code? I can't find it in Ace's script database?
 

deilin

Ranger/Elementalist
Veteran
Joined
Mar 13, 2012
Messages
1,188
Reaction score
172
First Language
English
If you open up the "help" option with the script editor, you can find the "hidden" aspect of the ruby code. You can find almost all the base calculations used by RPG maker.

My current project uses time.now codes to adjust time in the game, and calculate growth and more.
 

Wyn Wizard

Arcane Specialist
Veteran
Joined
Feb 23, 2013
Messages
979
Reaction score
80
First Language
English
Primarily Uses
RMVXA
So i'm curious, if i were to put this script in:
Code:
class Potion
  def minor_potion
    @hp = 0
    for i in (1..2)
      @hp += rand(1..4)
    end
    @hp += 2
    return @hp
  end
 
  def basic_potion
    @hp = 0
    for i in (1..4)
      @hp += rand(1..4)
    end
    @hp += 4
    return @hp
  end
 
  def greater_potion
    @hp = 0
    for i in (1..6)
      @hp += rand(1..4)
    end
    @hp += 6
    return @hp
  end
 
  def superior_potion
    @hp = 0
    for i in (1..8)
      @hp += rand(1..4)
    end
    @hp += 8
    return @hp
  end
end

And then add this:
Code:
minor_potion()
to the damage equation as a health regen equation would it work? I was told once you can make script calls in the damage formula with ruby but I'm not sure I fully understand.
 
Last edited:

Wyn Wizard

Arcane Specialist
Veteran
Joined
Feb 23, 2013
Messages
979
Reaction score
80
First Language
English
Primarily Uses
RMVXA
@Reapergurl - I don't know if you liking my post means it works, or if its a good idea, or both.
 

Reapergurl

Drummer Extraordinaire! xD
Veteran
Joined
Dec 15, 2016
Messages
534
Reaction score
552
First Language
British English
Primarily Uses
Other
Means I like the idea. I don't know if it would work, hence my level of Ruby knowledge is novice.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,038
Messages
1,018,466
Members
137,821
Latest member
Capterson
Top