Page 1 of 1

behavior of the -game2 switch

Posted: Tue Jan 19, 2021 1:50 pm
by Joel B
Hi, quick question (I hope). The readme says:

[+] -game2 – set additional game dir on top of game. Handy for modding.

...which seems to say that assets in the "game2" directory would override any same-named assets in the "game" directory.

However in COM_InitFilesystem it looks like the opposite is true. It does COM_AddGameDirectory for "game2" first (and "game3", "game4") then subsequently for "game", so "game" has the last word.

I did a quick test of this with a different custom conback.lmp in the "game" and "game2" directories, and indeed the one from the "game" dir was the one used.

It looks like COM_InitFilesystem prioritizes the dirs from lowest to highest as "game2", "game3", "game4", "game".

Is that correct or am I confused? If correct... is that the intended behavior?

Thanks!

Re: behavior of the -game2 switch

Posted: Sat Jan 23, 2021 2:30 pm
by Joel B
Also FWIW, if I specify both game and game2, then savegames go in the "game" folder (not game2), and likewise any config changes will be saved in the "game" folder.

This is what I would expect if "game" is supposed to be always be the highest priority folder for file reads/writes. (I haven't yet actually tested game3/game4 but I don't expect them to change that.) So the code functionality as it currently is seems fine(?) and if so then it could just be a documentation issue.

Re: behavior of the -game2 switch

Posted: Sun Jan 24, 2021 11:14 am
by func_qbism
Definitely a documentation error. I just now corrected this in the console commands post. The behavior of the switches makes sense from the standpoint that saved games and screenshots will always be in the -game directory.

Re: behavior of the -game2 switch

Posted: Sun Jan 24, 2021 9:58 pm
by Joel B
Sounds good!