Skip to content

Mods are not being isolated into their own sandboxed assemblies #15

@valkyrienyanko

Description

@valkyrienyanko

Description

Mods with identical script names cause errors. This affects both C# and surprisingly GDScript mods too. This needs to be confirmed that this is happening on GDScript mods again.

Steps to Reproduce

  1. Duplicate the res://Mods/Example Mod directory to res://Mods/Example Mod 2.
  2. Modify the id in the mod.json of the new mod from example_mod to example_mod_2.
  3. Run the game.

Expected Behavior

Both mods should load and execute without errors, printing unique messages.

Actual Behavior

C# Mods

  • First Kind of Error:

    An item with the same key has already been added. Key: res://valkyrienyanko/example_mod/Mod.cs
    
  • Second Kind of Error:

    Assembly with same name is already loaded
    

GDScript Mods

  • Console Output:
    Loading C:/Users/VALK-DESKTOP/Documents/_Godot Projects/Template/GodotProject/Mods/Example Mod/mod.pck for example_mod
    Loading C:/Users/VALK-DESKTOP/Documents/_Godot Projects/Template/GodotProject/Mods/example_mod_2/mod.pck for example_mod_2
    Hello from Mod 1
    Hello from Mod 1
    
    • Expected: Hello from Mod 1 and Hello from Mod 2
    • Actual: Hello from Mod 1 printed twice

Observations

  • C# scripts with the same name in different mods cause errors.
  • GDScript mods with the same script names also have unexpected behavior. (needs to be looked into again)

Additional Notes

Relevant Issues

Conclusion

  • C# modding inside the Godot engine looks like a dead end.
  • C# modding how rimworld did it might be an option. (There's https://github.com/Carnagion/Modot but as of writing this it's still on Godot 3.x)
  • GDScript modding in the Godot engine might be an option. (The issue described above needs to be confirmed again)
  • Lua modding might be an option.
  • C++ modding?

What about security concerns? How can we limit modders to only modding the game and not my System32.dll?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions