rpfm_extensions/startpos/mod.rs
1//---------------------------------------------------------------------------//
2// Copyright (c) 2017-2026 Ismael Gutiérrez González. All rights reserved.
3//
4// This file is part of the Rusted PackFile Manager (RPFM) project,
5// which can be found here: https://github.com/Frodo45127/rpfm.
6//
7// This file is licensed under the MIT license, which can be found here:
8// https://github.com/Frodo45127/rpfm/blob/master/LICENSE.
9//---------------------------------------------------------------------------//
10
11//! Generation of campaign startpos files (`startpos.esf`) without the game.
12//!
13//! The game builds a startpos by creating a new campaign from the `start_pos_*` tables, the DB and the campaign
14//! map files, running its normal campaign initialisation, and saving the result with its save game code. This
15//! module reproduces that process piece by piece, so startpos generation can report clear errors instead of
16//! failing silently inside the game.
17//!
18//! Each submodule builds one part of the startpos and is verified against startposes built by the game
19//! (Attila's main campaign for now). Parts not covered yet are listed in each submodule's docs.
20//!
21//! # Submodules
22//!
23//! - [`coords`]: coordinate systems of the campaign map (world, raw map units, hex cells).
24//! - [`extract`]: extraction of the `start_pos_*` tables from a startpos, the inverse of the build.
25//! - [`generator`]: generation of a campaign's startpos from a pack and the game's files.
26//! - [`validation`]: validation of the tables a startpos is built from.
27//! - [`trade`]: the trade network (`CAMPAIGN_TRADE_MANAGER` splines and routes), from `trade_routes.ptd`.
28//! - [`settlements`]: settlement layouts (slots and sprawl cells of each region).
29//! - [`split`]: splitting of the `start_pos_*` tables by campaign, as BOB does.
30//! - [`layout`]: record layouts used to write startposes.
31//! - [`missions`]: mission scripts and the victory objectives they define.
32//! - [`region_map`]: the region of each cell of the campaign map.
33//! - [`tables`]: access to the database tables the build reads.
34//! - [`vision`]: vision areas (line of sight and shroud) and their quad tree encoding.
35//! - [`world`]: the world stage (factions, characters, armies, regions, provinces and seas).
36//! - [`writer`]: the writer of whole startposes.
37
38pub mod cai;
39pub mod coords;
40mod esf_nav;
41pub mod extract;
42pub mod generator;
43pub mod layout;
44pub mod missions;
45pub mod region_map;
46pub mod settlements;
47pub mod split;
48pub mod tables;
49pub mod trade;
50pub mod validation;
51pub mod vision;
52pub mod world;
53pub mod writer;
54
55#[cfg(test)] mod startpos_test;