-
Notifications
You must be signed in to change notification settings - Fork 126
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
Big rpak loading refactor #766
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new method of loading/unloading rpaks seems to have been working fine in the ctf playtest we did. Didn't run any mods that load the old method though.
edit: turns out I was also running a mod that used Aliases
so that is also confirmed to be working.
second edit: just tested with a mod that used Preload
and that also works fine
epic third edit: went ahead and tested Postload
mods as well, also seem to work fine. Notably they got unloaded when disabling the mod but didn't appear to get loaded again afterwards when re-enabling the mod.
Ok this commit should make Postload and Preload rpaks get reloaded nicely when doing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From quick testing:
- troll face did not appear with
main
build; - with PR, troll face did appear on angel city;
- with PR, updating
rpak.json
file (to"trol.rpak": "mp_drydock"
) and then runningreload_mods
, thenmap mp_angel_city
made the troll face disappear, as expected.
Could you also provide more detailed instructions regarding Preload, Postload and Aliases testing? Maybe by updating the test mod?
(I still have to take a look at the code.)
That stuff is just maintaining old behaviour. Best way to test would be to grab some mods and give them a go, make sure they act like normal. Any mod made with advocate should be using Preload. Most model mods (that arent using advocate) will probably be using Postload, and camo mods tend to use Aliases. All of these should work as usual, with Preload and Postload also supporting hot reloading now (though no model reloading so model textures will be reloadrd but not the models themselves) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good to me afaik.
I tested the PR with these 3 mods:
- XenonSet2 uses
Preload
for a Devotion skin; - SpecterMDL uses
Postload
for specter models; - Sweater_Camo uses
Aliases
for a pilot skin.
All 3 mods behave the same on this PR than on main
, and I confirm Preload
and Postload
support hot reloading (with reload_mods
+ reload
commands ran successively).
The fact that this is even fully backwards compatible with current |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotta say this is very much northstar code. I'd say any improvements should just be separate PRs or this gets stuck we know where :)
This reworks how rpaks are loaded, unloaded and tracked. It allows for rpak reloading between map loads, meaning that skins and map overhauls could be enabled and disabled on the fly. Previous methods of loading rpaks still work.
Related docs PR: R2Northstar/ModdingDocs#251
Well this branch got out of hand.
Anyway, this PR reworks how rpaks are loaded, unloaded and tracked.
It allows for rpak reloading between map loads, meaning that skins and map overhauls could be enabled and disabled on the fly.
Previous methods of loading rpaks still work, but the new cool way is to format the
rpak.json
file like this:An rpak will be loaded if the map that is being loaded matches the regex given in the json.
How to test:
Ensuring old behaviour
Testing new behaviour
reload_mods
Update for testing new behaviour:
Here is an example mod that uses the new rpak loading system. It's a skin for the satchel and with the
rpak.json
setup it will only load onmp_angel_city
To further test this example mod, change the
mp_angel_city
to some regex that will match some maps, all maps, or whatever and test it. You shouldn't need to restart the game entirely for these changes to be respected, simplyreload_mods
and then load a level. For examplemp_
should match any multiplayer map and.
should match every map.