Factions, Superfactions Documentation
Factions, superfactions, reputation
Each NPC must belong to a faction in order for its reputation to work properly. And NPC without a faction has default reputation value of 0, which results in near unfriendly relationship and the NPC refuses dialogs.
There are 2 distinct grouping tools - factions and superfactions - and the combination of their settings allows some level of dynamicity and granularity.
Factions, superfactions and their relationship are defined in DB tables faction, superfaction, and superfaction2superfaction_relationship.
Factions are definitions of basic groups with these spatial relationships (defined via locations) which heavily influence propagation of reputation and other (primarily crime-related information) throughout the world map. Factions can also be listed in the games UI for the player to track his relationship to them.
Factions define the starting reputation with the player but NOT with one another. That is handled by superfactions and each faction must be linked to one.
An NPC-faction relationship is static and cannot be changed dynamically. That is also where superfactions factor in.
Superfaction are different set of groups and are generally used to define inter-faction relationships and allow dynamic changes.
Relationships are defined in superfaction2superfaction_relationship DB table and this table requires the relationships the be defined in both (mirrored) directions and there must be NO discrepancy. That is both definitions
faction1 -> faction2 = 0.5
faction2 -> faction1 = 0.5
must be present. Otherwise the whole system falls apart.
Reputation is a value which ranges between -1 and 1. If reputation is (or falls) below 0 the NPC will attack the member of the other faction on sight.
Each NPC has an individual personal reputation towards the player. This reputation start at the value defined by faction-player reputation in DB. The actual faction reputation changed over time as player interacts with the game, and functions as an average of all individual reputations of the faction’s members. And in reverse if the player receives a change (positive or negative) in faction reputation, this change is then reflected in personal reputations.
Reputation does not change over time (without input) and is not the same as angriness. Angriness is a part of the crime system and tends to lower itself over time. If angriness is high the people are more suspicious and guard count may go up. Both angriness and faction reputations can be reset by paying indulgencies in churches or by serving jail time.
In MBT trees you can use the nodes SetTemporarySuperfaction and ClearTemporarySuperfaction to temporarily change the individual NPC’s superfaction (and thus reputation) settings towards other factions, incl. player. This can be, for example, used to incite conflict between select members of otherwise mutually friendly factions, or to suppress a conflict between select members of mutually hostile factions.
Player belongs to faction Player’s faction which belongs to superfaction Player.