Adjusting the rate at which XP required to level increases?

Users who are viewing this thread

Optimushroom

Recruit
M&BWBWF&S
To elaborate on what I'm looking for and what I'm not looking for: I want to change how quickly the XP required to level up increases as your level increases, ideally only for the player and possibly heroes, but not troops. I'm aware of a couple of semi-related parameters, but these don't do what I want.

level_boundary_multiplier in module.ini is just a multiplier on the required XP, and doesn't affect how quickly that number increases proportionally.
player_xp_multiplier in module.ini is just a multiplier on how much XP the player gets.

I thought maybe there's a script that multiplies this value by something when you level up, so I looked in module_scripts.py and found this, but I'm not sure if this is just the XP needed to upgrade troops in your party or if it applies to the player as well. I didn't find anything similar for just the player, so if this is the right one, I guess I'll have to decrease regulars_xp_multiplier in module.ini to compensate so troops don't level up too quickly.
Code:
# script_game_get_upgrade_xp
  # This script is called from game engine for calculating needed troop upgrade exp
  # Input:
  # param1: troop_id,
  # Output: reg0 = needed exp for upgrade
  ("game_get_upgrade_xp",
    [
      (store_script_param_1, ":troop_id"),
      
      (assign, ":needed_upgrade_xp", 0),
      #formula : int needed_upgrade_xp = 2 * (30 + 0.006f * level_boundaries[troops[troop_id].level + 3]);
      (store_character_level, ":troop_level", ":troop_id"),
      (store_add, ":needed_upgrade_xp", ":troop_level", 3),
      (get_level_boundary, reg0, ":needed_upgrade_xp"),       
      (val_mul, reg0, 6),
      (val_div, reg0, 1000),
      (val_add, reg0, 30),

      (try_begin),               
        (ge, ":troop_id", bandits_begin),
        (lt, ":troop_id", bandits_end),
        (val_mul, reg0, 2),
      (try_end),

      (set_trigger_result, reg0),
  ])

Does anyone know if this is the right script?
 

Eärendil Ardamírë

Subforum Moderator
WBWF&SM&B
Yes, this is the correct place to make your adjustments. The formula there is for all troops, you can modify it such way that heroes and the player troop need more xp. The modifiers at module.ini just influence how many xp the player/heroes will get.
 

Optimushroom

Recruit
M&BWBWF&S
Second hurdle, where can I find the implementation of get_level_boundary? The header doesn't help much, I'd like to see how that number is calculated.
 

Optimushroom

Recruit
M&BWBWF&S
I've been changing each of the values in the script one at a time to see what effect it has, rerunning build_module.bat each time, and so far none of them have shown any effect on how much XP the player needs to reach any given level. Do I need to change anything to make this work with the player? I looked into module_troops.py and noticed that the player troop does not have its level defined there, whereas heroes do, so maybe that might be it?
 

Vetrogor

Squire
Because this script affect only regulars. It give the amount of XP needed to upgrade one troop of that level. Heroes are not upgraded.
 

Optimushroom

Recruit
M&BWBWF&S
Oh, so if I understand correctly: in the process of upgrading a regular troop from the party menu, the game needs to figure out how much XP it needs to give that troop, and that's what this script is for? Or something like that. Guess I'll have to keep searching for how to do what I described in the first post, then.
 

Optimushroom

Recruit
M&BWBWF&S
Well, a quick ctrl+f search for "xp" in module_scripts.py later, and out of 323 results there's nothing else that looks relevant to this. If this turns out to be hardcoded, or I just can't find a way to do this, I might just adjust the attribute points and skill points per level instead. But I'll keep trying for now.
 
Top Bottom