swbf-unmunge - v1.1.1

Started by SleepKiller, July 06, 2017, 10:20:57 PM

Previous topic - Next topic
Quote from: Teancum on February 15, 2018, 06:08:24 PM
YES! Console support is actually a lot more useful than you might think, especially for those of us who work on console-based mods.

On a different note if I sent a few specific PC map lvls to you could you take a look at them? These were old files I got permission for from the Conversion Pack days, and I'd like to use them in the Xbox mod. The problem is these files (well, really one map in particular) don't output the .wld file, and so I can't rebuild the assets.

That being said I've been able to recover a few maps with this tool, which is amazing. Honestly you've done so much to revitalize things.
I'm glad to hear that it's been useful to you!

I'll happily to take a look at files that aren't handled correctly. Feel free to send me them and I'll try to look at them when I have the time.

Thanks for adding console support! There seems to be a few issues with some of the extracted models however:



This is from the Xbox DLC Rhen Var Habor map. So far I've only encountered this issue with map models, not unit models.

Can you try re-exporting the .tga files for the model through gimp? (Simply open it and export it again.) I know some programs have issues reading .tga files written out by DirectXTex.

That partially fixed the issue:


Looks like the uvs on that top half got there Y coordinates squished to one value.
Is there a problem with non-normalized coordinates, SK? It would be good to examine that MSH you has with a hex editor, Dylan. If you upload it, I'll take a look.

I included the textures in the .zip as well. It's actually a different model from the Battlefront 1 version. For whatever reason the developers decided to change the ice cave entrances.

February 17, 2018, 04:39:20 PM #111 Last Edit: February 17, 2018, 06:55:32 PM by RepComm
Looking at the raw values, it seems that my assumptions (about the UVs on that top map were squished) were wrong. Maybe right? Its a lot of data :P

EDIT- Forgot about V coordinates.

EDIT- Output too long for post. Using snippet instead. Download contains full JSON dump (and the script I wrote to output it all).

[spoiler=Raw UV Dump JSON]
Code (javascript) Select

[
    {
        "uCoords": [
            5.605193857299268e-45,
            0.94921875,
            0.01025390625,
            0.08447265625
        ],
        "vCoords": [
            7.349609375,
            6.84912109375,
            7.25927734375,
            6.9404296875
        ]
    }, <etc, etc, etc>

[/spoiler]

The idea behind this, is that if there a bunch of duplicate values in one of the coords (u or v), then only 1 pixel in that dimension is getting stretched across the surface of the mesh, which looks exactly like parts of the images you've shown thus far. There are several duplicate values, but I'll know for sure once I generate some PNG images to visualize it. --working--

I'm finding a lot of data that looks like this:
Code (javascript) Select

"uCoords": [
            1.2611686178923354e-43,
            0.91455078125,
            0.91455078125,
            0.91455078125,
            0.91455078125,
            0.91455078125,
            0.91455078125,
            0.91455078125,
            0.91455078125,
            0.91455078125,
            0.91455078125,
            0.91455078125,
            0.91455078125,
            0.91455078125,
            0.91455078125,
            0.91455078125,
            0.91455078125,
            0.91455078125,
            0.91455078125,
            0.91455078125,
            0.91455078125,
            0.91455078125,
            0.91455078125,
            0.02685546875,
            0.91455078125,
            0.41943359375,
            0.41943359375,
            0.41943359375,
            0.41943359375,
            0.41943359375,
            0.41943359375,
            0.41943359375,
            0.41943359375,
            0.41943359375,
            0.41943359375,
            0.41943359375,
            0.41943359375,
            0.64404296875,
            0.41943359375,
            0.44189453125,
            0.44189453125,
            0.44189453125,
            0.44189453125,
            0.44189453125,
            0.44189453125,
            0.44189453125,
            0.44189453125,
            0.44189453125,
            0.44189453125,
            0.44189453125,
            0.44189453125,
            0.44189453125,
            <etc, etc, etc>


Which is a pretty good indicator that something is wrong with these coordinates. Each coordinate is part of a set, where each u coordinate is paired with a v coordinate. It's like playing connect the dots with a few thousand dots on top of eachother, making a weird looking image.

Edit- Updated dump_uvs.zip with a basic start of a viewer where you paste the .msh_uvdump.json content into the text field on the left. I'll document it all when I get it extra functional. Right now im just drawing some rectangles as vertex positions. I'm also only parsing the second UV map in the viewer, which will be changed into a GUI select option, to view the different UV maps at will. I'm done for tonight.

I've looked at the troublesome section in the munged file, tried some things I thought of that could be causing the problem and I've come completely blank for now.

Your best bet may just be to re-import the file into XSI and fixup the damaged sections manually.

February 20, 2018, 12:37:17 AM #113 Last Edit: February 20, 2018, 12:48:51 AM by Gistech
Something sort of similar does happen to the feet on the AT-AT extracted from the PS2 version. (I think the U coordinates are correct from what I can see but the V ones aren't).

[spoiler][/spoiler]

(This is not a huge issue as the model is otherwise identical to the one found in psych0fred's Chain Isle assets, just rigged)
In Progress:
--Star Wars: Battlefront - Anniversary Edition (formerly Star Wars: Battlefront - Legacy Edition)
--Endor: Imperial Base

On Hold:
--Star Wars Battlefront: Elite Squadron For SWBF1

Question mostly for @Sleepkiller -- would it be helpful to send over specific example maps that are not decompiling correctly? I'm not sure how to best help here, but it's been a heaven-send to get this tool.

Quote from: Teancum on March 05, 2018, 08:06:47 AM
Question mostly for @Sleepkiller -- would it be helpful to send over specific example maps that are not decompiling correctly? I'm not sure how to best help here, but it's been a heaven-send to get this tool.
It does depend on what the problem is, but in most cases definitely.

March 05, 2018, 04:30:05 PM #116 Last Edit: March 10, 2018, 01:52:24 AM by Unit 33
Can do. Trying to tie up some loose ends with the Xbox mod, then I'll send over the ones I'm from the PC SWBF Convo Pack looking to recover. Thanks much.


[EDIT]


So the big one I'm having issues with is Concord Dawn. Here is the SWBF1 version.


I would be okay using this instead of the SWBF2 version, as it could probably use a re-convert to SWBF2 anyway given what I know now. http://www.swbfgamers.com/index.php?action=downloads;sa=view;down=201

Can you clarify for me what's broken in the output? After fixing up filenames and .bnd's path reference manually it loaded fine it Zero Editor for me.

Why I can unmunge files to 150 mb max ?

Quote from: SleepKiller on March 08, 2018, 05:30:33 PM
Can you clarify for me what's broken in the output? After fixing up filenames and .bnd's path reference manually it loaded fine it Zero Editor for me.
Didn't work for me. Maybe I didn't use the switch to specify it was swbf and not swbf_ii