-
Notifications
You must be signed in to change notification settings - Fork 182
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
New mod type: asset pack (.assetpack) #3129
Conversation
Great.
One thing I have in mind is version. What if I someday decide to make a newer version of e.g. SR_Terrain asset pack? E.g. fixing some texures or adding some more. Also I understand that this other resource group is just name, but game will look into it just like for other resources, right? So terrain etc will search it too in case some assets are for it? BTW. we need to name resources inside also uniquely right? E.g. grass2.png, palm.png etc are already in paged.zip, so for SR assets I need to rename such cases to something not present in RoR already. |
Assetpacks are referenced exclusively by filename of the .assetpack, same as all other mods in the game. For a different version or any customized edition, just use new filename. Anything more would be excess complexity. My goal is to use explicit RGs everywhere but former OGRE versions defaulted to searching everything and former RoR Devs didn't care. IIRC paged is hardcoded to use the default RG. Yes, resources must be named to avoid clashes with any prepacked media. |
Allright. So e.g. I'll have a SR_objects_v1 pack and in future will do a SR_objects_v2 and users will just get that instead and disable the v1. Sounds fair. |
A new file type "*.assetpack" was added to modcache with all the usual treatment: - the file is recorded to the cache file (/cache/cache.json), - it's searchable and selectable via UI (`LT_AssetPack`) - can have a thumbnail (filename format '{}-mini.*'' where {} is the assetpack file name without extension) - The file itself can be empty, recognized entries are `assetpack_name` (display name), `assetpack_description` (for display in selector UI) and `assetpack_author` (same syntax as in rig-def (aka .truck) file). Assetpacks are referenced by the file name (standard approach) and can be used for both terrains and actors: - Terrains: in .terrn2 file, add section `[AssetPacks]` followed by list of filenames (with extension, each on separate line) ending with `=` token, same as in `[Objects/Scripts]` sections - this is a quirk of the game. - Actors: in the .truck file, use section `assetpacks` followed by list of filenames (with extension, each on separate line) Note that, unlike any other mod, assetpacks aren't loaded to their own resource group but rather to the resoruce group of the mod which requested them. Therefore try to name all resources in an unique way to avoid clashes.
56ccf16
to
38ead30
Compare
@cryham Have you tested it yet? You can download the github-actions devbuild below. |
Not yet, I'll test later today. |
Allright this works well. |
So how small should I make these? I think with smaller I'd have more work but maybe less download for users. BTW can I call all SR tracks with prefix: ^Grc2-Coast or +Grc2-Coast or so in RoR? It's easier since they're on top of list. Also how will this work for users? E.g. someone gets from repo in game a track Grc2-Coast, then will RoR auto download all needed packs for it if not present? |
That sounds perfectly fine. I don't know the assets so I'll leave it to you to partition them so that it makes sense - I skimmed through the online map viewer at stuntrally website and I see you've got maps categorized by theme with prefixes. We have nothing like that as every map was individual. But I like it, go ahead. @CuriousMike56 Any opinions on this? |
Tested demo files, works fine. No issues with the file format 👍
Best solution IMO would be to add a "required files/dependencies" prompt when downloading from the in-game repo. Not sure how this would work on the website side. |
As a matter of fact, the Tuning branch #3096 internally modified modcache and enabled background updates. It was needed to save tuneups which must be modcache entries and must be created during simulation. This means:
I just realized a similar mechanism would be useful to recommend downloading mods which are preloaded in terrain (for example locos and railcars in TrainValley). No special syntax is needed actually, modcache can pick it up directly from the .tobj files and just prompt and then search. |
Quick 2hr draft -
BUILDS, NOT TESTED.Tested, added example mods.A new file type "*.assetpack" was added to modcache with all the usual treatment:
LT_AssetPack
)assetpack_name
(display name),assetpack_description
(for display in selector UI) andassetpack_author
(same syntax as in .truck file).Assetpacks are referenced by the file name (standard approach) and can be used for both terrains and actors:
[AssetPacks]
followed by list of filenames (with extension, each on separate line) ending with=
token, same as in[Objects/Scripts]
sections - this is a quirk of the game.assetpacks
followed by list of filenames (with extension, each on separate line)Note that, unlike any other mod, assetpacks aren't loaded to their own resource group but rather to the resoruce group of the mod which requested them. Therefore try to name all resources in an unique way to avoid clashes.
Test mods - a wacky mini terrain I created for future tests, and one mesh (with multiple .ODEFs) I extracted from it: