Skip to main content

Module startpos

Module startpos 

Source
Expand description

Generation of campaign startpos files (startpos.esf) without the game.

The game builds a startpos by creating a new campaign from the start_pos_* tables, the DB and the campaign map files, running its normal campaign initialisation, and saving the result with its save game code. This module reproduces that process piece by piece, so startpos generation can report clear errors instead of failing silently inside the game.

Each submodule builds one part of the startpos and is verified against startposes built by the game (Attila’s main campaign for now). Parts not covered yet are listed in each submodule’s docs.

§Submodules

  • coords: coordinate systems of the campaign map (world, raw map units, hex cells).
  • extract: extraction of the start_pos_* tables from a startpos, the inverse of the build.
  • generator: generation of a campaign’s startpos from a pack and the game’s files.
  • validation: validation of the tables a startpos is built from.
  • trade: the trade network (CAMPAIGN_TRADE_MANAGER splines and routes), from trade_routes.ptd.
  • settlements: settlement layouts (slots and sprawl cells of each region).
  • split: splitting of the start_pos_* tables by campaign, as BOB does.
  • layout: record layouts used to write startposes.
  • missions: mission scripts and the victory objectives they define.
  • region_map: the region of each cell of the campaign map.
  • tables: access to the database tables the build reads.
  • vision: vision areas (line of sight and shroud) and their quad tree encoding.
  • world: the world stage (factions, characters, armies, regions, provinces and seas).
  • writer: the writer of whole startposes.

Modules§

cai
Writer of the campaign AI’s state (CAI_INTERFACE).
coords
Coordinate systems of the campaign map.
extract
Extraction of a campaign’s start_pos_* tables from its startpos: the inverse of the build.
generator
Generation of a campaign’s startpos from a pack and the game’s files, without launching the game.
layout
Layouts of the records of a startpos, used to write new ones.
missions
Mission scripts of a campaign (victory_objectives.txt, missions.txt) and the victory objectives they define.
region_map
Region of each cell of the campaign map, from map_data.esf (REGIONS_DATA/theatres/CAMPAIGN_THEATRE/HEX_MAP_DATA).
settlements
Settlement layouts of a startpos (REGION/SETTLEMENT/SETTLEMENT_EXPANSION_MANAGER/SETTLEMENT_EXPANSION_MAP_DATA), built from the campaign map’s map_data.esf (REGION_DATA/SETTLEMENT_INFO).
split
Splitting of the start_pos_* tables by campaign, as the Assembly Kit’s BOB does before building a startpos.
tables
Database tables used to build a startpos, accessed by column name.
trade
Trade network of a startpos (CAMPAIGN_TRADE_MANAGER), built from trade_routes.ptd.
validation
Validation of the tables a startpos is built from, to report why a build would fail before running it.
vision
Vision areas of a startpos (LINE_OF_SIGHT and CAMPAIGN_SHROUD records) and their quad tree encoding.
world
World stage of the startpos build: the content of CAMPAIGN_MODEL/WORLD (factions, characters, armies, regions, provinces and sea regions) derived from the start_pos_* tables, the game tables and the map.
writer
Writer of whole startposes (CAMPAIGN_STARTPOS): the world, and the records around it.