How can I generate larger parties of bandits and raiders, etc.?

Users who are viewing this thread

Mordachai

Squire
I'm hoping I can influence the number of troops generated in a given party through the scripts, so that I can give the player a difficulty level control.

I can see that the bandits of various stripes are spawned by script_spawn_bandits.  However, that seems to just try to maintain about 14 parties.  And the number of units per party seem to be dictated by the party templates for the various types of bandits.

What I am not seeing is how the game dynamically increases the size of bandit spawns as your level goes up - but I have lots of anecdotal evidence that it does this.  Clearly, I run into little groups in a new game... but in a well established game bandit stacks are much larger.

Any ideas where i should look?  SoD's early game is really .. slow ... due to a lack of enemies to fight that are on your level... the bandits are in such small groups that they outrun the player, and when you do get lucky and engage a bandit stack, there's like 8 of them to your 50....

Help?!
 
If you increase your level there will be higher bandit groups, and you can change in the module_parties.py the max and minimum number of soldiers.
 
This is the script that increases party sizes over time:
Code:
  #script_update_party_creation_random_limits
  # INPUT: none
  ("update_party_creation_random_limits",
    [
      (store_character_level, ":player_level", "trp_player"),
      (store_mul, ":upper_limit", ":player_level", 3),
      (val_add, ":upper_limit", 25),
      (val_min, ":upper_limit", 100),
      (set_party_creation_random_limits, 0, ":upper_limit"),
      (assign, reg0, ":upper_limit"),
  ]),

It is called at the start of a new game and also by a simple trigger every 24 hours.
 
I have a related question so I hope you don't mind my putting it in here, there seems to be something of an epidemic of new threads at the moment.

Anyway here's the question:

Bandit AI. How do bandits know they have to go on patrol? I can't find a single instance anywhere in the code of where they are set to ai_bhvr_patrol. Nowhere. There are no simple triggers processing their AI and the script that spawns them does exactly that: spawn them. Nothing else. The spawn points themselves in module_parties are obviously set to ai_bhvr_hold and there is nothing in the party_templates that could explain it.

Any thoughts?
 
Well, there is this in module_simple_triggers that determines how tempting a target the player is, but it doesn't explain how they go on patrol:
Code:
 #Update how good a target player is for bandits
  (2,
   [
       (store_troop_gold, ":total_value", "trp_player"),
       (store_div, ":bandit_attraction", ":total_value", (10000/100)), #10000 gold = excellent_target

       (troop_get_inventory_capacity, ":inv_size", "trp_player"),
       (try_for_range, ":i_slot", 0, ":inv_size"),
         (troop_get_inventory_slot, ":item_id", "trp_player", ":i_slot"),
         (ge, ":item_id", 0),
         (try_begin),
           (is_between, ":item_id", trade_goods_begin, trade_goods_end),
           (store_item_value, ":item_value", ":item_id"),
           (val_add, ":total_value", ":item_value"),
         (try_end),
       (try_end),
       (val_clamp, ":bandit_attraction", 0, 100),
       (party_set_bandit_attraction, "p_main_party", ":bandit_attraction"),
    ]),

There is also the "party_set_ai_state" script. If default bandit behavior states are not hardcoded somehow, I'm guessing it's related to that script somehow.
 
yeah I saw the bandit attractiveness script but I still don't get where the actual AI is set.. when they spawn, they should be on bhvr_hold and not magically start patrolling :smile:

It can't really be hardcoded because how does the computer know if it's a bandit or not? Unless the factions are hardcoded but that would be a little strange.

What do you mean by the party_set_ai_state script? can;t find that one.
 
Search for "Enemies spotted near" in module_scripts. The script "party_set_ai_state" should be just below that around line 8341. Also, I noticed that in module_party_templates, every party template has a set personality except the reinforcement parties (the only ones that don't spawn on the map). All of the various bandit party templates use the bandit_personality which in header_parties is defined as:
Code:
bandit_personality   = aggressiveness_3 | courage_8 | banditness

And there is a pf_default_behavior though none of the bandit party templates use it. I'm not sure if any of this info helps, but it could be related.
 
ah yes.. banditness.. that must be it!

Cause that script is used globally to change AI states for parties but since I can't find anywhere that processes bandit parties, I don't think that applies in this case. It's used for kingdom hero parties.

Will have to test what happens if I spawn the bandit parties without banditness. Thx
 
Back
Top Bottom