ALiVE is divided into five core components - Core, Military, Support, Ambience and Data.
Common Object Types
Several types of "objects" feature prominently in ALiVE's code.
ALiVE uses CBA hashes nearly everywhere, through the ALIVE_fnc_hash* functions. Rather than using CBA hashes directly, ALiVE wraps them to provide some additional features, like guards for passing bad arguments, and nil return if a value does not exist. Prefer the ALIVE function if it exists, though any CBA function will work with any hash created by ALiVE.
Complete list of general-use hash functions, with ALIVE versions where applicable:
In ALiVE, a sector is an object which represents a rectangular section of the map. All sectors are contained in the global variable ALIVE_sectorGrid. In ALiVE's code, they are often used for:
- Narrowing down search areas - rather than iterating through ALL clusters on a map, iterate only through those in a given sector. For instance, military placement uses the flat spots in a sector for placing units.
- Sectors are used extensively for map analysis.
See ALIVE_fnc_sector for more about what data sectors contain.
In ALiVE, a cluster is a collection of map nodes. Map nodes can be things like houses, fuel stations, and other features.
In ALiVE, an objective is a cluster which has been assigned to an OPCOM.
OPCOM_instances - list of OPCOM AI modules.
ALIVE_battlefieldAnalysis - contains lots of useful functions for battlefield state.