Testing & Publishing

So you've built something. This page is about proving it works and getting it into other people's games.

Testing as you go

If your mod has a screen, the mock bridge gives you: npm.cmd run dev:mock, open the printed URL, and use the bottom-right launcher (or a ?screen= / ?sidebar= query param) to jump straight to your UI, with fixture data standing in for the live game. That's also covered in full over on Mod Screens.

For a campaign, the World Editor lets you link it to a real game build and preview the scenario against your enabled mods, and it'll catch missing-content mistakes along the way - if the map declares a requiredContentPacks that isn't enabled in the preview set, export will warn you. There's more on that in The World Editor.

Eventually, of course, you drop the pack into Mods/ and run the actual game. The campaign should appear in the main menu; the buildings, traits and interactions should show up in play; and any disables and overrides should have taken effect. A checklist for a full pass:

  • The campaign appears in the menu and starts.
  • The exported map looks right - terrain, rivers, provinces, settlements, routes.
  • Script content shows up and behaves (buildings build, traits apply, interactions run).
  • Your WebUI screen opens from its topbar button and its bridge calls return.
  • Disabled base content is actually gone; overridden icons/data show your version.
  • Saving and loading a game with your mod enabled works.

Validate

There's no separate validator to run - the game validates your mod for you when it loads it. Drop the pack into FallOfAnEmpire/Mods/, launch the game, and open the Mods manager: anything wrong with mod.json or the file layout is reported there. If your mod has a WebUI package, build it first (npm run build in its WebUI/ folder), because the game expects the built dist/ files the webui block points at to exist. Campaigns get a second check earlier, in the World Editor, which warns at export if a required content pack isn't enabled in your linked-build preview set.

Package

A mod is just its folder, so there's no packaging step to run either. To share it on the Steam Workshop, the in-game uploader bundles and uploads the folder for you (covered below). To share it any other way, zip up the Mods/<ModId>/ folder itself - that folder is exactly what another player drops into their own FallOfAnEmpire/Mods/.

A finished pack contains everything the game needs in that one folder: the exported campaign data under Data/, your Script/ files, the built WebUI dist/ and its styles, any packaged Content/ assets, your localisation PO files, and mod.json tying it all together. It's good practice to include a short readme and release notes so players know what the mod does and what it's compatible with.

Uploading to the Steam Workshop

You upload straight from inside the game. There's no separate uploader tool and you don't touch SteamCMD - the game's Mods manager handles the whole thing through Steam.

Before you start, make sure your pack sits in Mods/<ModId>/, loads cleanly in the game, and has its WebUI built if it has one. Then:

  1. Launch the game through Steam, signed in to the account you want to publish under. The uploader only works when Steam is running and Workshop is available.
  2. Open the Mods manager from the main menu, where your local pack appears in the list of installed mods.
  3. Choose the upload-to-Workshop option on your pack. It's enabled once the pack can be uploaded - a valid mod.json and an available Steam connection - so if it's greyed out, check the Mods manager for a reported problem and make sure Steam is running.
  4. Confirm, and wait while the game creates a new Workshop item under your account and uploads the pack's files. Progress shows in the manager.
  5. Finish the listing on Steam. A new Workshop item starts out hidden, so open its page on Steam, add a title, description, preview image and tags, and set its visibility to public once you're happy with it.

To update a published mod later, bump the version in mod.json, re-validate and rebuild, and upload again from the same manager. Because the id is unchanged, that updates the existing Workshop item rather than creating a new one. Some mod changes need a game restart to take effect, so relaunch before you test the result.

Lords of Sicily is the live example - it's published on the Workshop and its full World Editor source is in the Sicily repo, so you can see exactly how a finished, shipping mod is put together.

A few habits make a mod a good citizen once it's public. The most important is to keep your id stable forever, since it's how the Workshop, save games and other mods' dependencies all refer to your pack - bump the version for updates, but never touch the id. It's worth setting loadOrder with some thought too: a mod meant to override or patch others needs a higher loadOrder than them, while a mod meant as a foundation for others to build on should sit low. Declaring dependencies and incompatible helps as well, so the game and your players know what your pack needs and what it clashes with.

Have fun with it, and enjoy seeing what you can make.