Jump to content

[41.61] [Single/Multiplayer] Mod with incomplete item breaks the game


co-

Recommended Posts

So, this one is a bit tough to explain, please bear with me.

 

I discovered this issue (painfully) while I was working on one of my mods. I wanted to add a new item, so I simply created the file media/scripts/items.txt in my mod folder and added the following content:

module Base
{
    item GrassCuttings
    {
        DisplayCategory = Material,
        Weight = 0.1,
        Type = Normal,
        DisplayName = Grass Cuttings,
        Icon = GrassCuttings,
        WorldStaticModel = GrassCuttings,
    }
}

At that point, I had not created the Icon and the WorldStaticModel yet.

In the meantime, I discovered my mod name was invalid  in mod.info, due to a mistake in my previous release.

So I switched to fixing that issue first, because it seemed important enough (the mod was still working, but it was hard to find in mod list due to the invalid name).

I updated my mod.info, published a new release to Steam workshop, and went back to working on my new item.

 

That's where the pain started...

 

Unfortunately I wasn't careful enough and my new release included the new items.txt file mentioned before. In the next few hours, I received a multitude of messages on my workshop page about my mod being responsible for breaking saved games, for both single and multiplayer.

In particular, my subscribers where complaining about the following issues:

- The mod triggers errors when starting a new game

- The mod breaks vanilla items (objects disappearing, not available, or not working when interacted with)

- The mod breaks vanilla recipes (not possible to use some recipes)

- The mod breaks ripping cloth (trigger a red square error when right-clicking any cloth item that prevents users from interacting with cloth)

 

So of course at first I was a bit skeptical because I couldn't imagine how my mod could be responsible for all these problems, especially since it doesn't do anything related to items or recipes or ripping cloth. But then I couldn't deny the facts when I discovered in horror it was all true after I tried it myself. When I realized the issue was related to this new items.txt file, I simply deleted it from my repository and published a new release, fixing the problem for my subscribers.

 

I can't deny I have my fair share of responsibility for this whole issue. I'm aware I've been sloppy and that I really f*cked up at multiple stages. But I also strongly believe a game (or any software in general) shouldn't fail in such dramatic ways for a simple mistake like the one I made, which is to unwillingly ship a mod with an incomplete item. The consequences are way too heavy to wear on my single shoulders alone. The game engine should have failsafes to prevent this kind of issues and just ignore the bogus items when it can't find the corresponding Icon or WorldStaticModel (and of course show an error message in console.txt for easier troubleshooting). Anything that comes from a mod should be checked before use and ignored in case it's not valid, with a proper message sent to console.txt

 

I've included the following files:

- broken-items.txt (errors about broken items)

- broken-recipes.txt (errors about broken recipes)

- errors-on-start-new-game.txt (errors on starting a new game)

- error-when-right-clicking-a-cloth-item.txt (error on right-clicking a cloth item)

 

Please don't let sloppy modders like me break your beautiful game! Implement more failsafes to prevent this kind of issues in the future!

 

I'm available if you need more info, or anything really. Just reach out to me on your discord.

broken-items.txt broken-recipes.txt errors-on-start-new-game.txt error-when-right-clicking-a-cloth-item.txt

Edited by co-
Link to comment
Share on other sites

  • co- changed the title to [41.61] [Single/Multiplayer] Mod with incomplete item breaks the game

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...