SP Native Soldiers of Fortune (More Mercs, Pool Injection, AI Recruitment & Configuration!)

Users who are viewing this thread

Яowan

Grandmaster Knight
Soldiers of Fortune is a mod all about mercenaries and their ilk - it expands upon the vanilla tree, adding a variety of new mercenary troops, and introduces new (cultural/regional) mercenary troops. And importantly, it introduces new ways of hiring these mercenary units - and even gives the AI the ability to recruit them! With this mod they will be available for recruitment in towns and villages.

Started off as something small, and turned into a highly customisable (courtesy of ModLib by mipen) "mini-overhaul" for Mercs.

How Does Soldiers of Fortune Work?
-------------

Soliders of Fortune takes advantage of Harmony to patch Native/Vanilla methods (UpdateVolunteersOfNotables & GetRecruitVolunteerFromIndividual) to attain the desired effect. If "Core" is enabled, it'll replace the UpdateVolunteersOfNotables method - whilst if that option is disabled, the mod will function solely as a troop tree mod.

It does not touch tavern recruitment.

What does it do?
-------------

It does two things.

Troop Tree Modifications
  • Expands upon the Native mercenary troop tree, branding them as 'Western' mercenaries. Pikes, Macemen, Bowmen and Crossbowmen all have a place in the tree.
    • Also introduces female western mercs in a similar style to the Warband female merc tree. Just like in Warband they have a rough start and are fairly weak for their tier, but the trees finish with some top of the line troops.
      • If you do not like having female mercs, which have a 10-15% rate of spawning in place of a male western merc, you can lower the spawn rate to 0.
  • Introduces an "Eastern" mercenary troop tree, featuring camelry and skirmishers. Aesthetics and equipment are a mix of Southern and Eastern equipment.
World Recruitment Pool Changes
  • Introduces the new mercenary troops to the recruitment pools of towns and villages.
  • Availability of mercenary troops is based on the culture of the city or village (and when using mods like DynaCulture, the Mercs present will also shift with the culture).
  • Everything can be customised (or if it can't yet be, will be customisable).
  • Player faction settlements can also be adjusted (disabled by default, overrides per culture settings). If you really want to, you can establish yourself as a generic mercenary Kingdom, with mercenaries flocking at a configurable rate (perhaps even replacing local recruits entirely!).

What can I customise?
-------------

You'll need ModLib for this, otherwise you'll be stuck with the default settings.
  • The mercenary preferences for each Culture can be adjusted, even mid save, to match your tastes.
  • Whether not mercenary troops are injected into the world, and the rate of inject (20% by default).
  • Whether or not the AI Recruits Mercenary troops, or the rate in which they recruit them, in case you don't like seeing them in AI armies (or want to see fewer recruited).
  • Per culture tweaking:
    • Presence of Eastern versus Western cultured Mercenary troops, wherein you can have one or the other, or somewhere in between.
    • What the distribution of Ranged versus Melee is - some cultures can be configured to promote one over the other.
  • What the distribution of Ranged versus Melee troops is on a culture-by-culture basis. Battania has a greater number of hunters, whilst Vlandia has an abundance of Watchmen.

Compatibility
-------------

  • This mod should be fairly compatible with other mods. It does replace via Harmony the method UpdateVolunteersOfNotables, however, so may have issues with certain mods. However, it makes edits (via XML override) to the Native/Vanilla mercenary units (to implement fixes, and allow upgrading of those units to the new merc types).
  • It is named 'zSoldiersofFortune' to force later loading, to favour changes made by this mod over those made by other mods, so if other modders are being polite with their naming convention, then this mod should generally load last.
  • This mod is existing-savegame compatible, but cannot be removed from an existing save after use due to troop tree edits. Removing from a game in progress will cause crashes. You have been warned!

Installation
-------------

  • If installing a new version, delete the old version prior to installing.
  • Otherwise extract the mod folder named 'zSoldiersofFortune' to your modules folder:
    • For example: C:\Program Files (x86)\Steam\steamapps\common\Mount & Blade II Bannerlord\Modules
  • Active the mod in the mod launcher.

r2.0.3
  • Fixed setting impact on what troops were chosen. Maths were effectively fubar'd, and individual faction settings weren't working as expected. Added some extra logic checks to prevent weird behaviour.
  • Fixed Western Hunter Population, as the logic did not account for ranged western units.
  • Adjusted weighting scale of Culture Composition and TroopType Composition to be a 0-200 scale rather than 0-100. Related maths adjusted.
r2.0.0
  • Updated for e1.3.1
  • No longer requires ModLib - but it is recommended (or the use of a equiv mod) for the freedom to adjust settings.
  • AI Recruitment of Mercenaries now also blocks hiring of higher tier mercenary units. So whilst previously the setting prevented hiring of watchmen, hunters and the sort, it unintentionally did not prevent hiring of Hirelings, Spearmen and so on so forth. Additionally fixed some issues with the related settings, meaning it should now always work as expected.
  • You can now configure mercenary types, cultures and more on a per-faction basis. You cannot currently adjust frequency/occurrence on a per-culture basis (yet, an oversight).
  • You can configure the player to be a mercenary faction, replacing cultural units with mercenary units - if you want more, less or only mercs in your own settlements, tweak these!
    • Untested, so please let me know if this is broken.
r1.2.0
  • Rebuilt SoF for the latest (1.2.0) bannerlord binaries
  • Added a female (western) troop tree. To create unit diversity, female troops are lighter, faster and more proficient. Female troops are somewhat more rare than male.
  • Rebalanced base rates a little for varying cultures. Base frequency of mercs is slightly higher.
r.1.1.8
  • Hotfix for 'Core is disabled' windows message box spam when the Mercenary Core is disabled.

r1.1.7-21-APR-20
  • Rebuilt SoF binaries using Taleworlds 1.1.2 binaries
  • Removed debug "sof_debugger" unit. This change may break saves if you, for any reason, added this unit to any parties.
  • Revised equipment for the Mercenary Swordsman troop
  • Revised equipment for the Hired Blade troop
  • Revised equipment for the Mercenary Crossbowman troop
  • Revised equipment for the Hired Crossbowman troop
  • Revised equipment for the generic Watchman troop (should be more distinct)

v1.1.0
  • ModLib integration/dependency
    • You can now adjust via ingame settings: Whether or not the mercenary troops are injected into the recruitment pool globally.
    • You can now adjust via ingame settings: The rate of occurrence as a global modifier for mercenary troops (50% through to 200% of base values).
    • You can now adjust via ingame settings: Whether or not the AI will recruit mercenary troops.
    • You can now adjust via ingame settings: If the AI recruits mercenary troops, the chance of 'successfully' recruit a mercenary troops. 'Failure' replaces the mercenary troop with a recruit of the party's culture. This intercepts the TaleWorlds.CampaignSystem.Actions GetRecruitVolunteerFromIndividual to achieve the effect.
  • Rewrote how mercenary troops are injected - they are now assigned and distributed on a per culture basis, and will replace generic cultural recruits only. Mercenaries of Western/Eastern type will be more common in their 'home' cultures.
  • Fixed group assignments for: Eastern Hunters, Eastern Caravan Guards and Native Caravan Guards and adjusted their equipment slightly.
v1.0.2
  • First pass on Western Mercenary Equipment (Hirelings, Mercenary Macemen, Mercenary Spearmen). More changes pending.
  • Removed (for now) changes to EliteBasicTroops, as the related changes were not fitting, and may've been causing a crash under specific circumstances (related to LordNeedsGarrisonTroopsIssue.get_NeededTroopType).
v1.0.1
  • Resolved issues pertaining to the release build.
v1.0.0
  • Initial release.
 
Last edited:
New version release - 1.1.0
Pretty major update, took a fair amount of head-scratching to get working (and from limited testing appears to be working as intended, but would appreciate feedback regarding functionality, and notably if it is working as expected).
Should be savegame compatible.

  • ModLib integration/dependency
    • You can now adjust via ingame settings: Whether or not the mercenary troops are injected into the recruitment pool globally.
    • You can now adjust via ingame settings: The rate of occurrence as a global modifier for mercenary troops (50% through to 200% of base values).
    • You can now adjust via ingame settings: Whether or not the AI will recruit mercenary troops.
    • You can now adjust via ingame settings: If the AI recruits mercenary troops, the chance of 'successfully' recruit a mercenary troops. 'Failure' replaces the mercenary troop with a recruit of the party's culture. This intercepts the TaleWorlds.CampaignSystem.Actions GetRecruitVolunteerFromIndividual to achieve the effect.
  • Rewrote how mercenary troops are injected - they are now assigned and distributed on a per culture basis, and will replace generic cultural recruits only. Mercenaries of Western/Eastern type will be more common in their 'home' cultures.
  • Fixed group assignments for: Eastern Hunters, Eastern Caravan Guards and Native Caravan Guards and adjusted their equipment slightly.

Fantastic this is the sort of thing I was looking for.

Happy to hear! Made it for myself, but thought others might want the same feature-wise!
 
  • This mod is existing-savegame compatible, but cannot be removed from an existing save after use due to troop tree edits. Removing from a game in progress will cause crashes. You have been warned!

I've been having crashes upon loading the game after updating to the newest version do you think it would be related to this?
 
I've been having crashes upon loading the game after updating to the newest version do you think it would be related to this?

Updating from any prior version shouldn't introduce a crash upon loading the game or a save.

Basically due to way troops work, if you use any version of this mod in a save, remove the mod entirely, and then attempt to continue said save (which had this mod enabled in previously) it will break things. You may also see similar issues if you use another mod that conflicts (in this case, makes edits to the native mercs "before" mine does).

If you're crashing on game launch rather than on loading of a save, best bet is that you're missing the ModLib dependency, so make sure you have that installed and enabled (and loaded before my mod, which it should by default due to naming convention). You may also need to make sure your anti-virus isn't blocking the SoldiersofFortune DLL, though I believe that results in a launcher crash instead.
 
If you're crashing on game launch rather than on loading of a save, best bet is that you're missing the ModLib dependency, so make sure you have that installed and enabled (and loaded before my mod, which it should by default due to naming convention). You may also need to make sure your anti-virus isn't blocking the SoldiersofFortune DLL, though I believe that results in a launcher crash instead.

Yup, this was it thanks!
 
r2.0.3 Released. Hotfix and minor revisions.

  • Fixed setting impact on what troops were chosen. Maths were effectively fubar'd, and individual faction settings weren't working as expected. Added some extra logic checks to prevent weird behaviour.
  • Fixed Western Hunter Population, as the logic did not account for ranged western units.
  • Adjusted weighting scale of Culture Composition and TroopType Composition to be a 0-200 scale rather than 0-100. Related maths adjusted.

r2.0.0 Released, with a lot of customisation options.

  • Updated for e1.3.1
  • No longer requires ModLib - but it is recommended (or the use of a equiv mod) for the freedom to adjust settings.
  • AI Recruitment of Mercenaries now also blocks hiring of higher tier mercenary units. So whilst previously the setting prevented hiring of watchmen, hunters and the sort, it unintentionally did not prevent hiring of Hirelings, Spearmen and so on so forth. Additionally fixed some issues with the related settings, meaning it should now always work as expected.
  • You can now configure mercenary types, cultures and more on a per-faction basis. You cannot currently adjust frequency/occurrence on a per-culture basis (yet, an oversight).
  • You can configure the player to be a mercenary faction, replacing cultural units with mercenary units - if you want more, less or only mercs in your own settlements, tweak these!
    • Untested, so please let me know if this is broken.
 
Back
Top Bottom