FlyDangerous
FlyDangerous copied to clipboard
A folder for custom races
I mean a folder in which custom maps can be stored, so they can show up in map selection, under a new custom tag or something.
This is something I have wanted to tackle for a while, and I think it is something that the game could use, but there are a couple of implementation questions that have kept me from starting on it
-
Firstly where should the folder be located?, under /documents/mygames/flydangerous or something?, or should it be in the game folder where the rest of the game data is stored. (No opinion, first is better for a by hand approach of file-sharing, second is better for a integrated approach, I assume)
-
Should a active index be stored in a file somewhere, or should the index of custom races be built from scanning the folder, each time the index is first called. (I lean towards the second approach)
-
Should the game expect a folder structure similar to how races are saved in the code-base (thumbnail's and stuff), or should it be a folder in which the json files are dumped. (I think the first approach is better here)
I don't think a GUI/server implementation for downloading/saving custom level needs to be solved/considered for this issue yet, since it should not be difficult to integrate that solution in with the folder.
Folders
We can likely support multiple folders if we want, and just concat them all together on load - likely this will need to happen to support the Steam Workshop if we go down that route (would be nice!). Either way if I had to choose one, it would probably be the data folder where everything currently lives just to keep things simple.
Index
I'd just do this on load, yeah - anything else requires cache invalidation and that's pain all the way down.
Folder structure
This is something I've wrestled with too, and I'm not really sure. I think the ideal probably needs to be a .zip file containing the thumbnail and the json. Thinking here is sharing a single file is much easier, and provides us room to expand with other custom file types in the future if needed (e.g. custom banner art, textures, whatever)
Agreed on GUI, a simple loader would be a step in the right direction.
Any reason not to use tar instead of zip?, that should provide a more snappy experience when constructing the index, and the the thumbnails should already be compressed using jpeg
Eh, it already uses zip compression for replay files and it's plenty fast. If you're worried about initial load time with potentially thousands of maps, just ensure when we create them (in the magical future time from a level editor) that we do so with CompressionLevel.Fastest
I have a working demo for a custom levels tab, when I figure out the best way to make it a PR I'll submit one