Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Memory-Mapped Files (VFS) to Godot Editor as memory:// #10978

Open
CycloneRing opened this issue Oct 15, 2024 · 2 comments · May be fixed by godotengine/godot#98287
Open

Add Memory-Mapped Files (VFS) to Godot Editor as memory:// #10978

CycloneRing opened this issue Oct 15, 2024 · 2 comments · May be fixed by godotengine/godot#98287

Comments

@CycloneRing
Copy link

Describe the project you are working on

RTX for Godot Extension

Describe the problem or limitation you are having in your project

Godot Editor is required to load all files and resources from disk.

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

Since Godot already has a memory file access system and uses VFS (Virtual File System) on PCK and ZIP at build runtime, This feature should brought to Editor as well.

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

Instead of using "res:// we can use create memory files with path of "memory:// for example we create a and serialize a scene to `memory://scenes//my_scene.tscn" and retrive data as PackedByteArray, At another time we create virtual file again from data and use the ResourceLoader to load it. I am aware that some resources like images, videos and fonts are loadable from buffers but we need a global system for this.

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

It's not simple to implement but it's not hard as well, Since Godot already uses VFS for PCK at runtime and loads everything from archive to memory and resource loaders also read files to memory buffer and parse them.

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

Because it must be implemented in core.

@atirut-w
Copy link

So, a temporary file system? I think a tmp:// path would make more sense. Most OSes already provide space for temporary files AFAIK.

@CycloneRing
Copy link
Author

So, a temporary file system? I think a tmp:// path would make more sense. Most OSes already provide space for temporary files AFAIK.

The whole point of having VFS is to avoid temporary files :)
All operations will be redirected to a memory area instead of disk. It's faster and it's secure and has many features. Godot already has it just need some manipulation to make it enable in editor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants