Open Calinou opened 3 years ago
To make it easier for stuff to be saved in the same folder as the game, something like game://
being added would help, instead of having that very long line used often.. Might even be worth it stand alone to add that regardless of self contained mode.
Note: res://
might be what I suggested, however I'm not sure how that works on an exported project, as in idk if saving to res would try to save to the .pck and not a folder outside..
res://
works as that behemoth of a line, so it's really all about using res://
over user://
res://
works as that behemoth of a line, so it's really all about usingres://
overuser://
res://
isn't guaranteed to be writable to in an exported project (even more so on mobile/web platforms). Also, when using res://
to save user data, there's no guarantee that you won't accidentally overwrite game files :wink:
Describe the project you are working on
The Godot editor :slightly_smiling_face:
Describe the problem or limitation you are having in your project
The Godot editor has a self-contained mode. It works well for the editor's purposes, but it has several limitations:
editor_data/
folder. Therefore, the implementation isn't fully self-contained. The Godot editor will still write files located outside its installation folder (and the project folder, of course).._sc_
, which looks cryptic from an outsider perspective. This also needs to be solved if we want to make it usable in exported projects. After all, project developers wouldn't want their users to remove that file without even knowing what it does :slightly_smiling_face:Describe the feature / enhancement and how it helps to overcome the problem or limitation
Note: The
._sc_
approach may be supplemented by command line arguments or environment variables, but it won't be removed as this is the only approach that carries across different PCs. For instance, if you copy a Godot project on an USB stick, the._sc_
file can be copied along it. This isn't the case for command line arguments or environment variables, unless you create OS-specific launcher scripts.Relevant discussion on the Godot Contributors Chat
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
is_self_contained()
method to the Engine singleton. On platforms that don't support self-contained mode, this method should always returnfalse
.._sc_
file to._selfcontained_
(and the Windows-friendly_sc_
to_selfcontained_
).._selfcontained_
next to its executable. This allows greater control by the user. If a project developer wishes to disallow this, they can uncheck a newapplication/config/allow_self_contained_mode
project setting that allows using self-contained mode (it will be enabled by default).If this enhancement will not be used often, can it be worked around with a few lines of script?
For the editor, no. For exported projects, yes, but it needs to be done consciously by the project developer every time they're writing a file somewhere. This implies never relying on
user://
and usingOS.get_executable_path().get_base_dir().path_join("project_data")
instead.Is there a reason why this should be core and not an add-on in the asset library?
See above.
Keywords for easier searching: selfcontained