-
-
Notifications
You must be signed in to change notification settings - Fork 197
Description
Hey, I'm looking to dig around and hope to play with a from-scratch 3D project using mach-core so that I can learn the codebase and hopefully contribute. Are there any plans to include a gamedev-oriented file system e.g. wrapper for PhysFS in mach-core or as a related module?
I'd like to have something like this - yes. No immediate plans to work on this (since we have higher priority things before then), but it would be written in Zig when we do (rather than say bindings to PhysFS) and the design may be a bit different.
it wouldn't go in mach-core, since mach-core aims to be very minimal. Just window+input+GPU. Rather it'd go in a separate package/module somewhere else.
Cool. I imagine it's not something you've thought about a whole lot yet, but what sorts of design considerations/changes would you consider important? I need something of the sort and I'd love for at least a little of the work involved to be cannibalizable for mach when the time comes.
Good question; I definitely haven't thought about it super in-depth, but could start doing so if you're eager to work on something like this in the mach codebase (which I'd be happy to have).
on the surface, I see a few things here
- is the overlap (and consistent experience) we would want to provide here between desktop/mobile/web. Obviously we wouldn't need to support all 3 of those targets initially, but whatever API we come up with would need to support those reasonably eventually
- for desktop, the primary concern would be performance
- for mobile, the primary concern would be 'after installation' downloads/patching
- for web, the primary concern would be compatibility with HTTP (byte range requests are possible, so the format needs to be compatible with those in some form maybe)
(2) There is increasing support from graphics hardware manufacturers to enable GPUs to directly consume data from disk. For example DirectStorage with d3d, and there's a similar extension for Vulkan which AMD released recently. - The advice/approach with that is: store your files in GDeflate (similar to deflate compression) format, and then you can yeet the data over to the GPU and it can handle decoding the file. But it requires your data be available in some format that you can yeet it to the GPU like that. I think a pack file which looks like:
- metadata (describes what's inside)
- a bunch of independent regions (file bytes) which are compressed with GDeflate or zstd depending on what's inside
- the third concern is making it nice to develop/work with, either by using the native filesystem when developing (instead of a pack file/archive) - or by having nice tooling to interact with it somehow
so, stepping back from those high-level thoughts, I think the first implementation of this could be something like: a library which implements an archive file format which has metadata first, and zstd compressed file regions afterwards + some tooling to create it and develop/work with it nicely.
once such a thing exists, an 'overlay' concept / PATH analog ('you load one or more archives into a sort of PATH analog, which makes modding and patching completely transparent.') would be very nice to have, I would also very much like that as a way to support modding nicely