NPC Army Composition

Currently Viewing (Users: 0, Guests: 1)

Lancer

Sergeant at Arms
Best answers
0
I've tried searching for this and haven't found a precise answer, so I'll throw it out:

I've been trying to understand what determines the composition (ie. number of each troop types) of NPC lord armies. I know it has something to do with both the reinforcements section of mod_party_templates and the several areas of mod_scripts, but I'm not sure where they are.

My issue is that while the received wisdom seems to be that these things are random, as far as I can see they're not, or at least not fully. The numbers associated with each reinforcement type in mod_party_templates are supposedly minima and maxima of each troop for each reinforcement cycle (or something) but they're really not working like that for me in practice.

My problem boils down to this: I have a mod based on a pared-down vanilla, with only 5 troop types to each faction, which are correspondingly set up as the 5 tiers. I set the min and max values (or whatever they are) in mod_party_templates in order to reflect the ratio I desired (eg. cheaper troops should be more plentiful, elite troops rarer) but this just isn't reflected in the game. NPC armies are consistently "top-heavy" with the tier 4 and 5 troops making up ~60% of the parties, and only a handful of each lower-tier troop.

Has anyone else experienced issues like this? Am I just using the reinforcement numbers wrongly, or is there some scripting element that I've missed which influences this?

Thanks in advance,

Lancer
 

The Mercenary

Grandmaster Knight
Best answers
0
Lancer said:
I've tried searching for this and haven't found a precise answer, so I'll throw it out:

I've been trying to understand what determines the composition (ie. number of each troop types) of NPC lord armies. I know it has something to do with both the reinforcements section of mod_party_templates and the several areas of mod_scripts, but I'm not sure where they are.

My issue is that while the received wisdom seems to be that these things are random, as far as I can see they're not, or at least not fully. The numbers associated with each reinforcement type in mod_party_templates are supposedly minima and maxima of each troop for each reinforcement cycle (or something) but they're really not working like that for me in practice.

My problem boils down to this: I have a mod based on a pared-down vanilla, with only 5 troop types to each faction, which are correspondingly set up as the 5 tiers. I set the min and max values (or whatever they are) in mod_party_templates in order to reflect the ratio I desired (eg. cheaper troops should be more plentiful, elite troops rarer) but this just isn't reflected in the game. NPC armies are consistently "top-heavy" with the tier 4 and 5 troops making up ~60% of the parties, and only a handful of each lower-tier troop.

Has anyone else experienced issues like this? Am I just using the reinforcement numbers wrongly, or is there some scripting element that I've missed which influences this?

Thanks in advance,

Lancer
That's because the AI gets an experience boost when it gets new troops. You have to set the XP boost to 0.
 

Lancer

Sergeant at Arms
Best answers
0
Okay, makes sense... Where is that set? Scripts, or with the troops themselves?

Lancer
 

Lancer

Sergeant at Arms
Best answers
0
Hmm, okay... thanks for the in-depth explanation. It's possible that my observations are just coincidence at it evens out after a while, but FWIW I'll post the way I have it set up, to explain what I mean:

Taking the Nords as an example, I have 5 units:
nord_recruit (level 12)
nord_footman (level 14)
nord_trained_footman (level 16)
nord_warrior (level 15)
nord_veteran (level 20)

and the table set up this way:

Code:
  ("kingdom_4_reinforcements_a", "kingdom_4_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_nord_footman,4,8),(trp_nord_recruit,2,4)]),
  ("kingdom_4_reinforcements_b", "kingdom_4_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_nord_trained_footman,1,4),(trp_nord_warrior,3,7)]),
  ("kingdom_4_reinforcements_c", "kingdom_4_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_nord_veteran,3,6)]),
Time after time, this arrangement yields Nord parties where (out of say 80 men as an approximate average) 25-30 are nord_trained_footmen, 25-30 are nord_veteran and the remaining 20 or so are split between the other three troop types. This is definitely not the distribution I was going for. Have I just set up the numbers wrong in that case (ie. does the code above produce that result) or is there something else going on?

Thanks for the patience, just trying to sort this out as it has been really bothering me.

Lancer
 

noosers

Grandmaster Knight
M&BWB
Best answers
0
Since this thread is already highjacked and my question seems fitting (at least to me):

Someone claimed in a thread at the PoP forum that castles gave a +20 troop bonus to the maximum AI lord party cap.

I wasn´t aware of that so is that true and does the same apply for towns or is it just some oddity which hasn´t got an effect on actual gameplay?
 

Tocan

Sergeant Knight at Arms
Best answers
3
noosers said:
Since this thread is already highjacked and my question seems fitting (at least to me):

Someone claimed in a thread at the PoP forum that castles gave a +20 troop bonus to the maximum AI lord party cap.

I wasn´t aware of that so is that true and does the same apply for towns or is it just some oddity which hasn´t got an effect on actual gameplay?
it's true and unlike I've asserted first towns don't apply that bonus (in native).

  ("party_get_ideal_size",
    [
      (store_script_param_1, ":party_no"),
      (assign, ":limit", 30),
      (try_begin),
        (party_slot_eq, ":party_no", slot_party_type, spt_kingdom_hero_party),
        (party_stack_get_troop_id, ":party_leader", ":party_no", 0),
        (store_faction_of_party, ":faction_id", ":party_no"),
        (assign, ":limit", 10),

        (store_skill_level, ":skill", "skl_leadership", ":party_leader"),
        (store_attribute_level, ":charisma", ":party_leader", ca_charisma),
        (val_mul, ":skill", 5),
        (val_add, ":limit", ":skill"),
        (val_add, ":limit", ":charisma"),

        (troop_get_slot, ":troop_renown", ":party_leader", slot_troop_renown),
        (store_div, ":renown_bonus", ":troop_renown", 25),
        (val_add, ":limit", ":renown_bonus"),

        (try_begin),
          (faction_slot_eq, ":faction_id", slot_faction_leader, ":party_leader"),
          (val_add, ":limit", 100),
        (try_end),

        (try_begin),
          (faction_slot_eq, ":faction_id", slot_faction_marshall, ":party_leader"),
          (val_add, ":limit", 20),
        (try_end),     

        (try_for_range, ":cur_center", castles_begin, castles_end),
          (party_slot_eq, ":cur_center", slot_town_lord, ":party_leader"),
          (val_add, ":limit", 20),
        (try_end),   
 
      (try_end),
         
      (store_character_level, ":level", "trp_player"), #increase limits a little bit as the game progresses.
      (store_add, ":level_factor", 80, ":level"),
      (val_mul, ":limit", ":level_factor"),
      (val_div, ":limit", 80),
      (assign, reg0, ":limit"),
  ]),
 
Best answers
0
Tocan said:
noosers said:
Since this thread is already highjacked and my question seems fitting (at least to me):

Someone claimed in a thread at the PoP forum that castles gave a +20 troop bonus to the maximum AI lord party cap.

I wasn´t aware of that so is that true and does the same apply for towns or is it just some oddity which hasn´t got an effect on actual gameplay?
it's true and unlike I've asserted first towns don't apply that bonus (in native).

  ("party_get_ideal_size",
    [
      (store_script_param_1, ":party_no"),
      (assign, ":limit", 30),
      (try_begin),
        (party_slot_eq, ":party_no", slot_party_type, spt_kingdom_hero_party),
        (party_stack_get_troop_id, ":party_leader", ":party_no", 0),
        (store_faction_of_party, ":faction_id", ":party_no"),
        (assign, ":limit", 10),

        (store_skill_level, ":skill", "skl_leadership", ":party_leader"),
        (store_attribute_level, ":charisma", ":party_leader", ca_charisma),
        (val_mul, ":skill", 5),
        (val_add, ":limit", ":skill"),
        (val_add, ":limit", ":charisma"),

        (troop_get_slot, ":troop_renown", ":party_leader", slot_troop_renown),
        (store_div, ":renown_bonus", ":troop_renown", 25),
        (val_add, ":limit", ":renown_bonus"),

        (try_begin),
          (faction_slot_eq, ":faction_id", slot_faction_leader, ":party_leader"),
          (val_add, ":limit", 100),
        (try_end),

        (try_begin),
          (faction_slot_eq, ":faction_id", slot_faction_marshall, ":party_leader"),
          (val_add, ":limit", 20),
        (try_end),     

        (try_for_range, ":cur_center", castles_begin, castles_end),
          (party_slot_eq, ":cur_center", slot_town_lord, ":party_leader"),
          (val_add, ":limit", 20),
        (try_end),   
 
      (try_end),
         
      (store_character_level, ":level", "trp_player"), #increase limits a little bit as the game progresses.
      (store_add, ":level_factor", 80, ":level"),
      (val_mul, ":limit", ":level_factor"),
      (val_div, ":limit", 80),
      (assign, reg0, ":limit"),
  ]),
Thats very nice to know, it gives great chances to expand the content, thanks again.