Medieval Engineers

Medieval Engineers

Not enough ratings
Official Guide: Modding for textures
By George.Mamakos and 1 collaborators
Official guide for texture modding in Medieval Engineers.
   
Award
Favorite
Favorited
Unfavorite
1. New DX11 system overview
Medieval Engineers uses the new DX11 PBR system which is different from the DX9 in many ways.

PBR basics: https://docs.google.com/a/keenswh.com/document/d/1Fb9_KgCo0noxROKN4iT8ntTbx913e-t4Wc2nMRWPzNk/edit.

DX11 has 3 or 4 types of textures based on the properties of the model.

  • *_cm.dds - Color(albedo) and Metalness map (alpha)
  • *_ng.dds - Normal map and Gloss map (alpha)
  • *_add.dds - Add texture - AO (Red channel), Emissive (Green channel) and Parallax (Blue channel) and Custom alpha mask or color mask (alpha channel)
    If you are not using one or more channels, make them black, this way you can avoid future problems with unwanted effects
  • *_alphamask - alpha map

Color (Albedo)

Metalness (alpha)

Normal map

Glossiness (alpha)

AO

Custom Color Mask (alpha)


Color(Albedo) - color of the model
Metalness - if it is a metal object or not; metal has white color, non-metal has black color
Normal map - DX11 uses a different green channel than DX9. DX11 has X+,Y+,Z+ (in 3ds max you must check in normal map “flip green channel”)
Glossiness - It is the same thing as Roughness but inverted. The black color is no-gloss and white is full-gloss surface.
AO - baked AO
Parallax - A height map used by the renderer to add artificial depth to surfaces. The scale is defined in the mwm's xml file.
Custom Color mask - the mask for custom coloring the model: black color - model will not change color, white color - model will change color, when we want to change the model’s color, then the base color in Albedo must be white
Alpha Mask - mask for cut-off alpha.

Currently, all textures must be specified in XML material manually. You must add this line to XML material with the right path to textures.
For example:
<Parameter Name="ColorMetalTexture">Textures\ME_geo_upper_cm.dds</Parameter> <Parameter Name="NormalGlossTexture">Textures\ME_geo_upper_ng.dds</Parameter> <Parameter Name="AddMapsTexture">Textures\ME_geo_upper_add.dds</Parameter> <Parameter Name="AlphamaskTexture">Textures\ME_geo_upper_alphamask.dds</Parameter>
For Alpha masked models you must change “Technique” in the parameter:
<Parameter Name="Technique">MESH</Parameter>
From MESH to ALPHA MASKED or FOLIAGE (use for environment like trees, grass, etc.)

For Parallax set the height using
<Parameter Name="ParallaxHeight">0.023</Parameter> <Parameter Name="ParallaxBackOffset">0.8</Parameter>
For “Material creation” we added a new system. You can use the old system where the material definition is in FBX’s XML ( XML created for FBX file) or you can create only the material itself in its own XML file which is saved inside the “Material” folder and share it with several other FBX’s XML.
The definition for this FBX’s XML looks like this:
<?xml version="1.0"?> <Model Name="Default"> <Parameter Name="Centered">false</Parameter> <Parameter Name="RescaleFactor">0.01</Parameter> <Parameter Name="RescaleToLengthInMeters">false</Parameter> <Parameter Name="SpecularPower">10</Parameter> <Parameter Name="SpecularShininess">0.8</Parameter> <Parameter Name="RotationY">180</Parameter> <MaterialRef Name="Lower_body_mat" /> <MaterialRef Name="Upper_body_face_mat" /> <MaterialRef Name="Upper_body_shirt_mat" /> <MaterialRef Name="Upper_body_leather_mat" /> <MaterialRef Name="Upper_body_beard" /> <MaterialRef Name="SledgeHammer" /> </Model>
Where <MaterialRef Name="*" /> is the name of our material; for example Character.xml which is our material definition in the Material folder.

And the material XML in the Material folder is like this:

<MaterialsLib Name="Character Materials"> <Material Name="Lower_body_mat"> <Parameter Name="SpecularIntensity">0</Parameter> <Parameter Name="SpecularPower">2</Parameter> <Parameter Name="DiffuseColorX">255</Parameter> <Parameter Name="DiffuseColorY">255</Parameter> <Parameter Name="DiffuseColorZ">255</Parameter> <Parameter Name="Technique">MESH</Parameter> <Parameter Name="DiffuseTexture">Textures\Models\Characters\ME_geo_lower_me.dds</Parameter> <Parameter Name="NormalTexture" /> <Parameter Name="ColorMetalTexture">Textures\Models\Characters\ME_geo_lower_cm.dds</Parameter> <Parameter Name="NormalGlossTexture">Textures\Models\Characters\ME_geo_lower_ng.dds</Parameter> <Parameter Name="AddMapsTexture">Textures\Models\Characters\ME_geo_lower_add.dds</Parameter> </Material> …. …. </MaterialsLib>
2. Preview and conversion of textures to DDS
See http://www.spaceengineersgame.com/model-viewer.html for details of our model viewer.

All textures are saved in TIFF, TGA, or PNG (without compresion - all 8-bit per channel unless you have 16bit per channel the textures will be brighter in the game) and then you can convert it to DDS with Texconv, available from microsoft at https://github.com/Microsoft/DirectXTex/releases. Documentation for Texconv can be viewed at https://github.com/Microsoft/DirectXTex/wiki/Texconv.

Textures can also be exported directly to DDS format from Photoshop using the Intel Texture Works plugin from https://software.intel.com/en-us/articles/intel-texture-works-plugin

CM and ADD textures should use sRGBA and NG textures should use UNORM.
BC7 compression scheme is recommended above BC3 and BC5.
3. MWM Builder
A Miner Wars Model, MWM for short, is the packed model format used by the VRage engine. To create MWM's you have to use the MwmBuilder. MwmBuilder works the same way as for Space Engineers; you need to add an FBX file and an XML file in the folder. You can aquire the MwmBuilder.exe or ModelBuilder.bat* in MedievalEngineers ModSDK. *ModelBuilder.bat is currently not included in the SDK. It has never been updated to meet Medieval Engineers requirements. You can use the model builder from Space Engineers SDK if you wish, but not all features may be fully supported at this time.

MwmBuilder.exe is an old system to build MWM’s for the game, you just add your FBX and XML to the folder and run MwmBuilder.exe and your MWM is created based on your files.

3.1 ModelBuilder Overview
ModelBuilder is basically the same system but with more options and settings and you have more control over what can be built and what not.

You run the ModelBuilder with ModelBuilder.bat in MedievalEngineersModSDK\Tools\VRageEditor2.

This is fresh started ModelBuilder:


1. This area is for general controls like run Build of models, set your session settings and general settings (more info in 3.2 ModelBuilder tabs)
2. In this area, you pick FBX models which you want to build to MWM.
3. This area will be for Log information in the future, right now is not working (you can close it by “X”).
4. In this area, you see your session settings (to see how you can set up sessions check 3.3 Session settings)

Before you start building mwm and other cool stuff, you must set up the ModelBuilder session.

3.2 ModelBuilder tabs
First of all ModelBuilder tabs

Builder Tab:

In Builder tab, you have all the things you need to build MWM. You have two sections: Build session and Model

Build session:
Default in drop up menu appears the name of your picked Session (more info about Session can be found below)
Add - you add a new Session
Delete - you delete a Session
Build - is for running build of models
Check outdated - is for checking outdated mwm that needs to be rebuilt, based on material set up (more info about it on the top)

Model:
Examine - is for examining if fbx has all xform and rotations right. Just select your FBX by clicking on Examine.

Vrage Tools Tab:


On the Vrage Tools tab, you have three sections: System, Windows, and Themes

System:
Plugins - shows the plugins that the VrageEditor uses for ModelBuilder
Settings - is where you set up the path to MwmBuilder.exe

Windows:
Model builder turns on/off Model builder window
Model builder settings turns on/off the Model builder settings window

Themes:
Here you can change the theme of how the ModelBuider looks.

3.3 Session settings

Export xml - when checked, the builder will be creating an XML from your FBX if it is not already created; if it is, the builder will check for materials changed in FBX.
Force rebuild - when checked, the builder will rebuild the model every time when you press the Build button
Check open boundaries -
Content path - this is the path to your content folder where you have FBX files.
Name - Name of the session
Output path - this is the path to your output folder, where ModelBuilder will be saving the created MWM’s.
Pause after build - when checked, the window with build information will stay open, it can be closed by pressing any button on the keyboard.
Threads count - how many threads will the Builder use; higher count - faster build

3.4 Build FBX to MWM

When you set up your Session, you are ready to build your models.
It is easy, just find your model in the list and select it and then click Add to build or just double-click on FBX. The FBX is added to the build list. Now you just need to click on the Build icon on the upper panel and your MWM is built. You will find it in the output folder that you set up in the Session settings.

When you want to remove an FBX from the list, just choose the FBX that you want to remove and click “Remove selection” or double-click. When you want to clear the list and remove all the FBX in the list, click “Remove all”.
< >
21 Comments
Snowz Jan 15, 2016 @ 3:17am 
PROTIP: "If you are not using one or more channels, make them black, this way you can avoid future problems with unwanted effects"
This is false. With the AO map(*_add.dds red channel) it must be white, otherwise the texture will appear black in sunlight and only be coloured in artificial light.
🐾匚卄乇丂卄丨尺乇🐾 Oct 26, 2015 @ 11:43pm 
When I run the DX9 - DX11 script, nothing happens. Any documentation on it? Nope. Anyway to find out what's wrong? Nope. After downloading 2 gigs of SDK files and spending several hours trying to convert textures, I've given up. A lot of other games just accept PNG and JPG files, but NOT Space Engineers. What a waste.
Dorpig Oct 18, 2015 @ 6:22am 
And _de? Diffusion right? Anything else inh the alpha?
Dorpig Oct 18, 2015 @ 6:17am 
What does the ns extension mean? Normal Spectral?
Blaketato Sep 27, 2015 @ 4:43am 
+STORI3D PAST Productions There was a strong community of modders... We all left because if blatent misscommunication with the devs.

and Now I am back because I miss the damn thing.
Smart Bear Jul 13, 2015 @ 9:01am 
Вот еслиб это всё ещё и на русском было, была бы песьня!!!!
STORI3D PAST Productions Jun 22, 2015 @ 5:47am 
I also wish there was more energy being devoted to helping people figure this out. A strong community of modders could help create ultra-realistic worlds from almost any era, and flesh them out with amazing placeable items. Modding could make this game -huge-! It's all a foreign language to me, and I don't have enough time to sit down and try to learn it on my own.
Dorpig Jun 20, 2015 @ 6:29pm 
The devs should really attempt to answer these questions. They go through the trouble to make a guide but don't help people through it.

Anyways, I am still having trouble making custom voxel textures; they always show up black. Somehow the glossiness file worked.
BaronZ May 31, 2015 @ 12:46am 
Why are you only able to select the fbx in the Model Builder? Shouldn't you be also able to add .xml and .hkt files?!
Telamont May 29, 2015 @ 4:20pm 
OK so I have a question, when I try to use the compression option in the texture converter it gives me a error saying (couldn't compress image parameter incorrect). But when I change it form 'Dx11' back to None it works fine; but my texture files are still huge.