IroncladGames / tools

Official Modding Tools provided by Ironclad. May be used for Sins of a Solar Empire 2.
https://store.steampowered.com/app/1575940/Sins_of_a_Solar_Empire_II/
28 stars 26 forks source link
modding

Iron Engine 3 Tools

Public tools provided by Ironclad Games to support modding Iron Engine 3. Iron Engine 3 was used to build Sins of a Solar Empire II

Getting Started

Documentation

SolarForge

GUI editor for working with:

Quick Start

MeshBuilder

Converts raw gltf mesh files into Iron Engine 3 specific mesh files (either binary or json).

More information on how to author meshes and convert them to .gltf from other formats will be forthcoming.

Quick Start

From command line:

.\MeshBuilder\bin\MeshBuilder.exe --input_path=examples/meshes/advent_interceptor_strikecraft.gltf --output_folder_path=.out --mesh_output_format=binary

Mesh Textures

Mesh Textures have specific requirements to look correct with Iron Engine 3's shaders. Use Texconv to convert from .png to .dds using the specifications below. This process can be simplified and automated by using Peon.

For clarity, user interface elements should stay as .png and information on particle textures will be forthcoming.

Type Format Command Line Example
Color BC7_UNORM Texconv.exe -f BC7_UNORM -y "<path/in.png>" -o "<path/out.dds>" advent_interceptor_strikecraft_clr.png
Mask BC7_UNORM Texconv.exe -f BC7_UNORM -y "<path/in.png>" -o "<path/out.dds>" advent_interceptor_strikecraft_msk.png
ORM BC7_UNORM Texconv.exe -f BC7_UNORM -y "<path/in.png>" -o "<path/out.dds>" advent_interceptor_strikecraft_orm.png
Normal Map BC5_SNORM Texconv.exe -f BC5_SNORM -y "<path/in.png>" -o "<path/out.dds>" advent_interceptor_strikecraft_nrm.png

Mesh Color Texture

Red Green Blue Alpha
red green blue opacity (material dependent)

Mesh Mask Texture

Red Green Blue Alpha
primary team color secondary team color emissive mask strength emissive hue strength

Mesh ORM Texture

Red Green Blue Alpha
occlusion roughness metalness unused

Mesh Normal Map

Red Green Blue Alpha
tangent bitangent normal unused

Effect Textures

Generally the same as a Mesh Texture. All particle textures must have .texconv file in the same folder for Peon to build them properly. Refer to Using Peon to Build Textures.

General Texture Notes

All texture sizes must be multiples of 4.

Using Peon to Build Textures

It is possible to generate .dds texture files using the rules described above but we recommend using Peon to automate this process when packaging Mods. Just keep the raw .png files and don't worry about generating the correct .dds files yourself.

Peon will build textures in two ways:

  1. Peon will look for .mesh_material file found side-by-side textures to determine the role of each texture. This will be generated by MeshBuilder. For example advent_interceptor_strikecraft.mesh_material
  2. Peon will look for a .texconv file in the same directory side-by-side your source textures. This file has rules describing the textures found in the folder.
    {
    "*.png": "Particle"
    }

Example

  1. Download Texconv
  2. Run Peon with path to texconv.exe
    py run-peon.py -s .\examples\meshes\textures -d .out\converted_mesh_textures --texconv_exe_path c:/path/to/your/texconv.exe
    py run-peon.py -s .\examples\particles\textures -d .out\converted_particle_textures --texconv_exe_path c:/path/to/your/texconv.exe

Mesh Materials

Coming at a later date.

JSON Schemas

JSON Schema files are provided for all entity files used by Iron Engine 3. This will assist authoring and allows files to be validated before they are even loaded.

If using Visual Studio Code you will get auto-complete and invalid value squiggles due to .vscode/settings.json added to this repo. Check out trader_scout_corvette.unit.

Peon

Peon is a build tool used to prepare and package files for mods.

For example given the source:

source/foo
    /new_ship
        - new_ship.unit
        - new_ship.mesh
        - new_ship_texture_clr.png
        - new_ship.weapon
        /random_folder_for_more_stuff
            - en.localized_text_csv

Peon will restructure the data in a form that the game expects:

out/foo
    /entities
        - new_ship.unit
        - new_ship.weapon
    /meshes
        - new_ship.mesh
    /textures
        - new_ship_texture_clr.dds
    /localized_text
        - en.localized_text

Peon will then generate foo.zip in a form that can be directly uploaded as a complete Mod.

Quick Start

Use run-peon.py script to simplify the command line arguments necessary to run Peon.

py .\run-peon.py --src_folder=".\examples\mods\super_fast_trader_scout_corvette" --dst_folder=".out\super_fast_trader_scout_corvette"

This will generate a usable mod folder that can be used locally by copying to %localappdata%/sins2/mods/

You can also generate a .zip file to update to mod.io by adding --package_mod

py .\run-peon.py --src_folder=".\examples\mods\super_fast_trader_scout_corvette" --dst_folder=".out\super_fast_trader_scout_corvette" --package_mod

Building ShadersMakes the modding workflow cozier, with various QoL features to simplify ship rigging along with helpful documentation in the side panel

We will be providing official .hlsl shaders at a later date. If you want to create your own shaders you can use Peon to compile them for the game.

If you would like to use Peon to compile shaders:

py .\run-peon.py -s .\examples\shaders -d .out\shaders --fxc_exe_path c:/path/to/fxc.exe

LocalizedTextBuilder

Very simple command line app that converts csv files to Iron Engine 3 compatible localized text in JSON format.

Other Links

Sins2 Blender Extension

Export meshes directly from Blender.

Makes the modding workflow cozier, with various QoL features to simplify ship rigging along with helpful documentation in the side panel