shinyquagsire23 / OpenJKDF2

A cross-platform reimplementation of JKDF2 in C
Other
501 stars 41 forks source link

[MotS] OpenJKDF2 injecting different jkgfxmod textures based on filenames rather than hash #233

Open Vortikai opened 1 year ago

Vortikai commented 1 year ago

When investigating #230 using JKGFXMod without OpenMOTS, we discovered that for whatever reason OpenMOTS loads a different texture for the elevator call panel button. When mat files are present in the materials folder under \\jkgm\materials, such as jknup--which contains neural upscale textures from the base JKDF2 game that MOTS uses--and motsnup--upscaled textures unique only to MOTS, the texture 00t_4.mat is loaded from the original JK game upscaled texture pack ( \\jkgm\materials\jknup) instead of 00t_4.mat from MotS ( \\jkgm\materials\motsnup).

openmotssecurirtycamerapanel1 OpenMOTS loads this texture, non-default/vanilla, when jknup is present

openmotssecurirtycamerapanel2 Default MOTS/jkgfxmod disabled in OpenMOTS, vanilla, also when jknup is not present

This affects other levels as well, such as the control panels for security camera stations on level 3 - Asteroid Core

openmotssecurirtycamerapanel3 This is the default look of the game without jkgfxmod enabled in OpenMOTS

openmotssecurirtycamerapanel4 When jkgfxmod is enabled with jknup and motsnup in OpenMOTS

In MotS (not OpenMOTS), jkgfxmod seems to be loading 00t_8.mat in the first level where it's got 00t_4.mat as the elevator call button, because it's also loading the emissive textures for 00t_8.mat while at it This is probably because since 00t_4.mat and 00t_8.mat are identical in MotS, jkgfxmod loads 00t_8.mat's texture signatures before checking what 00t_4.mat actually is (Texture signatures from metadata.json, like this

            "replaces_signatures": [
                "26b4cb5304ec1eb136ed57953dfb5f58",
                "471b46d2301fd856904a6c9bff0db878",
                "cedefb83eaf622b944dd54824a39ebf3",
                "ff2f7eb776d308a0ecb2882194d52dbe"
            ])

We don't really know though what is going on and why OpenMOTS is loading incorrect textures compared to regular jkgfxmod installs.

In short, OpenMOTS is loading some textures, for now the only confirmed one being elevator call panels/security station buttons, from the JKnup side of things and not the MOTSnup side of things. It isn't an issue with a vanilla install or a jkgfxmod build with both nups present.

Toggling jkgfxmod in the options demonstrates the differences clearly while in OpenMOTS.

Current solution: This is a mod-related issue that isn't playing nicely with Openjkdf2/openmots, so nothing is really needed, but we could comb through the game toggling jkgfxmod on and off the identify erroneous textures and remove them from the manifest json. That should restore them while keeping most of the upscaled textures intact. There are definitely more practical ways though that I don't know about.

shinyquagsire23 commented 1 year ago

Does this happen when the game is launched with -motsCompat directly? I'd guess it's just some dirty state sticking around between soft resets.

Vortikai commented 1 year ago

Tbh I never figured out -motsCompat launch option stuff and haven't messed with it much. I launch both games separately through Steam. I'll try to figure that out and mess around later. Explicit instructions always appreciated as well.

Edit: I should mention my JKDF2 and MOTS directories are completely separate. The way the neural upscale packs (NUPs) work for MOTS is basically a little over half of MOTS textures are from the original JKDF2 game. The modders simply took those upscales and threw them into the folder jknup in the MOTS jkgm/materials directory. Additional textures not found with the original JKDF2 game and are unique to MOTS were placed in motsnup in the same location.

Vortikai commented 1 year ago

In extremely simple terms:

kuva

Here's my jkgfxmod textures directory for MotS. In JKGFXMod only installs with the jknup and motsnup direcotires present, the correct texture loads openmotssecurirtycamerapanel2.

With the same directory in OpenMOTS, this incorrect texture loads openmotssecurirtycamerapanel1 When removing jknup directory (the one with neural upscaled textures from the original JKDF2 game that MOTS uses) from an OpenMOTS installation, the correct vanilla texture displays.

We have no idea why OpenMOTS is (possibly) loading Res2.gob 00t_4.mat instead of JKmres.goo 00t_4.mat

shinyquagsire23 commented 1 year ago

oh, I actually did all of the MAT stuff based on filenames instead of hashes, since it was faster and I had access to the texture filenames. I guess I'd have to sort out which texture pack wins out in my case.