Skip to main content

Entities — Archetype Resolution and Instancing

Verified via reverse engineering

Traced via GhidraMCP against FarCry2_server (CEntityLibraryManager::BuildArchetypesMap, CEntitySystem::SpawnEntityFromNode, CReadOnlyMergeNode::BuildChildrenEntries and its attribute accessors) and Dunia.dll (CXGame::LoadArchetypes, the spawn and the merge node's accessors), with counts measured from a retail install.

An object in the world is described by up to three things at once: the library that defines its archetype, a library that overrides that definition, and the placed instance itself. This page covers how the engine collapses those into one live entity — which decides, for a modder, which file an edit has to go in to be visible at all.

The archetype table is one name-keyed map​

CEntityLibraryManager::BuildArchetypesMap(SerializableNodeRef const&) walks a library's categories, then each category's EntityPrototype children, reads the hidName of each prototype's Entity child, and inserts into a single

hashtable<CNoCaseStringID, ISerializableNode const*>

Three properties follow directly from that code, and any tool that reproduces it must match all three:

  • The key is the fully qualified hidName — Animals.Quadrupeds.CapeBuffalo, not the prototype's own shorter Name attribute.
  • Matching is case-insensitive, because the key type is CNoCaseStringID.
  • Insertion replaces. It walks the bucket chain for an existing entry with that id and, when it finds one, overwrites the node pointer instead of appending. Nothing is merged field by field at this level: a later definition replaces an earlier one whole.

Two callers fill that one map — ReadFromXML for a base library and Override for an override library — so the last library loaded wins.

A library's group order is not read​

BuildArchetypesMap is the only code that walks a library's tree. Its two callers do nothing with the root but retain it and hand it straight on, and CXGame::LoadArchetypes — their only caller — passes each loaded file through once. The two accessors that read the map back, CEntityLibraryManager::GetArchetypeDescription and GetArchetypeName, are bucket lookups keyed by the id; neither touches a group.

Traversal order therefore reaches the game only as which duplicate declaration survives the replace, and a duplicate is confined to a single group by construction, since the key is <group>.<prototype>. Reordering a library's groups cannot change any archetype the game resolves. Reordering prototypes within a group still can.

Which libraries load, and in what order​

CXGame::LoadArchetypes in the client:

if (flag at +0xC4 == 0) load "\entitylibrary.fcb"
else load "\entitylibrary_full.fcb"
load "generated\EntityLibraryPatchOverride.fcb"
then a loop over further libraries

The base is an either/or, not a stack — one of the two, never both. The patch override then loads unconditionally after whichever base was chosen, so it wins over both.

The trailing loop is the DLC libraries. That is read directly in the dedicated server, where the equivalent function calls CDlcService::GetEntityLibraries and passes each path it returns to CEntityLibraryManager::Override; Dunia's loop matches in shape but has not been read as the same call (see Unknowns). Their order among themselves is not established, and they load after the patch, so a DLC library wins over it.

Measured in a running game — the flag selects the suffix-less library in single-player

Which branch the campaign takes is measured, not inferred: the same weapon archetype staged into all six single-player containers at once, each carrying a different magazine size, shows which one the game reads:

worlds\tmpla\generated\entitylibrary.fcb 21
worlds\tmpla\generated\entitylibrary_full.fcb 22
worlds\world1\generated\entitylibrary.fcb 23
worlds\world1\generated\entitylibrary_full.fcb 24
worlds\world2\generated\entitylibrary.fcb 25 <- observed, playing act 2
worlds\world2\generated\entitylibrary_full.fcb 26

So the single-player client takes the flag == 0 branch and reads worlds\<world>\generated\entitylibrary.fcb — the suffix-less library — for the world it is in. _full is not read, and tmpla is not read.

Note this is the opposite of the reading the table below invites. _full being absent from the dedicated server binary shows it is not a server library; it does not follow that it is the client's base, because the client can take either branch and in the campaign it takes the other one.

entitylibrary_full.fcb appears only in the client: the dedicated server binary contains no reference to the string anywhere, while the suffix-less library appears in both. Measured over world1:

libraryarchetypesrelationship
worlds\world1\generated\entitylibrary.fcb1,419shared by client and server; what single-player reads
worlds\world1\generated\entitylibrary_full.fcb5,566strict superset, adds 4,147; not read in single-player
generated\EntityLibraryPatchOverride.fcb915loads last, wins — but see below
worlds\ige_map\generated\entitylibrary.fcb5,566identical content to _full

121 of the patch override's names are also declared by the world's own library, and 912 of them are declared by _full. That second number is why the either/or matters: if the two bases stacked, they and the patch would be contesting nearly every archetype the patch declares.

The replace-by-name rule also applies within one file: _full's 5,735 prototype nodes carry only 5,566 distinct names, and the 169 redundant nodes belong to 29 names it declares more than once. Only the last declaration of each survives the map. The base library and the patch override contain no such duplicates.

A world's library is a cut of _full​

(measured) Every one of world 1's 1,419 archetypes is in _full, so the world library reads as a cut of the full set. A cut made by rule reproduces it with nothing missing:

  • Roots: every archetype a string anywhere in world 1's placed entities names (its worldsector and landmark files, mapsdata, managers and omnis) or a Domino script quotes, plus 14 top-level groups kept whole: Beautifiers, buddies, cameras, Curves, Domino, engine, gadgets, pickups, player, PostFXs, props, tables, WeaponProperties, weapons.
  • Closure: every archetype a kept archetype names in a string field, repeated until nothing new turns up.

The whole groups are what nothing placed names. World 1 keeps all 113 Curves, all 105 WeaponProperties and all 8 cameras. Before props was whole, the cut lacked 70 of the hand-held items the animations use: syringes, cigarettes, the map, the machete. The cut keeps 2,305 archetypes against Ubisoft's 1,419. Most of the extras are editor IGE_Archetypes that world 1's own instances name but its library leaves out. Per what a missing archetype does, those instances never spawn in the campaign.

JackAll's world pack cuts a new world's library this way, adding enemy_archetypes and vehicle whole because spawners name them only at run time.

EntityLibraryPatchOverride.fcb does not ship in every edition

It is absent from the GOG Fortune's Edition. That install's patch.fat holds 215 entries, its only entity library is worlds\tmpla\generated\entitylibrary.fcb, and its four hash-only entries are 208–587-byte XML fragments. The name generated\entitylibrarypatchoverride.fcb (F43E63CB) is in the hashlist, so a present file would have been resolved by name — it is genuinely not there.

Steam's patch.fat carries it; the 915-archetype measurement above is that file.

The load step itself is in both builds. GOG's Dunia.dll LoadArchetypes builds generated\EntityLibraryPatchOverride.fcb after the base library unconditionally (the string's reference is at 0x1064D5FE) and hands it to the override load only when the file opens. A clean GOG install skips it for want of the file; a mod that adds the file wins over the world library on GOG as it does on Steam. This is read from the code, not tested in game.

Check the patch.fat in front of you before attributing a dead archetype edit to the override.

Instancing merges, it does not replace​

CEntitySystem::SpawnEntityFromNode(ISerializableNode const*) branches on the instance's tplCreatureType:

  • Absent — the instance node is used directly. No archetype is consulted at all.
  • Present — the archetype is looked up in CEntityLibraryManager, its Entity child taken, and the entity is loaded from a CReadOnlyMergeNode(archetype, instance) rather than from either node alone.

CReadOnlyMergeNode::BuildChildrenEntries defines the merge. It seeds its child array from the archetype, then for each instance child reads that child's tag and scans for an unpaired archetype child with the same tag:

caseresult
archetype has the child, instance does notinherited unchanged
both have itpaired into a nested CReadOnlyMergeNode, recursing all the way down
only the instance has itappended as a new child

So an instance overrides what it names and inherits the rest, at node granularity, recursively. It is a lazy read-only view over both trees — nothing is copied or flattened at load time.

Attributes: the instance wins​

Verified via reverse engineering

Every CReadOnlyMergeNode::getAttr* and getAttrEncode64 overload in FarCry2_server (0x09cc6d30–0x09cc78e0), and the same accessors in retail Dunia.dll (merge node built by CReadOnlyMergeNode_Construct at 0x10cf45b0, vtable 0x10f49ab8).

The merge node holds the archetype at +0x8 and the instance at +0xC. Every attribute accessor asks the instance first and returns its value when the instance has the attribute; only on a miss does it ask the archetype. A field present on both sides therefore takes the instance's value, and a field only the archetype has is inherited.

getAttributesCount on a merge node returns 0: the engine never enumerates a merged node's attributes, it only looks them up by id.

A missing archetype drops the entity​

SpawnEntityFromNode has three outcomes for an instance carrying tplCreatureType:

caseresult
the archetype resolves and has an Entity childspawned from the merge
the archetype resolves but has no Entity childspawned from the instance alone
the name resolves to no archetypenot spawned: the call returns the invalid entity proxy

Retail Dunia.dll (CEntitySystem_SpawnEntityFromNode, Steam 0x104e99a0, GOG 0x104dc190) takes the same three branches. A typo in tplCreatureType, or an archetype missing from the library the world loads, makes the entity silently absent.

After the merge, the spawn reads hidEntityClass and disEntityId through the merged node, so a library Entity supplies the class and the instance supplies the id.

Minimal placed instance​

Verified against the retail corpus

786 archetype-bound entities across 60 w1_b_2 worldsector files.

fieldcarried by
tplCreatureType, hidName, disEntityId, hidPos, hidPos_precise786 of 786
hidAngles622
hidResourceCount567
hidEntityClass0 — the library Entity supplies it
Components → CEventComponent (hidHasAliasName, empty hidLinks)786 of 786
Components → CGraphicComponent with only the baked ambient fields682

The attributes appear in the order tplCreatureType, hidName, disEntityId, hidResourceCount, hidPos, hidAngles, hidPos_precise. The graphic component on an instance holds only the export's baked sky-occlusion and ground-colour values; the mesh comes from the archetype.

(RE-verified) hidAngles is Euler degrees applied about X, then Y, then Z: the rotation is Rz · Ry · Rx. CEntity::SetAngles (0x0943dc30) builds the matrix that way, and SBindingHierarchyEntry::OverWriteTransform (0x09674f00) takes it apart the same way. It reads Y = asin(−m₀₂), X = atan2(m₁₂, m₂₂) and Z = atan2(m₀₁, m₀₀), with X = 0 when Y is at ±90°. Most entities turn only about Z, where any order agrees. A rock or sign tilted about both X and Y does not.

Sampling 146 placed entities across world1 sectors: 48 carry tplCreatureType and therefore merge against an archetype; the other 98 stand alone. All 146 carry their own Components child, and 61 name their own .xbg mesh directly — which is why a renderer can draw most of a map without opening a library, while a property inspector cannot.

hidMeshName picks parts out of a wardrobe​

Verified against the retail corpus

A graphics slot's objModel names the .xbg; its hidMeshName names which parts of that file to draw, semicolon-delimited with empty ends:

;P_MC_CAUCASIAN_HEAD03;P_MC_UB_SHIRT_VEST02;P_MC_CAUCASIAN_SHIRT_ARMS;P_MC_LB_PANT_JEANS01;
P_MC_DUMMYARMDEALERBEARD;P_MC_LB_BOOT02;P_MC_CAUC_HAIR01;…;P_MC_EYES_CAUCASIAN_HEAD03;

The names match the mesh's DNKS part names with every trailing _LOD<n> suffix removed. Most parts carry one; the female civilian kit's clothes carry two (P_WC_LB_JEANS03_LOD00_LOD0), and entities still wear them as P_WC_LB_JEANS03. Across the retail corpus 76 part names in 8 character files are doubled this way, and stripping every suffix never merges two distinct parts. Empty — which it is on almost everything — means draw the whole file.

It matters for exactly the files where it is set. merc_kit.xbg is a 111-part wardrobe referenced by 469 campaign sector files; without the list every mercenary in the game renders all 111 parts at once, which is one body wearing seventeen faces and ten times the triangles it should have.

Note the shape: on worldsector entities the slot fields sit flat on the component, but on a character they sit in a nested object child, and that is where hidMeshName lives. Reading only the flat form finds nothing.

Outfits are effectively unique per NPC — 709 mercenaries in world1 wear 682 distinct part lists — so a tool that bakes geometry per outfit is baking almost per entity.

Kit picks recolour and retexture parts​

Verified via reverse engineering

Traced in FarCry2_server: CGraphicKitComponent::GetSelectedColors (0x094b7a50), UpdateColorInMaterial (0x094b5080) and UpdateTextureInMaterial (0x094bca60).

A character's archetype embeds its kit descriptor as an Rml value in CFileDescriptorComponent.hidDescriptor — merc_kit.xml, female_civilian_kit.xml. The descriptor lists every part by slot (HEAD, SHIRT, PANTS, …) with a meshName, an id, and a colors and textures element that each name a library and say whether picks may overwrite from it. The libraries follow: <color color1 color2/> pairs and <texture path tiling/> entries.

The NPC's own CGraphicKitComponent.PartOverwrite holds the picks, one ActivePartOverwrite per part: PartID (CRC32 of the part's exact-case id), TextureIndex and ColorIndex. A pick applies only when the part allows overwrites from that library and the index is not -1. Nothing is randomised at draw time; the randomisation that chose the picks happened when the entity was authored.

A colour is a decimal 0x00BBGGRR, red in the low byte. The pair and a texture land on material parameters by the part's shader template:

Templatecolor1color2Texture, tiling
ClothBaseColor1BaseColor2PrintTexture, PrintTiling
SkinPalmColorSkinColorBloodTexture, BloodTiling
HairDiffuseColor1SpecularColor1DiffuseTexture1, DiffuseTiling1
anything elseBaseColor1BaseColor2DiffuseTexture1, DiffuseTiling1

On a Generic material the colour pair lands on parameters its shader never reads, so only the texture shows. Beard textures reach a face as its BloodTexture. A skin tone is a Skin part's colors pick from the caucasian, nubian or arabskin library.

Where entities are actually placed​

Verified against the retail corpus

Three files per sector can place entities, and reading only the obvious one loses the set pieces:

FileHolds
worldsector<id>.data.fcbthe bulk — props, vehicles, NPCs, fine building detail
landmarknear<id>.data.fcblarge-silhouette geometry, plus vegetation and spline volumes
landmarkfar_<id>.data.fcbthe same, biased to the largest features

Counting distinct meshes placed per tier across both campaign worlds:

shellsroofswindows/doorsinteriors
worldsector655810417
landmarknear262260
landmarkfar_1000

The landmark tier is shell-and-roof heavy and holds zero interiors; the fine detail stays in the worldsector file. In world1 the landmark files are almost entirely cliffs and rock formations — the skyline. 72 meshes are reachable no other way, including every HQ building, the forts, churches, the hotel, the C-130 and several roof and door pieces.

Landmark files also carry a SectorEntity_* vegetation container and SplinePrimitive_* occlusion volumes, which have no geometry of their own and belong to the collection and spline systems.

Buildings are kits​

A medium building is not one mesh. colonialmd01 ships as a shell, roof_01/roof_02, roofcap, roofshelter, roofshelter_open, windowsdoors_01/04/05, windowsdoors_open, balcony_01/02 and an interior — one shell, many combinations, including open and closed shutter variants.

The split is a visibility budget as much as a content one. The pieces carry deliberately unequal LOD ladders, so detail retires before the silhouette does:

pieceLODs
shell4
roof, windows/doors, balcony3
interior2

And they are authored to butt together exactly: colonialmd01building_01 spans z −1.00→7.75, colonialmd01roof_01 spans 7.75→9.40. Small buildings are not kits — colonialsmall02_bld01 is self-contained and includes its own roof.

Mission layers decide when a placed entity exists​

Verified via reverse engineering

Traced via GhidraMCP against FarCry2_server (CSectorSpawnCategory::OnReceivedSectorData, CLayerResource::Spawn/Unspawn, CGameMissionMgr::IsLayerEnabled, CEntity::GetLayerName) and confirmed against the retail Dunia.dll, which runs the same walk.

Every placed entity belongs to a mission layer, and the layer is what decides whether the entity is in the world at all. Two separate bindings carry a layer, and they do different jobs — confusing them produces a mod that looks right and behaves wrong.

Where the entity sits in the sector container gates spawning. Reading a sector's data walks the container's mission-layer nodes and creates one layer resource per node, each owning the entities nested under that node. When a layer turns on, that resource spawns exactly its own entities; when it turns off, it removes exactly them. An entity nested under a layer is therefore reachable only through that layer's on/off state.

The main layer is always on. The enabled test returns true for it unconditionally, without consulting mission state. Every other layer is enabled only while some enabled mission lists it — missions and their layer lists come from the world's mission definitions, which is why a mod that adds a layer must also declare a mission that enables it.

A mission component on the entity files a live entity into a layer. It is read when an already existing entity is added to or removed from a sector, when its owning layer is queried, and when it is persisted to a savegame, so it survives a save/reload as instance state. It is not consulted when the sector is first read, so it cannot decide whether the entity spawns.

The component's layer field holds -1 when it names no layer, and the read tests for that before using it, answering main instead. That is the usual case rather than an edge one: across 40 untouched w1_b_2 containers, 46 entities carry -1 and none carries a real layer id. A tool that reads the field as an id concludes that most of the shipped game is mis-filed.

The practical consequence: setting only the component moves nothing. An entity that still sits under main in the container spawns unconditionally at sector load, whatever its component says, and the layer named by the component never controls it. Moving an entity between layers means moving it in the container itself.

entSpawnMissionTrigger on an entity is a spawn-point property whose accessor has no callers on the traced binary. It is not part of this mechanism.

World-scope mapsdata is gated the same way​

Verified via reverse engineering

Traced via GhidraMCP against FarCry2_server (CXGame::LoadWorld, CWorld::AddGlobalSpawn, CGlobalSpawn::AddLayer, CWorld::GlobalSpawn, CWorld::OnLayerStateChanged). Not yet read in the retail Dunia.dll.

Sector data is not the only layered container. CXGame::LoadWorld opens <world>.mapsdata.fcb, and for each map descriptor hands the matching node to CWorld::AddGlobalSpawn. That walks the node's MissionLayer children and registers each with CGlobalSpawn::AddLayer, one CGlobalSpawn::SLayerSpawn per layer. CWorld::GlobalSpawn(CPathID const&) spawns a layer across every registered global spawn, and has two callers: LoadWorld and CWorld::OnLayerStateChanged. A mapsdata entity nested under a mission layer therefore appears when that layer turns on, like a sector entity.

Which containers carry mission layers​

Verified against the retail corpus

Every worldsector*.data.fcb under worlds/ (5,100 files: both campaign worlds and the multiplayer maps), world1's mapsdata, managers and omnis, and a one-in-ten sample of the landmark files (727 landmarkfar_*, 498 landmarknear*).

ContainerContent under MissionLayerUnder a layer other than main
worldsector*.data.fcbevery placed entity9,139 of 188,632 entities, in 436 layers
<world>.mapsdata.fcbshapes (CBasicShapeEntity), regions (CGameRegion, CSocialRegion, CZoneLogicRegion, CBurnableRegion, CWagerRegion), COmniMapEntity, CSpawnPoint, CGameElementEntity, CFcxSplineCollectionEntityworld1: 163 of 1,210 entities, in 52 layers; all 25 spline collections sit in main
<world>.managers.fcbthe manager singletonsnone in world1
<world>.omnis.fcbCOmniEntity Domino hostsnone in world1
landmarkfar_*.data.fcbCSectorEntity vegetation collections and event entities2 entities in 1 file of 727, under missions\librarymissions\a2lm12\misnsubv_planeflight
landmarknear*.data.fcbCSectorEntity collections, event entities, a few Realtree and prefab entitiesnone

In the sector files the non-main layers hold every kind of mesh-less entity from the table below, not only props:

Component on the entityUnder a non-main layer
CFCXAIComponent993
CProximityTriggerComponent246
CNewParticlesComponent102
CEntranceInfoComponent77
CSoundComponent74
CDynamicLightComponent21
CRealtreeComponent1

Sector descriptors (sector<id>.desc.fcb), sectorsdep, preload lists, terrain, water and navmesh (.nvm) contain no MissionLayer node.

Layer names are paths. Across the sector files and world1's mapsdata, main accounts for 5,124 layer nodes. The other names outside missions\ are the multiplayer modes fcxvip (111), fcxctf (76), fcxdeathmatch (47), fcxteamdeathmatch (44), plus benchmark (14) and a handful under leveldesign\w2c3\a10_capital\. Mission layers group under missions\ by family:

FamilyLayer nodes
safehouse698
weaponbazaar280
storymissions238
librarymissions211
_disableformission134
buddyunlockmissions54
buddysidequests39
convoymissions30
openingsequence28
assassinationmissions27
grinmissions24
randomencounters19
carvertapemissions17
vendormissions15
ubidays5

Prefab instances are placed entities​

Sector files place CPrefabEntity (5,248, 126 of them outside main) and CScriptedScenePrefabEntity (160, 75 outside main) entities, e.g. Lighting.LanternExplotator_62. They sit directly under a mission layer like any other entity.

Verified against the retail corpus

All 233 prefab entities in w1_b_2's 250 sectors.

A prefab entity carries no tplCreatureType. It names its class in the string at hash D2B3429E (CPrefabEntity), and its members are a Children list of Child records, each a Name string and the child's disEntityId at hash 11D3633A. The children are not nested: each is an ordinary sibling entity elsewhere in the file.

Measured over 2,866 Child records
child found in the level's sectors2,019
of those, under the parent's own mission layer2,019
of those, in the parent's own sector file1,922
child distance from the parent's hidPos0 to 19 m, median 3.9 m
a child that is itself a prefab0

So a child's hidPos is global like every other entity's, and moving a prefab means moving each child. The 847 unresolved children most likely sit in sectors of neighbouring levels.

Verified against the retail corpus

All 320 links in w1_b_2's 250 sectors. ige_map.managers.fcb carries 25 hidLinks, all empty.

CEventComponent/hidLinks is a list of Link records, each a CEventComponent::CEventLink. Each one wires an event the owning entity raises to an event sent to a target entity.

wherenametypemeaning
LinkInputEventstringthe event raised, e.g. OnStateChange, STPSpecialActionTriggered
LinkTargetEntityIdInt64target disEntityId
LinkEventchildthe event sent, a CEntityEvent*
Eventtext_hid_DTCTH_ClassNamestringevent class, e.g. CLightEvent
Eventhid_DTCTH_ClassNameu32CRC32 of that class name
EventhidEventNamestringCBaseEvent; e.g. DeactivateLight, PlaySound
EventeventMasku32CBaseEvent; 1 in all 320
EventhidTargetEntityIdInt64CEntityEvent; the target id again, equal in all 320

Event is saved through DynamicTypeCreatorTypeHandler, which writes the concrete class as hid_DTCTH_ClassName ahead of that class's own members. The members below are the event classes' own:

event classmembers
CLightEvent, CSmartTerrainEventhidType
CSoundEventsndSound, sndtpType, bAssignOnEntity, bInterruptible, bAlwaysTrigger
CTriggerEnableEventbEnable
CTriggerSimpleEventsType, text_sType
CCompoundPhysForceStateEventnIndex
CMapElementEventselState
CMissionHandlerEventParameters

That table covers every event class in the links of all retail worlds. hidType and sType are read off their classes' RegisterProperties; the rest are CRC32 matches, nIndex against a guessed name rather than a string in the binary.

313 of the 320 targets resolve inside the level, 309 in the source's own sector file. Link sources are mostly AI smart terrain points, compound physics objects and time-of-day or relay triggers.

Components read off an instance​

Two component layouts confirmed from shipped sector data. Both hang off an entity's Components child and are read the same way whether they came from the instance or were inherited. Every component's full property list, with types and enum choices, is in the component and property registry.

CDynamicLightComponent — every placed light​

There is no light file. Lights are a component on ordinary entities, named OmniLight_*, SpotLight_*, Lighting.*CampFire* and similar; roughly 1,400 in world1, about half of them spots, and many shipping disabled for mission logic to switch on.

fieldmeaning
hidType1 = omni (point), 3 = spot
clrColorvec3, 0–1
fIntensity, fRadius, bEnabled
bCastShadow, fShadowFactor
llgLightGroup
fTurnOffFallOff, fTurnOffDistance
fFlickeringFrequency, fFlickeringAmplitude, fFlickeringNoisecampfire flicker
fOuterAngle, fInnerAnglespots only

At run time the component holds a handle into the container of CSceneLights (Steam 0x10F96830, the same container the environment manager keeps its sun or moon light in), and each frame its Update writes the entity's position and facing into the light. The container's buffers sit at its +0x08: the first holds the lights and the number of slots, and a destroyed light's slot is emptied. It holds only the lights near the player, about a dozen at a time in world 1. A CSceneLight is 0x7C bytes:

OffsetField
+0x04hidType: 0 for the environment's directional light, 1 omni, 3 spot
+0x08bEnabled
+0x0Cposition
+0x18facing, the entity's Y axis: a spot points along it
+0x30fRadius
+0x34clrColor
+0x40fIntensity
+0x44this frame's flicker
+0x5CfOuterAngle, the spot's full angle in radians

The tmpla library carries 17 lights as IGE_Archetypes.AutoPrefab.OmniLight_* and SpotLight_*, some on, some off; any of them can be spawned like a soldier (seen in game).

Not lights

<world>.omnis.fcb contains no lights. "Omni" there means omnipresent: world-scope entities outside the sector grid. Retail world1 holds five COmniEntity DLC Domino hosts; most maps ship a 22-byte empty shell.

CProximityTriggerComponent — the only trigger with geometry​

Around 4,000 in world1, over half rotated, with meaningful names (ProximityTrigger_SafehouseCheck_*, W1C3_RE_trigger_Arena). vectorSize is the box; the entity's hidAngles.Z is the yaw in degrees. CTimeOfDay, CDelay and CLookAtTriggerComponent fire on their own conditions and carry nothing to draw.

CProximityTriggerComponent::IsInside is not a geometric test — it walks a membership list that physics maintains, so the box test lives in collider registration.

Who sets it off (read in FarCry2_server). When physics reports a contact, CProximityTriggerComponent::OnEvent (0x091035F0) asks IsValidCollider (0x09102B30), then raises Enter or Leave on the trigger's own entity, carrying the collider. The Domino ProximityTrigger node hands that collider out as Collider.

  • The collider must have a CPawn component: the player, soldiers and buddies, not animals or props.
  • selUsableBy filters entering and leaving as well as use (IsValidPawn, 0x09102990): 2 PlayerOnly passes only a pawn that is a terminal's focus, the local player; 1 AIOnly the others; 0 everyone.
  • selLocomotionFilter 1 needs the pawn in a vehicle, 2 out of one.
  • With bExclusiveUser, a second pawn's Enter is ignored until the first leaves.

Switching it. CBaseTriggerComponent::OnEvent (0x0936E1A0) takes a CTriggerEnableEvent and sets bEnabled from its bEnable; the proximity trigger calls it first and raises Enter only while enabled. Retail links send it as CTriggerEnableEvent SetDisabled with bEnable False (a street bulb that is shot out, worldsector3860). The base also registers Enable, SetEnabled, SetDisabled and Reset as registered events.

What retail wires to them. Mostly graphs, through the ProximityTrigger node, which name each trigger by its entity id as a string. In the 250 sectors of w1_b_2 only one link listens to a trigger, a save point's Use. Across every sector file, 50 hold the string Enter and 10 Leave. One such link is the creaking dock in w1_b_3's worldsector3955: ProximityTrigger_Sound_Dock_Creak_14 (static, PlayerOnly, vectorSize 4 × 4 × 7) links Enter to a CSoundEvent PlaySound of 0x004C6529, sndtpType 11 and bAssignOnEntity, aimed at SoundPoint_Dock_Creak_15, an entity holding only an empty CSoundComponent and a CEventComponent. The DLC Domino hosts DominoEntity_9 to _12 are themselves 1 m PlayerOnly proximity triggers with a CDominoComponent.

Open

Whether vectorSize is the box's full extent or a half-extent, and whether the box is centred on the entity, are both unconfirmed — a 2× error either way.

A third of a world's entities draw nothing​

Verified against the retail corpus

Of world1's ~90,600 positioned entities, roughly 35,000 resolve to no mesh on themselves. They are not one undifferentiated pool — each carries a component that names its purpose:

Component setCountWhat it is
CEventComponent alone10,366pure logic nodes, the largest group
+ CFCXAIComponent3,143AI reference points — cover, guard posts, lean and sit spots
CEntranceInfoComponent / CBuildingInfoComponent1,204the DOOR and WINDOW hints AI navigates buildings by
+ CPersistComponent1,130
CRealtreeComponent807vegetation
CNewParticlesComponent448particle emitters
CSoundComponent325sound emitters
CDynamicLightComponent291lights
CProximityTriggerComponent207triggers

Two things fall out of this for a tool. Lights, triggers and Realtree entities are already drawn by their own systems, so a generic "entity has no mesh, draw a marker" pass stacks a second marker on each of them. And an entrance node carries an AI component as well as its entrance one, so a classifier that tests for AI first files all 1,204 door and window hints among 3,000 cover markers.

The count is an upper bound: about 7,800 of those entities do carry a CGraphicComponent and resolve through the archetype fallback, so they are only mesh-less if you skip that step.

Consequences for tools​

  • Resolve archetypes by case-insensitive fully qualified hidName, keeping the whole chain so the shadowed definitions stay inspectable.
  • Read every library through the VFS, so archive priority, whole-file mod replacement and partial FCB fragment overrides are already applied. Game-internal and mod layering then live in one chain.
  • Do not resolve a placed entity against _full while claiming to model the server, and do not resolve it against the base while claiming to model the client.
  • Editing an archetype does change the 48-in-146 that reference one, and does nothing for the rest.
  • Treat an entity's mission layer as structural. A tool that offers to change an entity's layer by editing its mission component alone is offering a change the engine will not honour.

Unknowns​

  • What the flag at +0xC4 selects between the two bases. None of the obvious write sites writes this field.
  • Whether Dunia's loop after the patch override is literally CDlcService::GetEntityLibraries. In FarCry2_server it is: CXGame::LoadArchetypes (0x08888750) calls CDlcService::GetEntityLibraries(CryVector<CryStringBase<char>>&) and feeds each returned path through CEntityLibraryManager::Override. Dunia's loop has the same shape — a vector of strings walked at 0x1c stride, each loaded through the same resolver slot and merged the same way — but the call itself has not been read there. Either way the DLC libraries land after the patch, so they win over it.
  • Whether a placed CPrefabEntity does anything at runtime beyond listing its children, and whether it relates to the CPrefabManager descriptions in <world>.managers.fcb (see object inventory).
  • Whether an instance with only the minimal fields above, and no baked graphic component, spawns in a running game. The corpus shows 104 archetype-bound instances without one; none has been placed and watched.