DevSlog

Mod Support in SpaceSlog | Devlog #2

In this update video we focus on the importance of mod support in SpaceSlog plus various other ramblings.

Being the creator of a popular Game of Thrones mod i know creating mods can be time consuming and can be met with certain restrictions. Modding is fun, and for some the fun part can be overcoming such restrictions. For SpaceSlog we aim to remove as many of those restrictions as possible, allowing people to create the exact modification they wish.

My work within the modding scene over the last decade has also influenced the reasons why i want SpaceSlog to be as fully modifiable as possible. We go into these reasons a little bit in the video and show whats currently possibly. We also talk a little bit about what we expect for the future. Of course all of this comes down to the scope of the game and how long we can actually spend on development. Which also depends on how popular the game will be, or if at all.

DevSlog

Building, objects and materials

My main goal for any game mechanics associated with building and the building objects themselves should be flexibility, extensibility and ease of use. Not only for those that want to modify the files but also for the players playing the game.

In other words the menus should be intuitive and easy to read, whilst giving all the information required to quickly build any of the objects available. Anyone wanting to modify the files should be able to do so easily and with the least amount of friction possible.

I also wanted materials to change the appearance of the item whilst also changing its composition, from how it reacts in the world to how much health it has etc.

A lot of time was spent iterating upon the UI and adjusting the mechanics of the game associated with building and materials to fit the criteria set out above. Below you can see the menu I finally settled upon, though be aware that like most other things in this game, it is still a work in progress and could be subject to change.

Build Menu
Build Menu

You can see from the above image we have a primary material and a secondary material. Not every object will require two different material types to build and this can be modified in the JSON files if required. Below you can see this item requires 3 of either Titanium or Gold plus 2 Silicon. These materials can be further modified via another JSON file.

"material_types": {
        	"primary_mats": ["Titanium", "Gold"],
        	"primary_mats_amount": 3,
        	"secondary_mats": ["Silicon"],
        	"secondary_mats_amount": 2,
        },

Below you can see the effects of the different primary material types (Secondary material types will not change the colour of the objects). This is achieved by using a shader and a mask material which can be input into the JSON file.

The effect of different primary materials.

Adding new objects should be as easy as copying and pasting a similar object, changing parts of its data and pointing it to your texture file in your module folder.

As usual, if you have any questions then feel free to head on over to our forums where I will be happy to reply.

DevSlog

Modability

My background in gamedev comes from modding games, which i’ve been doing for the past decade. With over half a million unique downloads the most popular modification being A World of Ice and Fire for Mount and Blade Warband. I could only dream for SpaceSlog to reach a similar amount of popularity. I do of course realise there are many factors as to why the mod was and still is so popular. Having been set within the Game of Thrones world being one of them and being created for an already well established game another.

But i didn’t write this post to talk about mods in other games. I wrote this post to talk specifically about mod support in SpaceSlog.

JSON

I decided to use JSON to hold all external data which is then imported into internal data structures on initial game load. All of the games data is contained in a folder aptly named DATA and can be accessed and changed by anyone brave enough to do so. You can also copy any data here and paste it into your own MODULES folder. Once this mod has been ticked in the ingame mod menu, you will be prompted to restart the game where all these files will be added to that internal data structure we previously mentioned.

Below you can see the current ingame module menu. I still need to add a few things here – an image preview the modder can add plus the ability to adjust mod load order. This will allow the player to decide which mods should or can overwrite other mods if they contain objects with the same ID’s.

Modification select menu

I wont go into the specifics on how modding actually works in this post. That will be for another time but here is a quick example of an item in SpaceSlog and how it looks like in the JSON file. It’s also worth noting that everything here can still change dramatically, though i think i have the basic architecture down for this now.

    "CryoPod": {
        "object_class": "Furniture",
        "object_name": "Cryo Pod",
        "description": "Freezes creatures in time, allowing them to rest for as long as this item has power.",
        "movement_cost": 0,
        "deterioration_rate": 10,
        "flammability": 40,
        "market_value": 200,
        "comfort": 1,
        "material_types": {
        	"primary_mats": ["Titanium", "Gold"],
        	"primary_mats_amount": 3,
        	"secondary_mats": ["Silicon"],
        	"secondary_mats_amount": 2,
        },
        "engineering_skill_required": 3,
        "work_to_build": 1,
        "work_to_uninstall": 1,
        "rotatable": true,
        "draw_width": 1,
        "draw_height": 2,
        "width": 1,
        "height": 2,
        "health": {
            "max_health": 100,
        },
        "graphics": {
            "graphics_class": "GraphicsMultiple",
            "shader_type": "ColourMask",
            "textures": {
                "texture_path": "Textures/Entities/Building/Furniture/CryoPod",
            },
        },
        "component_nodes": {
        	"PowerReceiver": {
        		"power_required": 50,
        	},
        	"Light": {
            	        "light_map_path": null,
        	},
        },
    },

You can see above there are lots of options for the modder to change, including being able to add any pre-built components to any object in the game. I hope to eventually allow the possibility to create new components too. This could mean endless possibilities for mod creation.

Conclusion

Mod support is something i am very passionate about and i have spent a lot of extra time to ensure good mod compatibility for SpaceSlog. I cannot wait to get the game out there and see what weird and wonderful things people can come up with. I expect to see strange new worlds and unthinkable alien races among other things! If you want to discuss further or have ideas for mod support, then please either head on over to our Forums or join our Discord.