Adjusting the rate at which XP required to level increases?

Users who are viewing this thread


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 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.
# 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
      (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),

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

      (set_trigger_result, reg0),

Does anyone know if this is the right script?

Eärendil Ardamírë

Subforum Moderator
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.


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.


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 and noticed that the player troop does not have its level defined there, whereas heroes do, so maybe that might be it?


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


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.


Well, a quick ctrl+f search for "xp" in 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