Skip to content

tibold/x4-mods

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PEO — Player Economy Overhaul

A suite of four X4: Foundations extensions focused on making the player-run economy faster, bigger, and less noisy at scale. Written by and for a solo player/modder — pragmatic, vanilla-friendly, and biased toward letting vanilla systems do the work whenever possible.

Quick start

  1. Copy each folder under dist/ into your X4 Foundations extensions directory:

    dist/peo_economy/    →  <X4 install>/extensions/peo_economy/
    dist/peo_fleet_ai/   →  <X4 install>/extensions/peo_fleet_ai/
    dist/peo_resources/  →  <X4 install>/extensions/peo_resources/
    

    On a default Steam install that's C:\Program Files (x86)\Steam\steamapps\common\X4 Foundations\extensions\.

  2. Disable Protected UI Mode in X4: Settings → Game Settings → turn off Protected UI Mode. This is required because peo_fleet_ai ships Lua UI modifications, and X4 silently refuses to load them with protected UI on.

  3. Enable the extensions in the in-game extension manager, then start or load a save.

(peo_alerts isn't in dist/ yet; see the extensions table below.)

Extensions

Extension What it does Status
peo_fleet_ai Five custom trade/mine/export orders (Hauler, Haul for Station, Station Miner, Export Goods, Exporter) with manager-range routing, multi-drop deliveries, and proper warebasket handling. Added alongside vanilla orders, not replacing them. Production
peo_economy Data-only rebalance: 10× station storage, 2×/3×/4×/6× ship storage by size class, per-faction god quotas, per-station module limits. Fully DLC-aware (Boron, Split, Terran, Pirate, Timelines, mini 01/02). Production
peo_resources MD script that seeds high-yield resource fields near player stations when the station's required minables aren't already available in the cluster. Capped at 3/sector and 50 galaxy-wide. Production
peo_alerts Economy notifications: critical stock warnings (< 5%), station-under-attack alerts. Work in progress — not yet built into dist/

See each extension's own README for details, parameters, and compatibility notes.

Building

tools/build.py packages each extension into the format X4 actually loads: content.xml (unpacked) plus ext_01.cat/ext_01.dat for extension data, and subst_01.cat/subst_01.dat for UI file substitutions (Lua files are renamed to .xpl on the way in, matching the UIX convention).

python tools/build.py

The script clears and recreates dist/ on every run and packages the three production extensions (peo_economy, peo_fleet_ai, peo_resources). peo_alerts is currently excluded until it's ready.

The dist/ folder in this repository is the latest build — you don't need to run build.py yourself unless you've changed source files under extensions/. Install directly from dist/ and it will match what the build script would produce.

Installing

tools/install.ps1 (Windows/PowerShell) runs the build, then copies each built extension from dist/<ext>/ into the X4 Foundations extensions directory, overwriting any previous install.

pwsh tools/install.ps1

The script assumes the default Steam install path (C:\Program Files (x86)\Steam\steamapps\common\X4 Foundations\extensions). Edit $GameExtDir at the top of the script if your install is elsewhere.

Manual install (any OS): copy each folder under dist/ into your X4 extensions/ directory. Then enable the extensions in the in-game extension manager and start or load a save.

Repository layout

x4ai/
├── extensions/          # Mod sources (the real code)
│   ├── peo_alerts/      # MD notifications (WIP)
│   ├── peo_economy/     # Data patches: storage, god, modules
│   ├── peo_fleet_ai/    # Custom trade/mine/export AI orders
│   └── peo_resources/   # Dynamic resource seeding
├── dist/                # Packaged builds ready to drop into X4 (latest)
│   ├── peo_economy/     # content.xml + ext_01.cat/dat
│   ├── peo_fleet_ai/    # + subst_01.cat/dat for UI
│   └── peo_resources/
├── tools/               # Build, install, and maintenance scripts
│   ├── build.py         # Package extensions/ into dist/
│   ├── install.ps1      # Build + copy to X4 extensions folder
│   ├── update_cargo.py  # Retune ship storage multipliers
│   ├── update_storage.py# Retune station storage multiplier
│   ├── fix_cargo_bases.py
│   ├── apply_patches.py
│   ├── extract_cat.py
│   └── pack_cat.py
├── vanilla*/            # Extracted vanilla + DLC game data, used as
│                        # reference by fix_cargo_bases.py and other tools
└── docs/                # Reference notes

Maintenance scripts

Beyond the build/install pipeline, tools/ also contains helpers for mass-editing the repetitive storage values in peo_economy:

  • tools/update_cargo.py — rewrites ship storage multipliers in extensions/peo_economy/assets/units/size_*/macros/. Class-based: S=2×, M=3×, L=4×, XL=6× by default. Edit the NEW_MULTIPLIERS dict at the top and rerun.
  • tools/update_storage.py — rewrites station storage multipliers in extensions/peo_economy/assets/structures/storage/macros/ and DLC equivalents. Single flat MULTIPLIER = 10 constant. Edit and rerun.

Both scripts are idempotent — they only touch files where the computed value differs from what's on disk. See extensions/peo_economy/README.md for details, scope, and the known coverage gap around assets/props/StorageModules/macros/.

Development workflow

  1. Edit source under extensions/<mod>/.
  2. python tools/build.py to repackage dist/.
  3. pwsh tools/install.ps1 to deploy to X4 (or copy manually).
  4. Restart X4 and reload the save.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors