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

How Modding Works (pseudo-officially)

Discussion in 'Modding' started by Andereg, Jun 21, 2014.

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

    Andereg Trainee Engineer

    Messages:
    98
    The Purpose

    The official modding page is currently a bit light on content. :D I am hoping this thread will help folks create and maintain their mods in a pseudo-official manner so that we, as a community, can move away from hacking up the install directory.

    Please take time to review the existing Q&A, especially the Outstanding Questions section. If at any point you notice incorrect information, please speak up in the thread or PM me.


    Q&A - What We Know

    Q: Where should mods go?
    A: Individual single-player mods should currently be put into their own folder under %appdata%/SpaceEngineers/Mods/. While the official modding page states that they should go in the subfolder {Your Steam ID}, this does not currently seem to work. Multiplayer mods should go in %appdata%/SpaceEngineersDedicated/Mods/.

    Q: You said "mods". I can have more than one mod?
    A: Multiple mod folders are supported. That much is covered in the official modding page. However, managing multiple mods is tricky and depends very much on how those mods are structured.

    Q: How should a custom mod folder be structured?
    A: We are still trying to figure that out. For now it appears that the simplest answer is..
    Each custom mod folder should be considered to be its own copy of the "Contents" folder within the install directory for the game. In order to add or replace content you should include the folder structure (but not all of the files) to whatever file(s) you are replacing. So if for example you mod replaces the RespawnShip.sbc, your version of this file should be in a Prefabs folder within a Data folder within your mod folder. (e.g. /Data/Prefabs/RespawnShip.sbc).

    Q: How do mod files add to or replace content in the game?
    A: For almost all files, the mod file completely replaces the existing content. A few of the XML files seem to extend the existing file. The following files seem to extend the existing file:
    • /Data/Scenarios.sbc - Adds all Definitions/Scenarios/ScenarioDefinition nodes it finds within the mod file.
    • /Data/Cubeblocks.sbc - Adds all Definitions/CubeBlocks/Definition nodes it finds within the mod file. NOTE: While CubeBlocks gets extended, BlockPositions gets overwritten. (weird).
    • ??
    Note: XML files that extend the existing content should not contain the original content. Those that replace should include whatever original content you wish to preserve.

    Note To Keen: We would like to see, within the .sbc files that extend the existing data, the ability to replace existing XML nodes by including new versions of those nodes, matched on the contents of the <Id> tag.


    Q: Is it possible to delete content through a mod?
    A: Not at this time. You might be able to change the content though so it is irrelevant or marginalized.

    Q: What does Space Engineers do when two mods conflict?
    A: It appears that SE loads mods in reverse alphabetical (9-0Z-A) order and applies all of the changes within a mod before moving on to the next. So if "ModA" loads a texture change and "ModZ" changes the same texture but also changes another texture, then the unique texture in ModZ is sure to load and ModA's version of the texture will be applied as it will be applied last. More testing should be done to confirm this. Feel free to jump in and post your findings.

    Q: What do the "<!--" tags do?
    A: These are XML comments. They are most likely ignored in all cases.

    Q: Is it possible to take every one of the mods I've downloaded and cram them all in one folder with only one cubeblocks file and put them in the appdata mods folder? Well, as long as they have the correct subfolders and such?
    A: Yes. It would be nice if someone made a tool to help you do that. (Looking at you SEModBox)

    Q: That sounds like a nightmare to manage. Is there an official community recommendation on how to deal with this?
    A: It can be challenging to manage your mods, yes. For now, you just have to be very intentional about how you name your mod folders.

    Q: Does Space Engineers support compressed Mod folders?
    A: No. It does not seem so.

    Q: In my .sbc file, does my <Id> tag need to be unique?
    A: No and yes. The TypeId needs to match the MyObjectBuilderTypeEnum. The SubtypeId can be anything, but should be unique if present.


    Outstanding Questions

    Q: Do mods added to %appdata%/SpaceEngineersDedicated/Mods/ folder get pushed to the clients that connect to that server? If they do, are files created in the same location on the client?
    A: ??

    Q: Is the sorting applied to mod folders culturally or case sensative?
    A: ??

    Q: Will mods be shared as Steam Workshop content?
    Note to Keen: Compressed files with mods should get supported, as there is inbuilt support already with current downloaded Steam workshop content, in the "C:\Users\%USERNAME%\AppData\Roaming\SpaceEngineers\WorkshopWorlds" folder, with the ".sbw" file extension, which is just a .zip file.
    A: ??

    Q: How will mods be shared through Steam Workshop content? (e.g. a game world containing ships that have modded cubes).
    A: ??

    Q: How does SE plan to support runtime content, e.g. custom game logic in a .dll?
    A:
     
  2. Shaostoul

    Shaostoul Senior Engineer

    Messages:
    2,609
    From what I read, after just waking up. Putting mods in %appdata%/SpaceEngineers/Mods/ and it actually doing anything, has just been added. There's this video explaining that: https://www.youtube.com/watch?v=Zg56JiG8p0o

    So, we've had to butcher things, until now.
     
  3. Andereg

    Andereg Trainee Engineer

    Messages:
    98
    Oh heck yeah. I've had to hack up mine too. Now that we no longer have to, lets collect info on how modding now is supported by the game. :thumb:
     
  4. Shaostoul

    Shaostoul Senior Engineer

    Messages:
    2,609
    I'm trying to figure it out currently. I'm organizing things currently.

    *edit*

    Figured part of it out, ran into a snag with the mwm's.

    *edit*

    I can get it to work if you put a cubeblocks.sbc in the appdata area, but I can't currently get it to work if you put the mwm's and all that in there.

    *edit*

    nearly working, just need to rebuild the MWM's

    *edit*

    So I just renamed all of the texture paths... Just said it replaced 491 texture paths... I wonder how long this rebuild is going to take...

    *edit*

    Only 30 seconds. Not too bad. Replacing MWM's in folder now.
     
  5. Andon

    Andon Senior Engineer

    Messages:
    1,305
    I'm going to delve into how Spawngroups functions. I HOPE it's a complete replace, but even if it's not, this is a sIGNIFICANT step up from the wondrous hackjobs we've had to do before.

    Also, there's a /mods folder for Dedicated Servers as well. If the server has mods (Such as modified cubeblocks.sbc files), does the client download them, or is it only for server-side things?
     
  6. Shaostoul

    Shaostoul Senior Engineer

    Messages:
    2,609
    Alright, I got everything working:

    [​IMG]

    Also, the file structure I use inside of the mods folder in the appdata Space Engineers is as follows.

    ShaoCorp
    ---Data
    ------CubeBlocks.sbc (it has none of the vanilla blocks in it. It's just my blocks)
    ---Models
    ------Large
    ---------MWM's
    ------Small
    ---------MWM's
    ---Textures
    ------Icons
    ---------DDS's
    ------Models
    ---------DDS's

    Hope that is fairly clear.

    *edit*

    Got a new version of my mod setup for download that uses this new method. It's a whole 2 steps and you're done... *cries* it's beautiful.
     
  7. PeterHammerman

    PeterHammerman Junior Engineer

    Messages:
    652
    Superb, my also are now reorganized and working :)
     
  8. Andon

    Andon Senior Engineer

    Messages:
    1,305
    Preliminary testing indicates SpawnGroups.sbc loads groups in addition to the default ones.
     
  9. Shaostoul

    Shaostoul Senior Engineer

    Messages:
    2,609
    @Peter, did you get the mass PM I sent to like 6 modders? I'm not sure if I messed that up or not.

    @Andon, so you just add onto the spawngroups already present? That's actually pretty cool.
     
  10. Andon

    Andon Senior Engineer

    Messages:
    1,305
    Yep, seems like it. It is pretty cool, unless you want to completely replace them. But then you can make the default spawn groups so infrequent as to be negligible
     
  11. PeterHammerman

    PeterHammerman Junior Engineer

    Messages:
    652
    Yep, just now ;P
     
  12. Shaostoul

    Shaostoul Senior Engineer

    Messages:
    2,609
    This is definitely a step in the right direction for modders! I think this may also make the ultimate pack mod menu reorganize easier! It seems like it goes in reverse alphabetical order. So Z is first and A is last, but those modpack guys will have to mess with it. Probably have AAA at the beginning of their mod.
     
  13. PeterHammerman

    PeterHammerman Junior Engineer

    Messages:
    652
    Now everything should be clean and tidy :) It seems that in roaming files have higher priority so files like cubeblocks.sbc are overwriting in memory. Next step would be adding only fragment of code with definitions of new blocks so it can be merged in memory with original cubeblock. That would allow to load multiple mods
     
  14. Andon

    Andon Senior Engineer

    Messages:
    1,305
    How does it count numbers? Are they loaded before or after letters, and are they in proper or reverse order?
     
  15. Shaostoul

    Shaostoul Senior Engineer

    Messages:
    2,609
    @Andon, not sure, it'd need testing.
    @Peter, is it not loading multiple mods? It should be.
     
  16. Kienata

    Kienata Staff

    Messages:
    135
    What is the impact of modifications to server side assets.

    Prior to this new method a hack job could, for instance, create custom taxis, or, change out all cargo ships with new ones on new timers etc.

    Is it A) safe to assume these things function similarly and B) is there any unexplored functionality (like a server imposed skybox etc).




    I will continue to work with members of Horizon Worlds to make determinations. I am VERY interested in any new discoveries or tests anyone runs as far as reproducible behavior.





    E
     
  17. Andereg

    Andereg Trainee Engineer

    Messages:
    98
    Updated OP with new answers.
     
  18. darth_biomech

    darth_biomech Senior Engineer

    Messages:
    1,550
    I feel like it is my birthday! Converted all my mods, and they all work!
    [​IMG]
     
  19. Embershard

    Embershard Senior Engineer

    Messages:
    1,686
    Is it possible to take every one of the mods I've downloaded and cram them all in one folder with only one cubeblocks file and put them in the appdata mods folder?

    Well, as long as they have the correct subfolders and such?
     
  20. Andereg

    Andereg Trainee Engineer

    Messages:
    98
    Yes.
     
  21. Embershard

    Embershard Senior Engineer

    Messages:
    1,686
    Awesome, thanks Andereg.
     
  22. Andereg

    Andereg Trainee Engineer

    Messages:
    98
    Thank Keen. I just typed 4 character :D
     
  23. Xocliw

    Xocliw Public Relations Staff

    Messages:
    2,615
    Well... this is a great step in the right direction :D. Hurray for KSH!
     
  24. darth_biomech

    darth_biomech Senior Engineer

    Messages:
    1,550
    Oh yeah. And I already can see the next logical step: Steam Workshop compatibility. Or auto-downloading of mods in a netplay.
     
  25. Xocliw

    Xocliw Public Relations Staff

    Messages:
    2,615
    This will be awesome indeed. It will definitely get more people using mods and having more modded servers :).
     
  26. Embershard

    Embershard Senior Engineer

    Messages:
    1,686
    Because my G-Menu Expansion mod should be unique in it's changes, meaning no other modders files should be changing the same file , does it matter what I name the folder? I know load order is prioritized with the letter Z being last to load. I also know that most modders now are including this in their packs, as the block position coordinates correspond to the increased grid numbers, so it likely doesn't matter if a modders folder prioritizes over this. However, if someone were to download a mod without this packaged in, would it matter where it is in the load order?
     
  27. voicesdark

    voicesdark Senior Engineer

    Messages:
    2,208
    Thanks guys for the how to on getting the mods converted over.
     
  28. DofD

    DofD Apprentice Engineer

    Messages:
    106
    So if i understood that correctly if i want to make a own order for obejcts i just create a mod folder with a cubeblocks.sbc in it, do all the positoning in it and thats all?!

    Cheers
     
  29. Embershard

    Embershard Senior Engineer

    Messages:
    1,686
    Yeah, that's pretty much it. Keep in mind, that if you plan on putting mods in that haven't been reconfigured to this format, in the appdata/mods folder, you'll need to include the subfolders like for instance, Sages workdesk. The model is in Models/Custom by default. You can create a Sage folder and within, create a subfolder for models, and then within that, a subfolder for custom, then place his workdesk inside that one. The cubeblocks file you create only requires the definitions for the blocks, and block positions.
     
  30. voicesdark

    voicesdark Senior Engineer

    Messages:
    2,208
    I'm sure I'm not the first one to do it, but since I haven't seen anyone else mention it, cracked the method for loading legacy mods through the new mod system so we won't loose mods if they aren't updated.
     
Thread Status:
This last post in this thread was made more than 31 days old.