Skip to content

Latest commit

 

History

82 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FModelToSC

Convert FModel‑exported Squad mod data into JSON payloads that SquadCalc can read. The project now ships with two tooling entry points that work together:

Parsed layers for Steel Division mod can be explored here Squadcalc alt.

  • Layer exporter (com.pipemasters.Main) – consumes a list of gameplay layer exports (the layerdata.json files that reference the layer, objectives, map assets, capture points, etc.), resolves every linked asset that FModel exported, and writes SquadCalc‑compatible payloads to output/. The exporter batches multiple entries, supports inline comments, ignores duplicates, and keeps track of any missing assets.
  • Units exporter (com.pipemasters.units.UnitsMain) – scans exported faction setup data and builds units.json with teams, vehicles, and commander abilities for every faction used by your mod. It recursively walks parent assets when fields are not defined on the current file so the end result is complete before you start converting layers.
  • Spawn commands exporter (com.pipemasters.spawncommands.SpawnCommandsMain) - scans the same faction setup data and writes an admin AdminCreateVehicle command list grouped by faction, ground vehicles, air vehicles, and water vehicles.

The repository also contains a mock SquadCalc backend (mock-api/) so you can preview your converted layers locally.

Currently have some hardcoded values for path resolving just for Steel_Division mod, so in case you want to parse other mods you probably need to modify AssetResolver.


Prerequisites

Tool Purpose
FModel + the mapping file SQUADGAME10.usmap from this repository Export gameplay layers, map data, faction setups, and any missing assets.
FModel fork Provides the Missing Asset Extractor used to dump extra assets listed in missing-assets.txt.
Java 21 (JDK) + Maven Build and run both exporters.
Node.js 18+ and npm Run the mock API server.
SquadCalc project Run local instance of SquadCalc frontend
Optional: IntelliJ IDEA or any Java IDE For running the exporters without Maven commands.

0. Configure FModel

  1. Launch FModel and choose the Squad game profile. image

  2. Go to Settings → General and enable Local Mapping File. Point it at SQUADGAME10.usmap (bundled with this repo).

image
  1. Drop your mod folder into \Squad\SquadGame\Plugins\Mods\ so FModel can load it.
image
  1. Check that Fmodel sees your mod, then press load.
image
  1. If you plan to use the Missing Asset Extractor, install the fork alongside your normal FModel install. I recommend you to, cause thats about ~100 assets to extract.
image

All exports referenced below assume you right‑click assets or folders in FModel and choose Save properties (.json).


1. Export faction setup data (for UnitsMain)

Run this step once per mod, then rerun only when you add factions or vehicles.

  1. In FModel open your mod → Content/Settings/FactionSetup.
image
  1. Export the entire FactionSetup folder to JSON (every subfolder per faction should now contain the exported .json files). Keep the directory structure exactly as FModel produced it.

  2. Put path to Factionsetup as an argument, e.g. C:\Program Files\Fmodel\Output\Exports\SquadGame\Plugins\Mods\Steel_Division\Content\Settings\Factionsetup.

Tip: Skip Template factions when exporting if they exist; the parser ignores them. Remove factions that are deprecated/WIP.


2. Build output/units.json with UnitsMain

  1. From the repo root run a Maven build (first run downloads dependencies):

    mvn package
  2. Execute the units exporter, pointing it at the exported FactionSetup directory:

    mvn exec:java \
      -Dexec.mainClass=com.pipemasters.units.UnitsMain \
      -Dexec.args="C:\Program Files\Fmodel\Output\Exports\SquadGame\Plugins\Mods\Steel_Division\Content\Settings\Factionsetup"
  3. The tool writes output/units.json and logs how many factions were parsed for Team 1 and Team 2.

  4. If anything is missing, the run also creates/updates missing-assets.txt in the project root. Every line is an asset that needs to be exported (commander ability settings, vehicle data tables, delay presets, etc.).

  5. Open the yobaNGE FModel fork → Tools → Missing Asset Extractor, paste the contents of missing-assets.txt, press Extract. I just extract stuff in default Fmodel directory. Parser expect extracted assets to have same hierarchy as in Fmodel.

  6. Rerun step 2 until missing-assets.txt is no longer populated. When it stays empty the unit data is complete.

UnitsMain only needs to run again when you add new factions, modify vehicles, or see new missing assets. The layer exporter reads output/units.json automatically; you can also pass a custom path as the optional second argument to Main (see below).


3. Build output/spawn_commands.txt with SpawnCommandsMain

Run this when you need a server-admin friendly vehicle spawn command list in the same style as SPAWN COMMANDS_v1.25.

  1. Make sure the FactionSetup folder and the referenced vehicle settings / vehicle blueprint assets are exported from FModel. Use the same source directory that you pass to UnitsMain.
  2. Execute the spawn commands exporter:
    mvn exec:java \
      -Dexec.mainClass=com.pipemasters.spawncommands.SpawnCommandsMain \
      -Dexec.args="C:\Program Files\Fmodel\Output\Exports\SquadGame\Plugins\Mods\Steel_Division\Content\Settings\Factionsetup"
  3. The tool writes output/spawn_commands.txt.

The output is grouped by faction directory name, then by GROUND and AIR. Boat/RHIB vehicles are deduplicated into a final WATER VEHICLES / ALL FACTIONS section. Amphibious ground vehicles stay in their faction GROUND section. Each command uses the full Unreal VehicleVersions.AssetPathName, while the comment after // uses the readable vehicle name resolved from vehicle settings or vehicle data tables.

If missing-assets.txt is populated after the run, export those listed assets with the Missing Asset Extractor and rerun the command.


4. Export gameplay data for a layer

For every layer you want to convert:

  1. In FModel navigate to Maps/<MapName>/Gameplay_Layer_Data/Layer/ and export layerdata (the asset is usually named same way as layer or closely resembles it). This JSON references the actual gameplay layer asset.
image image
  1. Ensure the referenced assets exist in your export directory. The layer exporter follows those references automatically. If a file is missing it will be written to console during conversion.

Keep exporting gameplay data for every layer you want to convert—the next step batches them in a list.


5. Build a layer list (layers.txt)

com.pipemasters.Main now consumes a text file where each non-empty line tells the exporter what to convert. The repository ships with an example layers.txt.

  1. Put the absolute path to a layerdata export on its own line, e.g.
    C:\Program Files\Fmodel\Output\Exports\SquadGame\Plugins\Mods\Steel_Division\Content\Maps\Yehorivka\Gameplay_Data\Layer\SD_Yehorivka_Invasion_v5.json
    
  2. Optional: add a second JSON path (separated by whitespace) that points to the actual gameplay layer file when the resolver cannot infer it from the gameplay data.
  3. Paths that contain spaces should be wrapped in quotes. The parser also accepts Windows style backslashes.
  4. Blank lines and lines starting with # or // are ignored, so you can group entries and leave comments.
  5. Duplicate gameplay data paths are automatically skipped.

Keep this file alongside your exports so that missing-layers.txt (written next to the export root) stays easy to find.


6. Convert the list with com.pipemasters.Main

With output/units.json in place you can now create SquadCalc‑compatible layer payloads:

mvn package
mvn exec:java \
  -Dexec.mainClass=com.pipemasters.Main \
  -Dexec.args="layers.txt"

What the arguments mean:

  1. Required: path to the layer list text file described above.
  2. Optional: path to a units.json file. If omitted, the tool uses output/units.json from the project root.

Successful runs print the detected layer version, write the converted payload to output/<LayerName>_vX.json, and log the absolute path. For each gameplay data entry the exporter updates missing-layers.txt (stored alongside your exported assets) with any unresolved references—export those files via FModel, copy them into your exports folder, and rerun the batch.

The exporter preserves whatever folder structure you have under your export root. You can point it directly at an export from FModel or at a copy living elsewhere on disk.


7. Preview layers with the mock SquadCalc API

The mock server lives in mock-api/ and now proxies missing data to the live SquadCalc service when possible.

cd mock-api
npm install
npm start
  • Base URL: http://localhost:4000/api
  • Static images are proxied from https://squadcalc.app/api/img/..., so you no longer need to download image assets manually.
  • /api/get/layer?name=SD_* is served from local JSON files in mock-api/data/get/layer/.
  • /api/get/layer for other names is proxied to https://squadcalc.app/api/get/layer.

To view a converted layer in SquadCalc:

  1. Copy output/YourLayer_vX.json to mock-api/data/get/layer/YourLayer_vX.json.
  2. Add the layer name to mock-api/data/get/layers/<MapName>.json so it appears in /api/get/layers?map=<MapName>.
  3. Point your SquadCalc .env at the mock server:
    API_URL=http://localhost:4000/api

Use npm run dev for auto‑reload while tweaking the mock server code.


Repository layout

  • src/main/java/com/pipemasters/spawncommands/SpawnCommandsMain.java - spawn commands text exporter entry point.

  • src/main/java/com/pipemasters/Main.java – layer exporter entry point.

  • src/main/java/com/pipemasters/units/UnitsMain.java – units exporter entry point.

  • output/ – generated units.json and converted layer files.

  • layers.txt – sample layer batch definition consumed by com.pipemasters.Main.

  • mock-api/ – local backend with Express, JSON fixtures, and proxy behaviour.

  • SQUADGAME10.usmap – mapping file for FModel’s Local Mapping setting.


Troubleshooting

  • Layer list file '<path>' does not exist – double‑check the path you passed as the first CLI argument. Drag‑and‑drop layers.txt into the terminal to capture the absolute path if needed.
  • Gameplay data file does not exist – fix or re-export the entry listed on that line in layers.txt. Quoting the path prevents spaces from being split into multiple tokens.
  • Unable to resolve gameplay layer file / missing-layers.txt keeps filling up – export every asset listed in the file via FModel, copy it into your export directory, and rerun the layer exporter.
  • missing-assets.txt lists more files after running UnitsMain – repeat the Missing Asset Extractor workflow until the file stays empty.
  • Layer references factions that are not in units.json – rerun UnitsMain after updating your mod, then reconvert the layer.
  • Mock API 404s for your map – ensure you copied the converted layer JSON to mock-api/data/get/layer/ and added the layer name to the corresponding map list file under mock-api/data/get/layers/.

Current limitations

  • Layers that are not Invasion, RAAS or AAS will likely have issues. Or straight-up won't parse.
  • For non Steel Division factions code modification is required.

About

Whatever this is, lol)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages