Forbid mods from overwriting certain resources

Godot Version

4.4.1

Question

I’m currently working on a modding support for a game, but a question arose. I want to protect certain files from being modified by mods, but the system I’m using for the mods, Godot’s .pck files, don’t seem to have an option to do that. Maybe there is a way maybe to “vaildate” a .pck before loading it, or some other similar system that allows to make modding simple and enables finer control over what can and can not be overwritten by a mod?

If you create a UI for the player, you will be able to fine-grained control what they can do or cannot do.

However, files are still files on any system. Any file that could be viewed could be modified if given the right condition and skills.

There are a few basic ways I could think of, such as:

  • encrypting the file (and have your game decrypt it before accessing it)
  • check the checksum of the file to see if it changed. If it did indeed get modified, the checksum will change.

To some people who do not understand the in and out, the above could be a huge wall, but to a skilled technical guru, the above will be just a road bumper that could only delay the inevitable…

I don’t think that’s possible. As far as I can tell, your only option is setting the parameter replace_files to false when loading the pck with ProjectSettings.load_resource_pack()