Battle Brothers

File information

Last updated

Original upload

Created by

Seth

Uploaded by

seferonipepperoni

Virus scan

Safe to use

Tags for this mod

About this mod

A comprehensive and configurable themed overhaul of enemy camps and caravans designed to greatly expand the late-game experience.

Requirements
Permissions and credits
Changelogs

Overview

The largest themed project in RPG Rebalance so far, Raids is the culmination of months of research, scripting, revising and testing, designed with the intention of providing greater depth and complexity to pre-existing game systems while attempting to adhere to the design philosophy that led to their creation. 

In its current state, the mod does the following:

  • Overhaul enemy camps with a new Agitation system, where camps grow progressively stronger and hold more worthwhile loot and higher named loot chance as players engage and defeat roaming parties within their territories.
  • Overhaul caravans by reworking caravan loot. Caravans now possess additional tracked properties - Wealth and Cargo - both of which are determined by a number of factors associated with their settlement of origin. Caravan troop compositions are now bolstered with a diverse array of new enemy types.

  • Introduces an extensible and intuitive framework (Edicts) to dynamically modify the behaviour of enemy camps, built with the intention of producing novel gameplay opportunities and modes of player expression.


Note: Please consult the pinned post in the top of the comments section for the latest information. Information listed below may be out of date.



Overview

The base game internally tracks different kinds of hostile locations, segregated by types which include unique locations (e.g., Black Monolith), passive locations (hideouts and caves), and lairs (bandit fortresses, nomad and barbarian camps, and most other hostile locations). Each of these locations have assigned to them a "resources" property, which (somewhat inconsistently) acts as a catch-all restraint on many other location properties, such as troop and loot composition.

With Raids active, lairs now reflect new information on their tooltip, which now displays resource count and a new property called 'Agitation'.



The second and third entries here are the lair's resources and current Agitation, respectively.

A lair's Agitation is increased as successive roaming faction parties within the territory of a lair are defeated by the player. If multiple eligible lairs are within proximity of the player, all lairs have their Agitation appropriately incremented if other conditions obtain.

As of v3.0.0, the primary mechanism by which a lair's Agitation is increased is through Edicts (more in the Edicts section).

As Agitation increases, lairs gain additional resources - the factor by which a lair's base resources are multiplied per agitation interval is (partly) user-configurable. Increases in Agitation allow for lairs to muster a larger number of more powerful troops in its garrison, and also to store more valuable loot in greater proportion within the lair's inventory. 


Agitation


Agitation, as its name suggests, is an abstracted representation of the collective mental states of a lair's denizens/leader - more specifically, it denotes their perception of how much of the surrounding territories are within their control, and the degree to which they feel threatened by a persistent and hostile presence within their territory.

Agitation may occupy four states:

  • Relaxed, the default state, at which the actual resources of a lair is exactly its base resource count,
  • Cautious, an intermediate state,
  • Vigilant, an intermediate state,
  • Militant, the state occupied by lairs at maximum Agitation.


    
    The maximally Agitated state.
    
Agitation has a natural tendency towards stabilization - every in-game week that passes without further Agitation leads to a decrement of the total Agitation value. 

Scaling

All lairs in the base game possess their own intrinsic resources values - for instance, barbarian sanctuaries have 325 resources, whereas hidden nomad camps have 180 resources. Raids does not directly modify these intrinsic values, but instead opts to scale them up as their Agitation value increases. The degree to which a lair's resources are scaled up is highly contingent upon its base resource value, but as a general rule of thumb, a lair's actual resource count will be roughly twice its base resource count when its Agitation is at its maximum value.

A lair's resources can never exceed 700 (as of v3.0.0), and lairs with higher base resource counts gain fewer resources per Agitation interval than lairs with lower base resource counts.
 
As a lair's resources scale in accordance with its Agitation, roaming parties spawned from the lair grow stronger accordingly. The degree by which such parties become stronger is user-configurable. 

As of v3.0.0, lairs also spawn parties more frequently as Agitation increases, more than halving its base spawn cool-down at maximum Agitation. The higher the Agitation, the tougher and more frequent the spawns.

Higher Agitation lairs contain increasingly rarer and more powerful troop types with late-game gear, a greater quantity and diversity of valuable loot, and significantly higher chances of having named weapons and armor. This is intended to provide the core motivation for players to engage with Agitation as a game mechanic. 


Decay

Lairs do not remain Agitated forever - each lair loses one level of Agitation per in-game week, all other things being equal. This loss of Agitation is accompanied by a recalculation of the lair's resource count, named loot chance and garrisoned troop composition. In addition, the loss of Agitation triggers an appropriate depopulation of named items in the lair's inventory, which prevents undue accumulation of named items due to successive shifts in Agitation.

The tooltip also reflects new information pertaining to the number of days remaining before Agitation decay, only visible when a lair becomes Agitated. This information is crucial for the use of Edicts (see below).


The number of days shown here correspond to the time remaining until the next Agitation decay.


To prevent Decay, a lair must be continually Agitated. Each increase in Agitation resets a lair's decay timer.



Eligibility

Enemy camps that are not considered lairs by Raids will be entirely excluded from Agitation tracking and related procedures. These excluded camps typically include temporary bandit hideouts, small-scale nomad camps, orc-infested caves, etc. - locations that also tend to possess lower resource counts than lairs proper. These locations function exactly as in the base game.

Named Loot

In the base game (barring contracts), the inventories of eligible lairs are populated with (generally faction-specific - Raids offers a configurable chance to decouple this relationship) named loot upon spawning, the chance of which is calculated by considering the lair's distance from settlements and its base resources. This inventory is essentially static - the named items held by a lair are permanent fixtures, unless cleared by appropriate contracts.

Raids adds upon this base chance by considering its Agitation. Further increases in Resources have no effect on a lair's named loot chance - the base chance is calculated on lair spawn and is therefore a static value. At maximum Agitation, all lairs gain a flat 40% (v3.0.0) chance to gain (or lose) named items. This ensures that all lairs, if the effort is taken to drive them to maximum Agitation, can feasibly drop named items.

A lair's eligibility to store (new) named items is evaluated once every Agitation cycle. Agitation decays trigger a depopulation of named loot. Increases in Agitation trigger a repopulation of named loot. The greater the Agitation, the greater the potential gain - but also the greater the potential loss.

Optimal use of new functionality brought about by Raids will lead to more named items in general for a given playthrough. To compensate for this, Raids offers a user-configurable setting to depopulate all lairs of their named loot (based on its named loot chance) on spawn.

Proximity

Proximity information is not conveyed explicitly. Players can check if they are within proximity of a lair (<6 tiles) by examining the lair's tool-tip and checking if Agitation information is displayed.


This proximity threshold also applies to Edicts (see below).

Technical

Agitation updates do not occur as background processes, but are rather triggered by tool-tip events (hovering the cursor over a lair's sprite) or by combat events while within the proximity of a lair.

If a lair becomes the target of an active contract, Raids resets the lair's Agitation (and resources), depopulates its named loot pool appropriately, and exempts the lair from Raids' functionality until the contract is completed or aborted. In addition, Raids will not handle spawns that are the explicit target of an active contract, regardless of whether or not Raids is configured to scale roaming parties.





Overview

Neither trade nor supply caravans are especially attractive beyond the early-mid game for a number of reasons. Although Raids alone is not intended to dramatically change that, it is designed with the intent to give significantly greater depth to caravan raids for those inclined to go outlaw.

Raids attempts to accomplish this by tracking caravan Cargo and Wealth, two new properties derived directly from that of their origin settlement.



The fourth entry from the top down displays a caravan's Cargo, and the succeeding entry its Wealth.


Wealth

Like the Agitation property of lairs, caravan Wealth can occupy four values, (1–4). Wealth primarily controls two things - the total number of items of a particular Cargo type in a caravan's inventory, and the total number of reinforced troops for a given caravan's troop composition.

Wealth is determined by the state of affairs of the caravan's originating settlement, taking into account its size, ownership, and ongoing situations.

As of v1.1.0, attacking caravans now incurs the "Ambushed Trade Routes" situation on the originating settlement. If the situation is already present, its duration is extended by an additional 4 days, up to a maximum of 16 days. This situation alone is very often enough to reduce the Wealth of outgoing caravans, so players are encouraged to remain mobile and cycle between different settlement targets regularly.

Military settlements and southern city-states provide a flat +1 to the wealth of their own caravans. Settlements of the largest size provide an additional +1. Settlements with more positive situations than negative also provide an additional +1 (conversely, settlements with more negative situations incur -1 to Wealth). Finally, there is a base random offset that provides either +1 or +2 to the overall Wealth value of a caravan. This does effectively mean that smaller, non-military settlements can never produce a caravan of the highest Wealth value (4), whereas southern city-states can never produce caravans with a Wealth value below 3, making them the most consistently lucrative targets for caravan raiders.

Cargo

Caravan cargo can be either of the type Supplies or Trade. These categories mimic vanilla nomenclature and therefore mostly separates food produce (along with tools, meds, and ammo) from trade goods.

Caravans with Supplies or Trade cargo will have their inventory populated by items directly drawn from the produce of their origin settlement, just as in the base game. This can dramatically change the value of a caravan's inventory - a lowly village with only a Mushroom Grove produces far less valuable caravans than an equivalent settlement with an Amber Collector. Paying attention to the attached buildings of a settlement is key to rewarding caravan raids.

Conversely, some rarer caravans spawn as wildcards, not drawing their inventories from their origin settlement's produce - these caravans have the Assorted cargo type and will have (mostly) random cargo, drawn from both Supplies and Trade items. This should ensure that all settlements have the capacity to produce caravans with worthwhile loot, albeit with varying frequency. 

The final cargo type is Unassorted, which essentially follows base game goods distribution mechanisms, but scaled by Wealth. The Assorted and Unassorted cargo types are the types Raids defaults to when a caravan's origin settlement is not eligible to produce caravans with Supplies or Trade cargo types. These types are, by design, relatively uncommon.




Troop Composition

The nature of a caravan's Cargo and Wealth also now dictates its troop composition. While no changes have been directly made to the vanilla spawn list or spawning procedures, Raids dynamically reinforces caravan troop composition upon spawn in accordance with assigned parameters.

For non-military caravans, reinforcement draws from mercenary troop pools, whereas military caravans draw further from their own troops - for the caravans with high caravan Wealth and Cargo, the strongest troops in the game make an appearance, including Hedge Knights, Swordmasters, and Master Archers (and more).

Southern caravans will also make use of their own faction-specific elite troop types. As southern city-states tend to much more consistently produce wealthier caravans, caravan raiders can expect southern caravans to be more consistently guarded by stronger troops.

The appearance of stronger troop types is tethered to the passage of time in the game world. Raids will not spawn caravans bearing named loot or powerful troops until a certain number of days have elapsed within the current playthrough.


Named Loot

Past the 50th day of a campaign, caravans that spawn with the highest possible Wealth value (4) have a chance to carry named items (in addition to their ordinary Cargo). This chance is, by default, 5% (v1.0.0) per spawn, if conditions obtain. These restrictions ensure that such caravans are quite rare - and when they do occur, they will never carry more than one named item at a time, and will always be fiercely guarded by the strongest enemies in the game.



Caravans like the one pictured are exceedingly rare.

Technical

Raids intercepts caravan spawn orders, calculates and applies the Cargo and Wealth flags to the caravan, reinforces its troops as appropriate, and then ceases operation.

Raids does not remove items added to Caravans from the base game, but instead only adds upon it. If a caravan's Cargo is flagged as Trade but the attached buildings of a settlement do not produce trade goods, Raids reassigns the caravan to have either the Assorted or Unassorted cargo types.

Raids is written to ignore caravans that spawn as part of an active contract. Therefore, escort caravan contracts function identically to the base-game, as do contracts that involve intercepting and destroying hostile caravans.



Overview




Raids conceives of a system of modifiers to lair behaviour through Edicts, which are consumable items with an array of different effects. These effects can range from simply incrementing a lair's Agitation or tuning its loot distribution to significantly altering the strength of parties spawned by the lair. These effects can be temporary or permanent, and can be combined and used sequentially to achieve desired behaviours. 

Edicts are designed to reward thoughtful and meticulous play, and to add a rich and complex layer of strategy to lairs as a game mechanic.

Function

Edicts, when used, affect all lairs within proximity. Each lair has a maximum of three Edict slots.

Edicts can have effects that are either temporary or permanent. Permanent Edicts persist (irrespective of Agitation changes) until the affected lair becomes the target of an active contract. Permanent Edicts can also be removed by a unique Edict known as the Edict of Nullification.

The effects of temporary Edicts persist until the affected lair undergoes an Agitation decay, or becomes the target of an active contract. Increases in Agitation trigger a refresh of the effects of all temporary Edicts, extending their durations until the next Agitation decay.

Temporary Edicts have the unique property of vacating their occupied slot once in effect, allowing players to apply multiple temporary Edicts in succession, all active at once (until the next Agitation update). Permanent Edicts occupy an Edict slot indefinitely (unless removed), independent of Agitation.

Edicts always occupy one of two states:

  • Active, which is the default state and signifies an edict in operation, and
  • Discovery, which is the initial, inoperative state occupied by a recently dispatched edict.



Active temporary Edicts (displayed in the History entry of the tooltip) will be cleared when a lair's Agitation decays, but temporary Edicts in Discovery will not. Permanent Edicts are never cleared.

If all three Edict slots of a lair are occupied by permanent Edicts, no further Edicts can be applied to that lair.

Acquisition

Note: This section is currently (3.0.0) under renovation.

Edicts are acquired through the use of official documents. Official documents can be found in the inventories of lairs, passive locations (hideouts, smaller camps, non-lair, non-unique locations), and caravans.

When used, all other things being equal, official documents produce a random Edict, chosen from 9 types (v3.0.0). The outcome of any Edict generation can be modulated through the use of writing instruments, which are sold in the marketplaces of large cities and citadels. Through writing instruments, players can also consistently acquire Edicts of Agitation, which constitute the primary mechanism by which Agitation is raised.

Lairs carry up to four official documents, scaling linearly with their current Agitation.
At baseline Agitation (Relaxed), lairs still carry a minimum of one official document. Passives carry a random number of official documents, but never greater than two at any given time.

Each caravan will also carry no more than two of these items at a time. The base chance for acquiring an official document from a caravan is user-configurable. Supply caravans have an added +35% (v1.0.0) chance to carry an official document within their inventories. The chance to carry official documents is influenced by a caravan's Wealth.
When acquired and present in the player's inventory, right-clicking on the Official Document item icon will produce a random Edict.


Types

As of v3.0.0, there are 9 Edicts in Raids, each with varying effects and persistence conditions, all of them designed to be highly impactful. A full list has been provided in the Articles section.

Each Edict, besides having either permanent or temporary effects, has its own Discovery period, which also behaves as an indirect constraint on the maximum number of concurrent edicts that can be activated within a particular Agitation decay interval. Temporary Edicts tend to have significantly shorter Discovery periods than permanent Edicts.

The effects of different Edicts can scale with respect to a lair's Agitation, Resources, or they may not scale at all (Static). As lairs come with widely varying base resource values, some Edicts may prove much more effective on particular lairs than others. Edicts that possess non-static scaling modalities tend to scale very strongly with their associated properties. Players looking to maximize the utility of a particular Edict should pay close attention to this.


Faction

By default, only the lairs of brigands, nomads, zombies, and barbarians can be targeted by Edicts.

All other factions (goblins, orcs, and ancient undead) will require a special Edict (an Edict of Legibility) to be able to be targeted by other Edicts. This Edict is permanent, and will therefore leave only two vacant slots for other Edicts to take effect. This restriction exists owing to the fact that lairs occupied by these factions tend to have very high resource values, and can possess garrisons strong enough to rival that of legendary locations.

Lairs with hidden banners can never targeted by Edicts, regardless of the inhabiting faction.


History
As stated above, Raids cycles out temporary Edicts from their occupied slot the moment they come into operation. To ascertain which temporary Edicts have been applied, Raids keeps a record of the same and displays this list at the bottom of a lair's tool-tip. 


The final entry in this tool-tip lists all of the temporary Edicts in effect.

This allows players to keep track of what edicts are active for a lair within a given Agitation cycle.


Technical

Edicts cannot be applied to lairs that are active contract targets. Upon becoming the target of a contract, a lair clears its active Edicts and purges its Edict History. This is done to ensure contract balancing and type distribution (globally) is preserved.

Edict effects are applied only when an active Edict exits the Discovery period, and upon refresh (IE, upon Agitation increment). Edict timers are tracked only through tool-tip events (as with Agitation). 

Configuration

MSU is not a dependency of Raids, but Raids will interface with it to provide additional functionality if it is present.
Without MSU, Raids cannot be configured.

Further guidance on configuration will eventually be provided in the Articles section (pending). 


Installation/Updates

A new game is required. Raids will not work correctly with ongoing playthroughs.

Drop the zip file into Battle Brothers\data. Do not extract the zip file.

If updating, please delete the pre-existing file before placing the zip within your data folder.

Note that I will be loosely adhering to SemVer specifications to indicate which versions are backwards-compatible. Minor version bumps are intended to convey the introduction of new functionality which does not strictly require a new game (but a new game may be strongly recommended). Major version bumps require a new game.

Please exercise discretion when deciding to update (or not) by consulting the changelog, which will always be updated and will always strive to be comprehensive.


Uninstallation

Remove the zip file from Battle Brothers\data. 

Please do not attempt to remove mods from ongoing playthroughs.


Dependencies

This mod was tested on modding script hooks v21.1. Older versions may work, but are unsupported.
This mod is supported only on games that have all DLCs.
MSU v1.2.7 will allow for mod settings configuration, but is otherwise optional. Older versions may work, but are unsupported.


Known Issues

There are no issues being tracked as of v3.0.0. Please report bugs in the Bugs section along with your log file (found in Documents\Battle Brothers).


Compatibility

Please report compatibility issues in Posts along with your log file (found in Documents\Battle Brothers).

Compatibility with Legends is, as of v3.0.0, unknown. Strictly speaking, Legends is not supported, and as of v4.0.0, there are no current plans for Legends compatibility.

If you'd like to make a patch for Legends, please feel free - no credit or permissions necessary.


Credits & Thanks

AdamMil01 for modding script hooks.
Paul Taaks for the incredible art of Battle Brothers, as used in the thumbnail.
The MSU team for MSU.
Additional sound effects from ZapSplat.