Finding Source Information
This article is a draft. You can help Medieval Engineers Wiki by completing it. Click to edit this page
Most of the configuration information for Medieval Engineers can be easily looked up in the data folder. This can often seem like a daunting task because there is a lot of information, but it becomes quite easy with an understanding of how data is stored and what types you may need to look for.
What is game data
Before you can find the data you want, you have to understand how it is stored.
- SBC Files
- Most of the information or settings in Medieval Engineers is stored in XML based text files. These files are given the extension SBC which stands for Sandbox Configuration. This is because worlds in the VRage engine are internally referred to as sandboxes. Any file that is used to configure the sandbox is a sandbox configuration file.
- Definitions
- SBC's that configure default states for objects are referred to as definitions. When an object is added to the game world it is created using the definition, containing default settings. If the object is being loaded from a saved world, then the saved settings are applied on top of the definition by overwriting the default values. For the wiki, only the default settings (definition) are useful. All definitions should be sourced from the Data folder.
- ObjectBuilders
- Because SBC files are stored (serialized) as XML they must be read (deserialized) into memory to be used. This is accomplished by custom serializers called object builders. These object builders have only one job and that is to load matching definitions into objects that can be used by the game. There is a custom object builder for each type of definition. The game loads definitions by checking the definition's type and using the matching object builder to load it. Object builders use very strict naming guidelines:
MyObjectBuilder_{TypeName}Definition
You'll notice the Definition part at the end. This is important because there are often duplicate object builders that are used for serializing and deserializing data from save files. Those other object builders don't have Definition in the name.
The following terms will help you to identify definitions. You will probably use this knowledge when searching
- xsi:type
- Each definition has a xsi:type that matches its object builder. There are many definitions that use each xsi:type.
- Id
- Each definition has an Id that contains a Type and a Subtype.
- Type
- The Type of the definition is the deserialized object type. This is usually similar to the object builder type. There are many definitions that use each Type.
- Subtype
- The Subtype of the definition is the name of the particular object definition. There is one definition that uses each Subtype for any given Type.
- Multiple definitions
- If there are multiple definitions with identical object builders and Ids (Type and Subtype) then overwriting will occur. This is determined by load order which is undependable for game data. (It shouldn't happen but mistakes can be made). This process is how definition modding works - definitions are loaded from the game, then they are loaded from any mods. The mods add new definitions or overwrite existing ones.
- Definition merging
- It is possible to create a definition that modifies an existing definition. This process is called definition merging and can be identified by either a
Merge=""
attribute or aCopy=""
attribute in the Definition tag. The difference is that merge updates the existing definition but copy creates a separate copy first and then modifies the copy. Merge uses the original definition's Id. Copy uses a new Id and includes a CopyFrom tag that includes the Id information of the original definition.
How to find game data
To find the data you need, you must search the Data folder for definitions that match the appropriate object builder. The rest of this page will tell you how to find the Data folder, how to search all data files, and what object builders to search for.
Where to find game data
Matching in-game objects to ObjectBuilders
Game Object | Object Builders |
---|---|
Example | Example |
Example | Example |