Expand description
Typed FAC (.fac) faction table and conversion helpers.
FAC (.fac) typed generic wrapper.
A FAC resource is the whole session’s faction table: the roster of factions
and how each one feels about every other. There is one per session, keyed on
the resref REPUTE, not one per creature. Objects (.utc, .utd, …)
carry only a faction id that indexes into this table.
§Field Layout
FAC root struct
+-- FactionList (List<Struct>)
| +-- FactionName / FactionParentID / FactionGlobal
+-- RepList (List<Struct>)
+-- FactionID1 / FactionID2 / FactionRep§The sparse matrix
Reputation is stored sparsely, and this is the one thing to get right.
An absent pair means 100, which is friendly, not 0, which is
hostile. Reading RepList directly and treating misses as zero turns the
entire galaxy against the player. Use Fac::reputation, which applies the
baseline.
That baseline applies to a pair with no entry at all. A present entry
missing only its FactionRep is a different case and lands on 0, which
is what FacReputation::standing declares.
docs/src/formats/gff/fac.md has the rule and how the engine rebuilds the
full matrix from it.
Structs§
- Fac
- Typed FAC model built from/to
Gffdata. - FacFaction
- One faction from the
FactionList. - FacReputation
- One stored standing from the
RepList.
Enums§
- FacError
- Errors produced while reading or writing typed FAC data.
- FacReaction
- How a standing reads at the script layer.
Constants§
- DEFAULT_
REPUTATION - Standing applied to any faction pair with no stored
RepListentry.
Functions§
- author_
fac - Authors the FAC file the typed view describes, into a writer.
- author_
fac_ to_ vec - Authors the FAC file the typed view describes, as bytes.
- read_
fac - Reads typed FAC data from a reader at the current stream position.
- read_
fac_ from_ bytes - Reads typed FAC data directly from bytes.