EXPERIENCE GAINED

Posts

Pages: 1
Hello,

I am currently using RPG Maker VX and am new at this whole thing. What I am wanting to know is if it is possible to make a system like in Lost Odyssey when gaining experience.

For those who haven't played Lost Odyssey (don't blame you, was a good game but nothing that different) the developers had set up kind of max level "limit" for each area and once a character got to that level then they only gained a small fraction of what they were gaining. They put this in to try and stop grinding (although at the start of the second disc they had an area that would give you loads of exp all the way until level 50) and it was the ideal level to face the boss of the area at).

Anyway I was just wondering if there was a way to limit the exp specific characters get once they reach a certain level (Don't wanna go to LO extremes, 200 and something exp to 1-2 exp just for reaching level 20 is a bit extreme to me).

Thank you,

Bryan
This sounds neat without being complicated. Maybe I'll give this a shot (no you're supposed to be working on other things argh why are you doing this crap well there goes an hour or two)
I've never used RPG MAKER VX before, but I'd assume you could do something like this with scripting?
If not, you could always go the old-fashioned way and use switches and variables!
Sorry if this isn't much help, but I've never used RPG MAKER VX before.

Also, have you used any previous engines before? You say you're 'new at this whole thing', but do you mean at the RPG-Making scene, or just RPG MAKER VX?

Should've slept, scripted instead.
See script for instructions, if its confusing at all let me know and I'll try and explain it better (which I'm not good at when its 2 in the morning)

Copy+Paste this into a new script in RMVX's script editor. Exact instructions:
1) Open the script editor
2) Highlight a script in the left column between "? Materials" and "? Main Process".
3) Press insert
4) In the lower left corner name the script "Level-Modified Experience" or something like that
5) Copy+Paste the below script into the right window
6) Follow instructions
7) Report inevitiable errors


# ==============================
# Level-Modified Experience v1.0
# by GreatRedSpirit
# ==============================
# Gives actors an experience boost/penalty based on their level and the
# max/min levels of an enemy. If an actor is above an enemy's max level then
# the actor gets an experience penalty based on EXP_PENALTY_MULTIPLIER and the
# number of levels the actor is above max level. It works the same when the
# actor's level is below min level except it uses EXP_BOOST_MULTIPLIER.
#
# To set an enemy's max/min level, add the strings in the enemy note:
# For min level:
# MinimumLevel X
# For max level
# MaximumLevel X
# Where X is a positive number. You can change what strings are looked for
# in EXP_BOOST/PENALTY_REGEX as long as the first value matched is X and
# the string is a regular expression.
#
# The system tries to arrange enemies when calculating experience so that the
# actor gets as much experience as possible. The algorithm is pretty weak for
# it so I'll try and improve it for later iterations.
#
# Known bugs: An actor will get multiple level up messages if multiple enemies
# give the actor levels each.

# Constants:
# Experience boost when level is below an enemy's minimum level
# EXP = exp * boost ^ levels below minimum
EXP_BOOST_MULTIPLIER = 2.00

# Experience penalty given when actor's level is greater than maximum level
# EXP = exp * penalty ^ levels above maximum
EXP_PENALTY_MULTIPLIER = 0.50

# Identifier reg exps to define enemy maximum/minimum levels
# Look for these in the enemy's note
EXP_BOOST_REGEX = "MinimumLevel (+)"
EXP_PENALTY_REGEX = "MaximumLevel (+)"

# Get access to the enemies in the array of the battle troop
# We need this to determine how much experience to get
class Game_Troop < Game_Unit
attr_reader :enemies
end

# Get access to an actor's experience to next level list
# Need this to calculate how much experience an actor gains for level offsets
class Game_Actor < Game_Battler
attr_reader :exp_list
end

# Change the enemy class so the experience it gives is based on an actor's level
class Game_Enemy < Game_Battler
# Give read access to an enemy's min/max level boosts
attr_reader :minLevel,
:maxLevel

# When creating a game enemy, determine the exp boost/penalty levels
alias initialize_ori initialize
def initialize(index, enemy_id)
# Create the enemy first
initialize_ori(index, enemy_id)
# Determine enemy levels, get reference to enemy data:
enemyData = $data_enemies
# See if the minimum level regex is in the enemy note
if enemyData.note =~ EXP_BOOST_REGEX
# Set the enemy's min level to the matched value
@minLevel = $1.to_i
else
# Regex not matched, assume that there's no min level
@minLevel = 0
end
# See if the maximum level regex is in the enemy note
if enemyData.note =~ EXP_PENALTY_REGEX
# Set the enemy's max level to the matched value
@maxLevel = $1.to_i
else
# Regex not matched, assume that there's no max level
@maxLevel = 99999
end
# Sanity check: These values can't cover the same area
# If they do, throw an exception
if @minLevel > @maxLevel
raise Exception.new("Enemy #{enemy.name} has clashing max/min levels")
end
end

# Calculate the amount of experience that should be given to the current actor
alias exp_ori exp
def exp(actor = nil)
# If actor is nil, call the original method
if actor == nil
return exp_ori
end
# There's an actor: Calculate the experience the actor gets and return it
exp = 0 # Experience that can be earned by this enemy for this actor
expPool = exp_ori # Get the total distributable experience
expPool *= 2 if actor.double_exp_gain # Double exp pool if actor has *2 exp
level = actor.level # Current actor level

# Begin experience calculation loop until there's no more experience
while(expPool > 0)
# If the actor is at maximum level
if actor.exp_list <= 0 or actor.exp_list == nil
# Break and give experience
break
end
# Get level difference from max/min level and exp multiplier
# If the actor is below minimum level
if level < @minLevel
levelDif = @minLevel - level
multiplier = EXP_BOOST_MULTIPLIER
# If the actor is above maximum level
elsif level > @maxLevel
levelDif = level - @maxLevel
multiplier = EXP_PENALTY_MULTIPLIER
# Actor is between min/max, multiplier is set to 1.0 and dif to zero
else
levelDif = 0
multiplier = 1.0
end
# Calculate adjusted next level experience
nextLevel = (actor.exp_list * multiplier ** -levelDif).to_i
# If there's enough experience to reach the next level
if expPool > nextLevel
# Assign enough experience to give the actor a level up
exp += nextLevel
# Increase the assigned actor level
level += 1
# Deduct the adjusted next level cost from the pool
expPool -= nextLevel
else
# There wasn't enough experience to level the actor up
# Add the remainder of the experience pool to the earned exp
# (You can always earn one experience per enemy killed)
exp += .max
expPool = 0
end
end
# Return the earned experience
return exp
end

end

# Change how experience is given out:
# For each actor and each enemy defeated, calculate the amount of experience
# that character gets from each enemy based on their current level and

class Scene_Battle < Scene_Base

# Overwrite the level up function so that each actor gets their experience
# from each enemy based on their current level
def display_level_up
#exp = $game_troop.exp_total
for actor in $game_party.existing_members
last_level = actor.level
last_skills = actor.skills
# Build an array for the order to process enemies: Try and be efficient
boostList =
normalList =
penaltyList =
for enemy in $game_troop.enemies
# If the actor gets a boost from this enemy put it here
if actor.level < enemy.minLevel
boostList.push(enemy)
# If the enemy is going to get a exp penalty push him to that list
elsif actor.level > enemy.maxLevel
penaltyList.push(enemy)
# No boost/penalty, add him to the normal list
else
normalList.push(enemy)
end
end
# Combine the lists
enemyList = boostList + normalList + penaltyList
# Run through the new list
for enemy in enemyList
# For the current enemy get all experience
exp = enemy.exp(actor)
actor.gain_exp(exp, true)
end
end
wait_for_message
end

end

Pages: 1