Introduction to Modding Space Engineers

From Space Engineers Wiki
Jump to navigation Jump to search
beginner
Learnings

What the “fields” of Space Engineers modding are.

What these fields entail.

What the starting points for learning how to make mods are.

How to make a specific mod.

Overview

This tutorial should be your first stop when getting into modding for Space Engineers.
It will teach you about the different fields of modding the game and then point you towards more specialized tutorials and resources for each.

Fields of Modding

As newcomers to modding a specific game, oftentimes people will not be aware of what can and cannot be modded in the first place.
And what use are the greatest plans for a mod if the game developer has disallowed access to the key files needed to make those plans reality? This chapter will expand on the “three fields” of modding, which each require their own expertise and tools.
Knowing about these different fields will allow you to better understand which are relevant for your plans, and which you’d be interested in learning.

SBC Modding

SBC modding

SBC is a filetype that Space Engineers uses to save moddable data in. It contains a XML data structure. Editing these files and the information contained within is the easiest form of modding for SE.
SBC modding allows the addition of more content to the existing “framework” available in the vanilla game, but it does not allow for changing said framework.
For example, while you can add more blocks using SBC modding, you would not be able to give these blocks a functionality that does not already exist for another block currently in the game.

Example
    <Component>
      <Id>
        <TypeId>Component</TypeId>
        <SubtypeId>SteelPlate</SubtypeId>
      </Id>
      <DisplayName>DisplayName_Item_SteelPlate</DisplayName>
      <Icon>Textures\GUI\Icons\component\steel_plate_component.dds</Icon>
      <Size>
        <X>0.5</X>
        <Y>0.5</Y>
        <Z>0.01</Z>
      </Size>
      <Mass>20</Mass>
      <Volume>3</Volume>
      <Model>Models\Components\steel_plate_component.mwm</Model>
      <PhysicalMaterial>Metal</PhysicalMaterial>
      <MaxIntegrity>100</MaxIntegrity>
      <DropProbability>0.9</DropProbability>
      <Health>53</Health>
    </Component>

Scripting

Scripting is what is used to change and extend the “framework” mentioned in the last section by programming the features yourself.

Mod scripting

Mod scripts are the main form of scripting / programming done for Space Engineers and generally offers the most possibilities and freedom.
This requires knowing C#, which is a widely used programming language outside of Space Engineers and that is where you will find a plethora of tutorials for it.

Example
[MyEntityComponentDescriptor(typeof(MyObjectBuilder_Thrust), false)]
public class FancyThruster : MyGameLogicComponent
{
    IMyThrust m_block;

    private string EMISSIVE_MATERIAL_NAME = "Emissive";
    private Color GREEN = new Color(0, 255, 0);
    private Color RED = new Color(255, 0, 0);
    private Color lastColor;

    bool IsWorking
    {
        get
        {
            return m_block.IsWorking;
        }
    }

    public override void Init(MyObjectBuilder_EntityBase objectBuilder)
    {
        NeedsUpdate |= MyEntityUpdateEnum.EACH_10TH_FRAME;
        m_block = (IMyThrust)Entity;
    }
}
Ingame scripting (Programmable Block)

Scripts can also be written for the Programmable Block inside of Space Engineers.
This also uses C# and has its own API with a few similarities to the modding API.
While mod scripting is an all powerful tool to shape the world, ingame scripting is designed to be a ship computer and as such has limited access to maintain that aspect.

Programmable Block scripts are not actually mods. They are in reality a separate category because they can be installed and even created (though this is not recommended) from within the game. They are also not installed like mods, though they are still uploaded to the Steam Workshop.
Example
public Program()
{
  //Runtime.UpdateFrequency = UpdateFrequency.Update100;
}

public void Main(string argument, UpdateType updateSource)
{
  if(argument == "get")
  {
    Echo("You got it!");
  }
}
Visual Scripting (scenarios)

Visual Scripting is a form of scripting that does not require the user to write actual code. The code is instead represented in the form of a network of nodes that are connected to each other.
As a result it is much more approachable for newbies but it can only be used for scenarios.
The Visual Scripting Tool (VST) used for this is unfortunately buggy.
While it does not require the user to write actual code, knowledge of algorithms and the logic under which programs operate is still absolutely essential.

Example
VST.png

Modding Assets

Modding assets refers to creating or editing anything that is not pure data or code in Space Engineers.
While it doesn’t require as much prior knowledge to produce usable results with, modding assets does instead oftentimes require a lot of different applications to produce content with.
While the industry standard applications are generally very expensive, there are usually alternatives available that can produce similar results for free - albiet they may require you to clear a couple additional hurdles in the process.

3D Modelling

3D modelling is not an easy skill to learn but there are many applications and much more tutorials available on the internet. 3D modelling is creating objects in SE.
Be it blocks, tools, components or even player characters - they were all created in a 3D modelling application.
It is also not required to make custom textures for them as the game has a variety of tiled materials and textures which are generally preferred to avoid increasing the texture memory requirements.

Example
3D Modelling.png
Texture modding

Textures are at their core image files in a specialized container optimized for 3D rendering (.dds), they can also be .png in some specific cases.
It's what give models their color, particles their shape and icons their whole visual. Textures can also be used as data to decide how a model is shaded or if it's colorable, and planets use them for heightmap and voxel material distribution aside from voxels using them for color and shading just like models.
They can be edited independently and require a separate set of applications to mod.
This is one of the easier disciplines and a pretty good point to start with should you want to look into modding the game’s visuals.

Example
Texture Modding.png
Note that modified textures might not be loaded by the game without also including the corresponding models within a mod.
Audio modding

Audio modding is often forgotten but is nevertheless an important aspect.
Creating and editing sound effects requires another separate set of tools, but is fairly straightforward.

Example
Audio Modding.png

Starting Points

Modding fields each require their own skillsets. This tutorial is not intended to teach them to you, however, it will guide you to the places where you can learn about them. The following are the starting points for the fields of modding.