Skip to content
المشاريع

IanHeinrich/stellaris-galaxy-forge

عرض على GitHub

حول

Desktop editor for Stellaris galaxy maps. Move systems, draw and cut hyperlanes, add new systems and nebulae to a save, or build a custom galaxy for a new game. Only what you change is rewritten, with backups and undo.

الأنظمة والبنية التحتية

كيف تُقاس هذه الأرقام

35 نجمة1 التفرعات +1 خلال 24 ساعة

ما يمكنك فعله

  • System positions - editable - editable
  • Hyperlanes: add, cut, isolate - editable - editable
  • Lane lengths - editable - not in the file
  • Systems: add, rename, remove - add, then reroll, rename or delete the ones you added until you reopen the file. On a save from 4.6 or later, delete ones it already had, apart from capitals and empires' starting systems - editable

النمو المقاس للنجوم

خلال 24 ساعة
+١
خلال 7 أيام
جارٍ جمع السجل
خلال 15 يومًا
جارٍ جمع السجل
خلال شهر
جارٍ جمع السجل

تغيّر صافي النجوم خلال فترات متداخلة، وليس مجموعًا يوميًا. تبقى القياسات المفقودة فارغة. النجوم تقيس الاهتمام لا جودة البرمجيات.

README.md

الأصل

Stellaris Galaxy Forge

Galaxy Forge is a desktop editor for Stellaris galaxy maps. It runs outside the game, on Windows, macOS and Linux, and lets you edit both existing save files and galaxy scenarios.

You can move star systems, draw and cut hyperlanes, and add new systems to an ongoing campaign. Inside a system you can rearrange its orbits, add and delete planets and megastructures, and edit each planet's class, deposits and colony. You can also turn a save into a scenario and start a new game from it with the Paint a Galaxy mod.

Read the user guide for help with installing, how to use the tool and frequently asked questions.

Stellaris Galaxy Forge with a mid-game save open: the galaxy map with empire territories, and a selected system's page in the Inspector

Editing a save

Moving a system, drawing a lane, cutting a lane and connecting a selection

Open a .sav file, make your changes, save it, and load it in Stellaris to continue the same campaign.

  • Move systems. Drag a star system to a new location. The hyperlanes move with it and their lengths are updated.
  • Rotate and swap systems. Turn a selection of systems around a point with the rotate handle on the map, or type an angle in the Inspector. Select two systems and right-click one to swap them. Each takes over the other's hyperlanes.
  • Edit hyperlanes. Draw new lanes, cut existing ones, or disconnect a system completely. Right-click a selection to Link every pair, Link nearby, Cut lanes between them or Isolate them. The Connect and Cut brushes let you work in broad strokes. Join reconnects separate parts of the galaxy.
  • Edit a selection. Select several systems to change them together in the Inspector's Hyperlanes, Position and Set for all sections.
  • Add systems. Right-click empty space to add a new star system. Galaxy Forge generates it from the rules in your Stellaris installation, including its star, planets, moons, asteroid belts and deposits, at the save's resource abundance. Until you reopen the file you can reroll it, choose its star, or rename it. The Shape tool adds a whole shape of systems at once (see Shapes, brushes and symmetry).
  • Add binary and trinary systems. In the same menu, "Binary or trinary" adds a random binary or trinary. "Build one…" lets you pick the stars and one of the game's four arrangements.
  • Add special systems. "Special…" in the same menu opens a searchable list of the game's unique and special systems, such as Zevox or Federation's End, with their anomalies, dig sites and ruined megastructures. Clusters such as Sol and its neighbours are placed as one edit.
  • Delete systems. Delete systems you added, one by one or as a selection. In a save from Stellaris 4.6 or later, you can also delete systems the save already had, one at a time, along with their colonies, starbases, fleets and megastructures. A capital or an empire's starting system can't be deleted.
  • Raise and sink systems. Set a system's height above or below the galaxy plane, or paint heights with the Height brush (H). The Tilt slider tilts the map so you can see them, and the Heights layer marks raised and sunk stars.
  • Change stars. Change a star's type or size, or apply a star class to a selection of systems.
  • Edit nebulae. Add, move, resize, rename and remove nebulae. Newly created nebulae use names from the game's name list. Systems inside a nebula get its cloud and hide ships, as they do in the game. The Turbulent checkbox on a nebula's page makes it turbulent or calm.
  • Edit wormholes. Select two systems and right-click to link them as a wormhole pair, or unlink a pair.
  • Edit empires. Rename an empire and change its flag. On a save from Stellaris 4.5 or later, also change its border and fill colours.
  • Edit the L-Gate outcome. See which outcome the save rolled and change it until a gate opens.

Dragging the rotate handle to turn a selection of systems a quarter turn

The Special list with Federation's End selected, showing its star, planets and what it comes without

Build a binary or trinary: the four arrangements, a star for each slot and the game's trios

The Height brush on a tilted map, raising one group of systems above the galaxy plane and sinking another below it

The user guide's Edit a save and Add a system list the menus and keys for each of these.

The system view

Dragging Sol's planets to new orbits, then moving a companion star and adding an asteroid belt in a trinary system

Double-click a system, or select it and press M, to open the system view.

  • Rearrange the system. Drag planets, moons and companion stars to new orbits. Add, move and remove asteroid belts, and give a planet a ring or take it away.
  • Add and delete planets. Right-click empty space to add a planet, or right-click a planet to add a moon or delete it. A new planet gets its size and deposits from the game's rules. Stars can't be deleted.
  • Copy and move planets. Cut planets, then paste them into another system. A planet takes its moons and its own mining or research station with it. Copy and paste planets to add new ones, in the same save or another one.
  • Edit megastructures. Each megastructure looks as it does in the game. Add one at any construction stage or ruined, move it, or delete it. Add or delete a whole ring world, and with Gigastructural Engineering add an Equatorial Shipyard.
  • Move wormholes. Drag a natural wormhole to a new point in its system.

Adding a finished Dyson Sphere around a star, then deleting it

Planets

Every planet and moon in a save has its own page. On it you can:

  • Rename the planet, change its size, and change its class or skin.
  • Add or remove deposits, blockers, modifiers, anomalies and dig sites.
  • Delete a colony without deleting the planet.

Select several planets in a system to change their size, class, ring, deposits and modifiers at once.

Colonised planets can be edited too. The page warns you first when the game will take something away for an edit, such as districts over a lowered cap. System view and Planet pages in the user guide go through each of these.

A Gaia World's page with its name, size, class, orbit and deposits, beside an empire's page with the emblem picker open

Making a galaxy for a new game

A scenario open in Galaxy Forge: the map with its enclaves, leviathans and ruined gateways labelled, and the scenario's name, counts and game setup in the Inspector

A scenario is a galaxy map that a new game starts from instead of generating a random galaxy.

Galaxy Forge can create a scenario from a blank map, from a day-one save if you want the game's layout, or from any existing save. When you open a save as a scenario, Prepare for a new game lets you choose what the new game keeps, from starting positions to fallen empires. The map shows the result before you apply it. The original save remains unchanged.

Systems, hyperlanes and nebulae work the same way as they do when editing a save. Scenarios also let you:

  • Add systems by right-clicking. "New special system…" opens the same Special list as in a save, clusters included.
  • See in the system view what each system's initializer places and what the game can roll for its planets.
  • Choose what each system spawns using the initializer browser. It lists everything defined by your Stellaris installation and enabled mods, and shows what each initializer places.
  • Add ruined megastructures, ambient objects such as derelict ships, and system modifiers to a system. Drag a ruin or an ambient object to move it, or type its Distance and Angle.
  • Set spawn points and their weights, and mark hyperlanes that the game must never generate.
  • Place marauder clans. On a map for Paint a Galaxy you can also place fallen empire zones and wormhole pairs, and choose which kind of empire each seat is for.
  • Set the counts offered on the new-game screen, such as the number of AI empires.

Adding a system to a scenario and setting it as a spawn point

The initializer browser: groups on the left, initializers in the middle, and the star and planets the chosen one places on the right

Prepare for a new game, with a row for each thing the new game can keep, beside the scenario's Game setup counts and shapes

The steps are in Make a scenario.

If you write a mod's scenario by hand, Galaxy Forge keeps your comments, key order and formatting, and changes only the lines you edit. For mod authors covers working beside your text editor and git, and the limits.

Shapes, brushes and symmetry

The Shape tool switching a pending shape between a ring, a star and a swirl, then placing a ring of 24 systems

Painting clusters of systems and drawing lanes with six-way symmetry

The Shape tool (O) places a whole shape of systems at once, in saves and scenarios. It has circles, lines, polygons, rectangles, stars, swirls and the game's galaxy shapes. To move systems you already have into a shape, such as a ring or a grid, right-click a selection and choose Arrange.

The Spread brush (R) evens out the spacing of systems. Hold Alt to pull them together instead. Scenarios also have Paint and Erase brushes. Paint scatters clusters of systems and connects them with hyperlanes using the size and density you choose. Erase removes them again.

"Generate lanes like the game" is ticked by default on the Paint and Connect brushes. New lanes then form small clusters of systems with a few lanes between them, as the game's galaxies do.

In a scenario, with symmetry enabled, every system, hyperlane and brush stroke is mirrored around the centre of the galaxy or repeated 2 to 8 times around it.

Playing your scenario

To play a scenario on your custom map, you need the Paint a Galaxy Workshop mod, plus the Reserved Spawns submod if your map reserves specific empire slots.

Stellaris has some limitations when loading hand-made galaxies. For example, empires can start on the wrong homeworlds, while marauders and fallen empires may fail to appear. Oatmeal Problem's Paint a Galaxy fixes these issues, and Galaxy Forge scenarios are built around that system. Galaxy Forge writes scenarios in the mod's format unless you disable that option.

When your map is ready:

  1. Use File → Save into the Paint a Galaxy mod.
  2. Enable the mod in your Stellaris playset.
  3. Start a new game. Your custom map will appear as a galaxy size.

Steam may replace the mod's folder when the Workshop mod updates, so keep another copy of your map somewhere safe. Play your scenario covers the available seats, what happens on day one and the limits imposed by the mod.

You do not need Paint a Galaxy to edit a save file.

What you can see

The Inspector for a system in a save beside the Inspector for a system in a scenario: position, height, hyperlanes, planets, a station and a megastructure on one side, spawn point, fallen empire zone, initializer and scripts on the other

Select a system to open its inspector. It shows the system's position, its hyperlanes with their in-game lengths beside the real distance, bypasses, planets, fleets, flags and initializer. In a save, the planet list also shows how far out each body orbits.

Every planet, moon, star and asteroid in a save has its own page. It shows the deposits with the game's artwork, the blockers and what they cost to clear, the modifiers and moons, and any anomaly or dig site. A colonised planet's page also summarises the colony.

In a scenario, the inspector shows what a system will spawn before you start the game, and so does the system view. The Scripts tab shows the initializer and the events and effects that affect a system, along with the file and line where each one comes from. This list is a best guess and can miss things (see Limits). You can open a script file in your own text editor, such as VS Code, at the line you're looking at.

Press F to search for systems, empires, planets, fleets and nebulae by name, or for systems by what they contain, such as "gaia" or "leviathan". In a save, search also finds star types, such as "pulsar". You can pin a search so its results remain highlighted on every save you open.

Searching for gaia: the systems with a Gaia World listed under the search box and ringed on the map

Zoom in and the map shows each system's planets, stations and resources, using the art and names from your installation. The Layers menu lets you show and hide map layers, such as where each precursor's anomalies can turn up. The main layers have a number key. Get around the map lists the keys.

The Layers menu, with map layers, overlays and editing highlights, beside the Scripts tab listing the initializer and effects that touch a system

What Galaxy Forge can change and what it only shows

In a save In a scenario
System positions editable editable
Hyperlanes: add, cut, isolate editable editable
Lane lengths editable not in the file
Systems: add, rename, remove add, then reroll, rename or delete the ones you added until you reopen the file. On a save from 4.6 or later, delete ones it already had, apart from capitals and empires' starting systems editable
The game's unique and special systems and clusters add, with their anomalies, dig sites and ruins add from the Special list, or set as a system's initializer
Binary and trinary systems add, rolled or built from the stars you choose from the initializer
System heights editable not in the file
Stars: type and size editable from the initializer
Which initializer a system uses shown editable
The initializer itself (its star, planets, resources) shown shown, never written: initializers belong to the game and mod files
System layout: orbits, belts, rings editable in the system view from the initializer
Planets and moons: add, delete, copy, move, rename, resize, class, look editable shown, from the initializer
Megastructures, ring worlds included: add, move, delete editable, at any construction stage or ruined shown in the system view, from the initializer; ruins can be added, moved and deleted
Deposits, blockers, modifiers editable on any planet, colonies included, and rolled for the systems and planets you add shown, from the initializer
Anomalies, dig sites editable not in the file
Colonies shown, with their pops, and a colony can be removed shown, from the initializer
Nebulae: add, move, resize, rename, remove editable editable
Turbulent nebulae editable not in the file
Empire names and flags editable not in the file
Empire border and fill colours editable on saves from 4.5 or later not in the file
L-Gate outcome editable not in the file
Spawn points, weights, seat kinds not in the file editable
Marauder clans shown editable
Wormhole pairs editable, and natural wormholes can be moved editable on a map for Paint a Galaxy
Fallen empire zones fallen empires shown editable on a map for Paint a Galaxy
Prevented lanes, header keys, new-game counts not in the file editable
Fleets, starbases, waystations shown not in the file
Empires and territories shown shown, from scripts, best guess
Bypasses: wormholes, gateways, L-Gates shown shown, from initializers and scripts, best guess
Flags shown shown
Techs, leaders, diplomacy not shown not in the file

Keeping your save safe

Galaxy Forge edits files at the byte level, so only the parts you change are rewritten. Everything else, including data from mods or newer game versions that Galaxy Forge does not understand, is copied as it was. Open and save a file without editing it and you get the same bytes back: a scenario is identical, and a save's gamestate and meta are identical inside a freshly written zip.

  • Each save produces a timestamped backup of the previous file, with up to eight backups kept per file. The first backup is the file you originally opened.
  • When Stellaris or another program changes the file you have open, the change shows in the app. A save always asks what to do. A scenario reloads by itself, or asks first if you have unsaved changes.
  • Every edit can be undone, and the Changes tab keeps track of them.
  • The Issues tab checks for problems before you save, such as a hyperlane that exists at only one end or a system cut off from the rest of the galaxy. It is not a substitute for the game. Loading the save in Stellaris is the final check.

Save, back up and restore explains how to restore the original.

Limits

Galaxy Forge is still in beta. It edits the galaxy map, the systems and planets in it, their megastructures, and empires' names, flags and colours. Fleets, pops, leaders and techs can't be changed. The Roadmap lists what's planned next.

Galaxy Forge works with saves from Stellaris 4.0 through 4.6, the current version. Two edits need a newer save: empire border and fill colours need 4.5 or later, and deleting a system the save already had needs 4.6. Hyperlane editing also works on saves from 3.4 through 3.9. Adding systems and planets needs a 4.x save. I haven't tested Ironman saves.

If Stellaris uses Steam Cloud, Steam may restore the cloud copy over an edited save. Close Steam or disable Steam Cloud for Stellaris before playing an edited save. See Steam Cloud.

Nothing from the game is included with Galaxy Forge itself. It reads game definitions, names and artwork directly from your Stellaris installation and your enabled mods. Modded systems show up with their mod's names and artwork, and newly added systems are generated from the same files. Without an installation, the map shows plain stars with generated names, and you cannot add systems to a save.

Anything Galaxy Forge reads from scripts and events is a best guess. It follows initializers, star flags and event targets. It cannot follow scripts that loop over whole classes of systems or refer to them by name, and it treats every condition as true.

The macOS build is not signed.

After a game update

Moving systems and editing hyperlanes and nebulae only touch the galaxy sections of the save (galactic_object, hyperlane, nebula) and its brace structure. Those have not changed across Stellaris versions, so I don't expect an update to break those edits. Adding systems and editing stars, planets, megastructures, colonies, empires and wormholes go deeper into the save, so they are the edits most likely to need a fix after an update. The parts drawn from your installation can break too: star and planet art, localised names, special-system detection and script reading. If they do, the map falls back to plain stars and generated names. Anything Galaxy Forge does not understand is still copied through as it was.

Scope

A save is a game in progress, and one wrong byte can do strange things to it. I add a new kind of edit once I understand how the game handles it. It also has to be tested in-game, undoable and finished in the app before it ships.

Reading a file is safe, so I add things the editor can show more readily. Seeing planets, fleets, ownership and what a script will do on day one helps you make better edits. Expect the inspector and the map layers to stay ahead of what you can change.

How much further editing goes depends on two things: how well the current approach holds up across game updates, and what people ask for.

Bugs and requests

If you find a bug or want to request something, open an issue on GitHub. CONTRIBUTING.md says what helps in a report. If you don't have a GitHub account, leave a comment on the Workshop page instead. If possible, attach the save or scenario file where the problem occurred. That makes it much easier to investigate.

Installing

Download the latest release from the Releases page.

  • Windows: Stellaris-Galaxy-Forge-<x.y.z>-Windows-Installer.exe. It is signed by "Open Source Developer, Ian Heinrich". Windows SmartScreen may still show a warning because the signing certificate is new. Click More info, then Run anyway. There is also an MSI for managed installs.
  • Windows, without installing: Stellaris-Galaxy-Forge-<x.y.z>-Windows-No-Install.zip. Unzip it and run the app inside. It needs the WebView2 runtime, which Windows 11 already has.
  • Mac: Stellaris-Galaxy-Forge-<x.y.z>-Mac.dmg, for Intel and Apple silicon Macs. It is not signed, so Gatekeeper will refuse to open it until you run xattr -cr "/Applications/Stellaris Galaxy Forge.app", or right-click the app and choose Open.
  • Linux: Stellaris-Galaxy-Forge-<x.y.z>-Linux.AppImage, which needs chmod +x before it will run, or the Linux-Debian-Ubuntu.deb or Linux-Fedora.rpm package. All are built on Ubuntu 22.04, x86_64.

Galaxy Forge checks for updates when it starts and shows a badge when one is available. The Help menu can turn the check off or run it straight away. The Windows installer or MSI, the Linux AppImage and the Mac app install the update themselves and restart. The no-install zip and the .deb and .rpm packages send you to the Releases page instead. Every update is verified against the project's public key before it is applied. The SmartScreen warning above applies to the downloaded installer too.

SHA256SUMS in the release lists a checksum for every file, so you can verify a download before running it.

Once it's installed, the user guide's Quick start takes you from opening a save to loading it in the game.

Command line

The sgf tool reads saves and scenarios from a terminal. sgf apply applies edits that JSON files hold, with the same backups as the app. It is on the Releases page beside the app. The commands are listed in the user guide.

How it works

The file is never rebuilt. When you open a save or a scenario, its bytes are read once and kept exactly as they are. A single pass over the text records where every statement starts and ends by counting braces, and the galaxy map is drawn from that. The file is never parsed into a full model, so nothing the editor does not understand can be lost or reordered.

When you make an edit, only the statements it touches are rewritten or added: a moved system's coordinates, a lane's two entries, a nebula's member list, a new system and its planets. The new bytes go into a patch list keyed to where the old bytes sat in the original file. Every edit records how to undo itself, so undo and redo are edits too. Saving writes the original bytes out again into a new file, with the patches spliced in at their offsets. It then renames the old file to a backup and moves the new one into place. Open and save with nothing changed and the output is byte for byte the input.

flowchart LR
  File[(".sav or<br/>scenario .txt")] -->|"read once,<br/>kept as is"| Bytes["Original bytes"]
  Bytes -->|"one pass,<br/>brace counting"| Map["Galaxy map"]
  Map -->|"you edit"| Patches["Patches keyed to<br/>original offsets"]
  Bytes --> Save["Save: bytes with<br/>patches spliced in"]
  Patches --> Save
  Save -->|"backup first"| File

The full picture, with what the editor holds in memory and how the pieces relate, is in docs/architecture.md.

Building from source

Prerequisites:

  • Rust, stable, via rustup.
  • Node 22.
  • The Tauri 2 prerequisites for your platform. On Windows that is the Visual Studio C++ build tools and the WebView2 runtime, which Windows 11 already has. On Ubuntu the packages CI installs are libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf (see .github/workflows/ci.yml).

Then:

git clone https://github.com/IanHeinrich/stellaris-galaxy-forge
cd stellaris-galaxy-forge
git lfs install          # the sample saves in testdata/ are stored with Git LFS
cd app
npm install
npm run tauri dev        # builds the Rust core and opens the app

The first build compiles the Rust core and takes a few minutes. Later starts are quick. git lfs install is only needed for the sample saves the tests use, not to run the app. To make an installer for your platform instead, run npm run tauri build in app/. The bundles land under target/release/bundle/ at the repository root.

Contributing

Bug reports, feature requests and pull requests are welcome. CONTRIBUTING.md says what to include in each. Read docs/engineering-rules.md before changing code. It states the non-negotiables, the layout and how this project tests. The rest of the reference is in docs/:

Run the checks before you push:

cargo test --workspace
cargo clippy --workspace --all-targets -- -D warnings
cargo fmt --all
cd app && npm test && npm run lint && npm run build

Every pull request adds one file under changelog.d/ (changelog.d/README.md says how), or has the skip-changelog label. The pull request template lists the in-game checks that go with a change to the galaxy.

Acknowledgements

  • Oatmeal Problem, for the Paint a Galaxy mod. Everything Galaxy Forge writes for a playable scenario, from the seat scripts to the fallen empire zones and wormhole pairs, uses the mod's format, and the mod's scripts were the reference for how they behave.
  • The facts about the save format and the install were measured from the game's files. For the edge cases of how mods layer over the install (load order, replace_path) and of the script dialect, Irony Mod Manager, CWTools and jomini were the references checked against. No code from any of them is used.
  • The libraries doing most of the work in the app: Tauri, React, PixiJS, Zustand and Delaunator. In the tests, insta and proptest.

Stellaris is a Paradox Interactive title. This project is not affiliated with or endorsed by Paradox.

استكشف مشاريع مشابهة ومرتبطة

جارٍ التحميل…