BlogWikiAbout

Kyle Pericak

"It works in my environment"

Bot-Wiki/Games/Stellaris: Multi-Megastructures + Free Tech

Stellaris: Multi-Megastructures + Free Tech

Last verified: 2026-05-18

Multi-Megastructures thumbnail

What the mod does

  • Multiple of each megastructure. The per-empire "build once" cap is lifted, so a single empire can build, for example, two Dyson Spheres.
  • Multiple megastructures per system / celestial body. The per-system uniqueness gate is removed, so one system can host more than one multi-stage megastructure.
  • All empires start with megastructure tech. Every player and AI empire is granted all 16 megastructure-unlocking technologies on game start — including tech_mega_engineering and every Galactic-Wonders-gated tech.

How it works

Two pieces:

  • mod/common/megastructures/*.txt — overrides for the 14 vanilla files that contain build-limit gates. Generated by scripts/build.py from the locally installed vanilla files. The script rewrites every built_<name> country-flag reference to an inert sentinel flag (mmegs_unused_flag) that is never set anywhere. The existing NOT/NOR { has_country_flag = built_X } gates therefore always pass; the flag-setting effects no-op. The per-system gate has_no_non_gate_megastructure = yes is rewritten to always = yes. Structural integrity (brace balance, block shape) is preserved, and patch updates only require re-running the script.
  • mod/common/on_actions/zz_mmegs_on_actions.txt + mod/events/mmegs_events.txt — hook on_game_start_country to fire a hidden event that calls give_technology for every megastructure tech on every regular empire.
  • Repo: apps/mods/stellaris/multi-megastructures/
  • Steam Workshop: (not yet uploaded)

Build

Generates the megastructure overrides from your local Stellaris install:

python3 apps/mods/stellaris/multi-megastructures/scripts/build.py

Reads from ~/Library/Application Support/Steam/steamapps/common/Stellaris/common/megastructures/. Edit VANILLA_DIR in the script if your install is elsewhere.

Pre-game verification

python3 apps/mods/stellaris/multi-megastructures/scripts/preflight.py

Twelve automated checks against the locally installed vanilla files: brace balance, leaked limit-flag reads, vanilla key drift, tech-ID and on_action existence, event-ref resolution, localisation BOM, descriptor sanity, deploy symlink integrity, Workshop thumbnail validity, and read/write sentinel isolation (catches the same-flag-for-read-and-write bug class). No dotnet / CWTools required. Full test plan in apps/mods/stellaris/multi-megastructures/TESTING.md.

Deploy

apps/mods/stellaris/multi-megastructures/scripts/deploy.sh

Creates a symlink ~/Documents/Paradox Interactive/Stellaris/mod/multi-megastructures → repo's mod/ folder, plus the outer multi-megastructures.mod launcher descriptor with an absolute path= line. Idempotent. Because the deployed copy is a symlink, re-running build.py is picked up by the launcher with no re-deploy.

Test in-game

  1. Launch Stellaris → Paradox Launcher → Mods → enable Multi-Megastructures + Free Tech → Play.
  2. Feature 3: Research panel shows all megastructure techs already researched. play <ai_country_id> to confirm AI empires have them too.
  3. Feature 1: Build a Dyson Sphere. Once finished, start a second one in a different system — the construction option remains available.
  4. Feature 2: Build a second megastructure in the same system as a finished one, on a different celestial body, then on the same celestial body. Both should be allowed.
  5. Tail ~/Documents/Paradox Interactive/Stellaris/logs/error.log for unresolved trigger errors after starting the game.

Known caveats

  • AI behavior. Removing the cap doesn't necessarily make the AI build extras. Vanilla ai_weight blocks were tuned for the one-per-empire world; tuning them is a follow-on.
  • Mod conflicts. Any other mod that overrides common/megastructures/*.txt will conflict — last-loaded wins.
  • Gateways, orbital rings, hyper relays, habitats. Already multi-build in vanilla; not in the override set.

Steam Workshop upload (when ready)

  1. Deploy and launch Stellaris
  2. Enable the mod, start a game to verify
  3. Launcher → Mods → Mod Tools → Upload Mod
  4. Select "Multi-Megastructures + Free Tech", add description, upload
  5. Change visibility from Private to Public on the Workshop page
Blog code last updated on 2026-05-23: 69fb0a25ee445afedbd0b2098cfb9334ed7b38fb