IssueRaiser

Implement custom resource path support

### Describe the project you are working on Godot ### Describe the problem or limitation you are having in your project There are several cases where the resource file paths offered by Godot are not flexible enough, and community has complained about this. * A way to have editor-only assets (for global plugins). * A way to stream assets from the web or other locations. * A way to just create custom resource paths for users to interact with sandboxed game data. * A more flexible way to have moddable content without compromising the game filesystem. Godot currently hardcodes `res://` and `user://`, but users often require more flexibility here. ### Describe the feature / enhancement and how it helps to overcome the problem or limitation This feature would allow to add custom resource path providers to the filesystem. Users would need to pass a class and some configuration information. Probably an API like this: ```GDScript # Create the game:// path using an existing filesystem path FileAccess.add_resource_path("game://","/home/user/Documents/somepath") # Create the assets:// path using an URL FileAccess.add_resource_path_url("assets://","https://mygame.com/assets") # Create the database:// path using a custom class that inherits FileAccess and DirAccess. FileAccess.add_resource_path_class("database://","CustomFileAccessClass","CustomDirAccessClass",userdata) ``` This would allow, as an example, to have global editor plugins. As the editor could register an `editor://` p

Posted by reduz on Feb 17, 2023, 6:49 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.2,500 issues0 comments

support (Other)

Implement custom resource path support

reduzFeb 17, 2023, 6:49 PM

### Describe the project you are working on Godot ### Describe the problem or limitation you are having in your project There are several cases where the resource file paths offered by Godot are not flexible enough, and community has complained about this. * A way to have editor-only assets (for global plugins). * A way to stream assets from the web or other locations. * A way to just create custom resource paths for users to interact with sandboxed game data. * A more flexible way to have moddable content without compromising the game filesystem. Godot currently hardcodes `res://` and `user://`, but users often require more flexibility here. ### Describe the feature / enhancement and how it helps to overcome the problem or limitation This feature would allow to add custom resource path providers to the filesystem. Users would need to pass a class and some configuration information. Probably an API like this: ```GDScript # Create the game:// path using an existing filesystem path FileAccess.add_resource_path("game://","/home/user/Documents/somepath") # Create the assets:// path using an URL FileAccess.add_resource_path_url("assets://","https://mygame.com/assets") # Create the database:// path using a custom class that inherits FileAccess and DirAccess. FileAccess.add_resource_path_class("database://","CustomFileAccessClass","CustomDirAccessClass",userdata) ``` This would allow, as an example, to have global editor plugins. As the editor could register an `editor://` p

Comments (0)

No comments yet. Start the discussion.

Comment on this issue