godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.17k stars 98 forks source link

Modding support - option to just copy resource folders and files (don't put them into PCK, ZIP or EXE) #10379

Open PavelCibulka opened 3 months ago

PavelCibulka commented 3 months ago

Describe the project you are working on

Strategy game with heavy emphasis on modding and user's created content. I would like modder to have access to many parts of the game - including GUI.

Describe the problem or limitation you are having in your project

PCK files - this feature is just obstacle.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Allow option to just copy resource folders and files without putting them into PCK, ZIP or EXE.

Please look at games with really big modding communities. For example in strategy games it would be Paradox games. You can just open game file with text editor. There is almost every player a modder in Paradox games (In the sense of him changing some game file).

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

If this enhancement will not be used often, can it be worked around with a few lines of script?

It can be almost done with: export -> Options -> Embede PCK export -> Resources -> Filters or Exclude Files set to * (this will throw error right now - "Must select at least one file to export.") manualy copping resources to game folder modders have to ZIP mod files in single zip file

Is there a reason why this should be core and not an add-on in the asset library?

This is change of core feature, not new one.

KoBeWi commented 3 months ago

Well this is already possible, but not directly. Export a ZIP, then unzip it in a folder and you have a working game with exposed files. Just run the exe in that folder.

Note that edited and exported game files are different. Exported project only uses the imported versions of files, so if you leave image and audio files exposed, they won't even be used and can't be modified. Unless you load the manually with Image/AudioStream methods.

Calinou commented 3 months ago

In general, good modding APIs should encourage adding files on top of what's already existing, not replacing existing files in the project. This prevents players from bricking their installation and having to redownload the game from scratch.

This can be done by loading additional PCK/ZIP files with ProjectSettings.load_resource_pack(), or just by using runtime file loading and saving.

  • There are no pros in having files in PCK (or in EXE or ZIP) in my project.

A packed format allows the game to load faster (and also be transferred faster on disk, as a sequential file write is much faster than writing a lot of small files).