1. This forum is obsolete and read-only. Feel free to contact us at support.keenswh.com

Need help learning how to create a new Ore by editing an existing one

Discussion in 'Modding' started by Celludriel, Apr 28, 2020.

Thread Status:
This last post in this thread was made more than 31 days old.
  1. Celludriel

    Celludriel Trainee Engineer

    Messages:
    4
    Hey,

    I'm trying my first hand on a mod for space engineers. For my first attempt I like to create a new Ore by editing the Iron ore. Nothing to special what I like to do is:

    • Take all the data files from iron ore and edit them by renaming the key values
    • Take all the textures and recolor them from red to green
    • Not change or edit the models at all but reuse them

    This is what I've learned so far, I believe I need the following files

    Code:
    /Textures
      /Voxels
    	- Iron_01_ForAxisXZ_add.dds
    	- Iron_01_ForAxisXZ_cm.dds
    	- Iron_01_ForAxisXZ_distance_add.dds
    	- Iron_01_ForAxisXZ_distance_cm.dds
    	- Iron_01_ForAxisXZ_distance_ng.dds
    	- Iron_01_ForAxisXZ_ng.dds
    	- Iron_01_Thumbnail.dds
    /GUI
      /Icons
    	- ore_Fe_iron.dds
    /Models
      /Components
    	- Sphere.mwm
    /Data
      - VoxelMaterials.sbc
      - PhysicalItems.sbc
    What I do not know are following topics

    • What tool to use to open up the dds files I tried Gimp with the DDS plugin and I could only open up the thumbnail dds file
    • I was able to open some of the dds files in visual studio but I couldn't make heads or tails of it some had 12 layers and it was a big green grid with I think some brownins lines on it Iron_01_ForAxisXZ_distance_cm.dds was the file. How do you even begin on that ? I had hoped to be able to open a paint program and then use a recolorize or color replace tool, but this went beyond me. If someone can explain or direct me to good resources how to even begin as an absolute beginner on this ?
    • When I have edited everything how do I package this into a mod ?
    • How can I then run it and test it by spawning my new deposit in front of me ?

    I hope to learn a few of these here cause my ultimate goal is creating a new ore , turn it into an ingot, then make a blueprint to make a new type of plate and then use those plates in a full set of armor cubes. Thus creating a new type of armor, that will have some sturdier properties or something ... not sure what yet...

    Thanks in advance for any help provided

    Update:
    I found this post: https://forum.keenswh.com/threads/g...aterials-with-new-render-01-159-dx11.7389650/

    Is this still accurate to use cause it's from 2016 so a while back
     
    Last edited: Apr 28, 2020
  2. doncdxx

    doncdxx Apprentice Engineer

    Messages:
    438
    I use gimp for this purpose too. The catch is that Gimp only handles up to BC5 (the compression for the dds file), and you need to use BC7. What you need to do is use texconv.exe which I believe is in the Space Engineers install folder or in the mod SDK folder. I recommend writing a bat file for converting to BC5 and another for converting to BC7 so you can just drop image files you want to convert on the bat file instead of writing out the whole command each time. If you want to make custom icons, it's worth having one more bat file for them using -pmalpha command to prevent funky visual artifacts in your icons.

    If you want an example of everything you're trying to do, check out my mod that does roughly the same thing you're talking about.
    https://steamcommunity.com/sharedfiles/filedetails/?id=822604059

    When you want to look around inside a mod you've downloaded, you'll find it inside ...\Steam\steamapps\workshop\content\244850\
    244850 is the app ID for Space Engineers. The folders inside are named for the mod ID number which you can see in the URL, for example the mod I linked above is 822604059.
    I learned how to mod for by taking apart other people's mods to see how they work and I suggest you do the same.

    For your own mod or for experimenting with others mods, you want to put in [drive letter]:\Users\[user name]\AppData\Roaming\SpaceEngineers\Mods
    When choosing mods in game, you'll see mods there with a different icon in front of their name. That means it's local data and you can only use them in single player.
    When your mod works how you want, you just highlight your mod in the mod select screen and choose publish there.

    To place it in game manually, use the voxel hand in creative mode. To add it to asteroids, there's a SpawnsInAsteroids tag in your VoxelMaterials.sbc.
    To place your ore on planets is whole other thing. That will require either modding an existing world or making your own.

    That guide you listed seems to add a lot more steps than needed. If you make the bat files I suggest, you just drag and drop the files you want to downgrade for Gimp, edit the changed versions, then drag the changed versions onto a bat to upgrade them and dropped the final versions in the right place in your mod folder. I can tell you how to make them if you're not familiar with bat files.

    When you get to the cubeblocks.sbc to make your hull, I recommend ctrl H (replace all). In projects like this, ctrl H is your best friend. You can just copy all the hull data from the base game into a new file, then just ctrl H and replace "<SubtypeId>" with "<SubtypeId>[your ore name here]". Then something similar for display name and steel plates and you'll be done changing dozens of blocks in only few minutes instead of the hours it would take to do it manually.
     
    Last edited: Apr 28, 2020
  3. Celludriel

    Celludriel Trainee Engineer

    Messages:
    4
    Hey doncdxx,

    Thanks for the advice ! I appreciate the detail in which you explained the material. I'm in real life a Java developer , so some of it I already grasped but never the less I sincerely appreciate the detail of the explanation.

    Especially the information to deal with the textures and the location of the mod folders will help a lot already. I'll use your mod as a guide to get started and work my way up from there. I might need some more help on how to use texconv.exe but I'm sure there is a manual for that one as well.

    The idea is to let these special ores only spawn in space asteroids so I'm going to avoid the planet creation aspect. I'll have my hands full in just getting this done. I like to add more to the space game then just platinum and uranium there must be more to be found out there.

    I found the following example bat files that seems to be working

    Code:
    To Tiff format
    
    for %%i in (.\*.dds) do texconv -nologo -ft tiff %%i
    
    To DDS format
    
    for %%i in (.\*.tif) do texconv -f BC7_UNORM_SRGB -sepalpha %%i
    for %%i in (.\*.png) do texconv -f BC7_UNORM_SRGB -sepalpha %%i
    for %%i in (.\*.bmp) do texconv -f BC7_UNORM_SRGB -sepalpha %%i
    for %%i in (.\*.jpg) do texconv -f BC7_UNORM_SRGB -sepalpha %%i
    It works but I'm not sure if these parameters are indeed correct and I just found "one" use case for texture conversion and there are certain situations you actually need other parameters
     
    Last edited: Apr 29, 2020
  4. doncdxx

    doncdxx Apprentice Engineer

    Messages:
    438
    I use this to downgrade for editing

    for %%i in (%*) do ("C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineersModSDK\Tools\TexturePacking\Tools\texconv.exe" -f BC3_UNORM -y -o "C:\Texconv Output" %%i)

    this for upgrading for the game

    for %%i in (%*) do ("C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineersModSDK\Tools\TexturePacking\Tools\texconv.exe" -f BC7_UNORM -y -o "C:\Texconv Output" %%i)

    For icons upgrading it's basically the same but with -pmalpha added in.


    Maybe I should be using BC7_UNORM_SRGB & -srgbo, but it's worked fine with the above. I copied and modified a sample bat supplied by one of the SE devs back when the DX11 upgrade first happened and haven't done anything with it since. Actually, I don't really remember what most of the parts do, but it's not broke so I never messed with it.
     
  5. Celludriel

    Celludriel Trainee Engineer

    Messages:
    4
Thread Status:
This last post in this thread was made more than 31 days old.