SWBFGamers

Modding for the Original SWBF1 and SWBF2 => Released Assets => Topic started by: SleepKiller on July 06, 2017, 10:20:57 PM

Title: swbf-unmunge - v1.1.1
Post by: SleepKiller on July 06, 2017, 10:20:57 PM
This here is a tool for reversing the munge process. It doesn't work 100% correctly and isn't finished yet but it can get a lot out of .lvl files.

Now before I go any further let me stress this I'm making this in my spare time for fun because I find it interesting to work on. I did not make with the intent of using it to get access to other modders assets without their permission. If you want to use it on a map another modder made to learn how they did something then that is probably fine, but if you want to use it so you can use something of their's without asking then that probably isn't okay. But I digress a tool is a tool, it isn't inherently evil or good. I know I would have loved to have this a few years ago when I lost one of my maps to the abyss and only had the .lvl of it.

While it does a good job in my tests on SWBFII files at getting stuff back it makes no effort to get it into a ready to munge state. If you want to munge a map you extract using this tool you'll still need to do some work, in this regard I will offer little to no help. Some file names will be wrong, some files will need fixing up manually and all the .req files will need to be recreated by hand.

It's a commandline tool, so you'll need to know how to use those in order to do that. If you need help RepComm has made up for my laziness (a recurring pattern with this tool) written up a reasonably comprehensive guide here http://www.swbfgamers.com/index.php?topic=12452.0 (http://www.swbfgamers.com/index.php?topic=12452.0). (I say reasonably because it doesn't cover 'explode' or 'assemble', but those are likely of little interest to most people anyway.)

Find the source code on GitHub
https://github.com/SleepKiller/swbf-unmunge (https://github.com/SleepKiller/swbf-unmunge).
And hey would you look at that you can always find the most recent release on GitHub as well, isn't GitHub amazing.
https://github.com/SleepKiller/swbf-unmunge/releases (https://github.com/SleepKiller/swbf-unmunge/releases).

If you would like a GUI for it you find one made by RepComm here. I haven't used it myself but it looks pretty solid, you will need to install Java though if you don't have it.
https://github.com/RepComm/SWBFUnmungeGUI/releases (https://github.com/RepComm/SWBFUnmungeGUI/releases)

If it crashes for you, hangs, says "Exception Occurred" or produces bad output feel free to tell me. Don't forget to say which file you were using it on.
Title: Re: swbf-unmunge
Post by: LitFam on July 06, 2017, 11:13:17 PM
Amazing work sir, wait are your saying you can crack open any .lvl file in including a side .lvl for our personal use only and not to be used in public as you stated, also I thought it was impossible to crack open .lvl files.

Title: Re: swbf-unmunge
Post by: Red04SWBF on July 06, 2017, 11:30:52 PM
Great progress for modding! And great work!  :tu:
Title: Re: swbf-unmunge
Post by: Viathan on July 07, 2017, 12:33:40 AM
Great job :cheers:
Was working on a similar project but it's way not as good as yours
Title: Re: swbf-unmunge
Post by: AnthonyBF2 on July 07, 2017, 08:28:37 AM
Hey man I want to say this is an incredible tool! I noticed that this tool re-adds the ucfb header chunks to files it extracts and that is something I could never figure out on my own. I believe this tool will help me greatly in my SWBF2 PSP project. Get yourself a drink or something, you deserve it.
Title: Re: swbf-unmunge
Post by: NB20026 on July 07, 2017, 08:37:21 AM
why I msh files are inviicible ? :confused:
Title: Re: swbf-unmunge
Post by: LitFam on July 07, 2017, 08:49:11 AM
Quote from: RC-1138 on July 07, 2017, 08:37:21 AM
why I msh files are inviicible ? :confused:

He will probably fix this, however, I think some people will be using this tool to steal assets once it is stable that is my fear of this tool.
Title: Re: swbf-unmunge
Post by: SleepKiller on July 07, 2017, 06:05:30 PM
Quote from: RC-1138 on July 07, 2017, 08:37:21 AM
why I msh files are inviicible ? :confused:
Quote from: SleepKiller on July 06, 2017, 10:20:57 PM
If it crashes for you, hangs, says "Exception Occurred" or produces bad output feel free to tell me. Don't forget to say which file you were using it on.
I hate to answer with a quote but I did kind of answer that question already.The long answer is likely because I only know six of the formats used to store model data (https://github.com/SleepKiller/swbf-unmunge/blob/master/src/vbuf_helpers.hpp). I need an example of the model that is failing to be read by the tool, preferably a stock one so I can compare it before and after the munge process.

Quote from: LitFam on July 07, 2017, 08:49:11 AM
He will probably fix this, however, I think some people will be using this tool to steal assets once it is stable that is my fear of this tool.
Yeah, hopefully most people are nice and use it for the right reasons. Sadly I am sure there will always be a few people that are not so nice. Hopefully they are the few though.
Title: Re: swbf-unmunge
Post by: RepComm on July 07, 2017, 09:53:33 PM
SleepKiller, you are a beast. I am very interested in looking at your work under the hood.
Title: Re: swbf-unmunge
Post by: Giftheck on July 08, 2017, 05:04:47 AM
I would personally only use this tool to get access to map sources that are not available so I can alter them without hex editing IE Coruscant City. I would, however, 100% give credit to the original author.
Title: Re: swbf-unmunge
Post by: SleepKiller on July 10, 2017, 11:22:31 PM
I've released a new version of the tool. The way you use it has changed but aside from that it mostly functions the same. There are a few small enhancements as well in addition to the command line changes.
Title: Re: swbf-unmunge
Post by: Javitolo98 on July 11, 2017, 04:58:51 AM
It's possible make it that can extract the scripts from a mission.lvl? when I extract it only extracts a munged folder
Title: Re: swbf-unmunge
Post by: LitFam on July 11, 2017, 05:08:31 AM
Yes, 2.0 released thank you!  :D

I have noticed I get crashes with the latest version 2.0, I am using a .lvl named rep
Title: Re: swbf-unmunge
Post by: Ascertes on July 11, 2017, 07:04:46 AM
This a great piece of work SK! A tool such as this has been wanted for years by the community and you sir have delicered. I can't see myself using it, but I'm sure there are dozens who will  ;)
Title: Re: swbf-unmunge
Post by: SleepKiller on July 16, 2017, 04:04:37 AM
Just for anyone who is interested I posted a new version of tool. The major changes are it can get terrain make in a much higher quality fashion and should crash less. Although if you're someone who was curious about the workings on tool it has a much bigger, more exciting change in the source code. I have tidied up, refactored and abstracted away all the reading of the chunks, it should be much easier to follow what the program is doing now, not to mention customize yourself if you are that way inclined.

Quote from: JTN on July 11, 2017, 04:58:51 AM
It's possible make it that can extract the scripts from a mission.lvl? when I extract it only extracts a munged folder
You can find a (somewhat, when I'm not being lazy) up to date list of extracted files and their caveats here https://github.com/SleepKiller/swbf-unmunge/blob/master/readme.md#recovered-files (https://github.com/SleepKiller/swbf-unmunge/blob/master/readme.md#recovered-files). So no scripts are not supported. I might add support for them at some point since working on a basic Lua decompiler seems like a fun and educational experience but I make no promises. (A lot of things seem like a fun and educational experience to me!)

Quote from: LitFam on July 11, 2017, 05:08:31 AM
I have noticed I get crashes with the latest version 2.0, I am using a .lvl named rep
The stock SWBF1 rep.lvl or some custom one? Either way you can try the new version it may give better results. (It might not crash and might also tell you which chunk is causing the problem.)
Title: Re: swbf-unmunge
Post by: LitFam on July 16, 2017, 09:28:24 AM
I am using the SWB2 (evolved mod rep.lvl)

Update I just tested your latest version it still crashes.
Title: Re: swbf-unmunge
Post by: 411Remnant on July 16, 2017, 07:31:05 PM
This is a really cool tool!

@Litfam
[spoiler]I dont want to sound rude, but you really shouldnt be posting a direct link back here on moddb. The last thing we need is degenerates looking at the front page of the battlefront section on moddb and getting the wrong idea. Im sure your intentions arnt bad, but people on that website have been known to mis-use this kind of tool. [/spoiler]

Other than that I think this is a great tool for those modders who have lost thier source files from thier mods. That happened to me a few times, and I know its happened to several other modders. I really hope people dont mis-use this.
Title: Re: swbf-unmunge
Post by: LitFam on July 17, 2017, 03:57:18 AM
If sleep killer wants the link on Moddb to be removed I will do so at his request, also I did it so people would know about this (tool it is a open source for the SWB1 and SWB2, and maybe other games that use .lvl files) people deserve to know about this. This tool should not be kept a secret becuase people have been waiting for something like this for a long time.

Sleep killer if you wish to see the comment I posted on the fourm on Moddb look here, also if you wish for it to be removed I will remove it.

http://www.moddb.com/games/star-wars-battlefront-ii (Scroll down to the comment section)


Title: Re: swbf-unmunge
Post by: Cdt Fox on July 17, 2017, 07:53:14 AM
My opinion is to keep it on star wars battlefront 2004~5 forums/websites. Not on moddb. I know a few people waiting to crack .lvl files and use assets without permission  :wacko:
Title: Re: swbf-unmunge
Post by: Newmodder on July 17, 2017, 11:54:28 AM
So with this tool we are able to extract gcw.lvl?

Because according to psychofred (http://www.swbfgamers.com/index.php?topic=4692.5;wap2)

The audio lines are inside gcw.lvl. does thie mean we can finally extract the sounds from bf2?
Title: Re: swbf-unmunge
Post by: SleepKiller on July 18, 2017, 01:06:58 AM
Quote from: LitFam on July 16, 2017, 09:28:24 AM
Update I just tested your latest version it still crashes.
I tested latest rep.lvl from that mod under the tool and it didn't crash. Try the tool on stock .lvls and see if it crashes then. If it does show me what the command line you're running the tool with looks like.

Quote from: 411Remnant on July 16, 2017, 07:31:05 PM...
Quote from: LitFam on July 17, 2017, 03:57:18 AM...
Quote from: Cdt Fox on July 17, 2017, 07:53:14 AM...
This isn't a response to any of you so much me writing my perspective on things in relation to asset stealing. If anyone brings it up I'll likely reference them to this.

[spoiler=Long Version]So first I have to absolutely state I have no desire for people go about stealing and abusing other peoples' hard work. I firmly believe that if you invest into creating something unique/original/cool you definitively have the right to see that work protected from misuse.

However mods are a little different than most other art forms today. They typically do small changes or have their work heavily based off someone else's in the first place. How many modders in SWBF/SWBFII have designed and created assets based on their own IP? I would be surprised if the number was above ten, though I suspect it is much closer to zero.

Modding culture is based off taking others work and editing it to be how you like. None of this is related to why I made my tool but it is something you need to keep in mind. Your "work" while awesome and cool may not always be entirely "your" work.  And you may want to consider what your reasons for not letting others make mods with (or out of) it are, because there is a chance you are being a hypocrite towards the culture you enjoy.

So with the "read this before you get annoyed at people using your assets" section out of the way let's now assume you don't want people using your textures/models/effects or whatever. Presumably you have considered what I said above and have good reasons. What now? Thanks to this idiot SleepKiller any old fool can get your stuff and use it without your permission!

Well another thing to consider is that while the SWBF community may have been distributing it's mods a poorly documented plenty of other games have either easily understood formats or people created tools like this long ago. Those communities are most likely doing just fine and are far bigger than the SWBF one. Now yes it is true some people will just be jerks and use your stuff without permission but from what I've observed most people won't. And even when people do use your assets without permission it is unlikely to actually affect you in a noticeable way.

Of course I can promise none of that, maybe everyone in the world will download the tool and use it to get your assets! Although if that happened I think you should be more flattered than anything else. All in all however I do believe that the potential for learning (from others work, which if that annoys you then everything I say probably will) and asset recovery (by the original authors or with their permission) outweighs the potential downside of some rascal stealing assets. (All my opinion of course.)

Finally the reason I made this tool was because I was bored, thought creating this sounded fun, educational and an opportunity to practice writing software. Thus I made it and then I asked Led if he was fine with me posting it here. So it's really all his fault. Blame him. (That was a joke; please don't blame Led if you're annoyed at this tool.)
[/spoiler]

Short and to the point version.

Yes I know the tool has potentially bad uses but I think the good uses (education, etc) outweigh those. No I don't care where you post the tool. I only care what you do with it but even then if you use it break a window instead of put up a wall then that is a shame; there is nothing I can do about that and I will not pretend there is.

Quote from: Newmodder on July 17, 2017, 11:54:28 AM
So with this tool we are able to extract gcw.lvl?

Because according to psychofred (http://www.swbfgamers.com/index.php?topic=4692.5;wap2)

The audio lines are inside gcw.lvl. does thie mean we can finally extract the sounds from bf2?
No support for sound files (as per the readme on GitHub). If I ever do add support for sounds this issue on GitHub will close https://github.com/SleepKiller/swbf-unmunge/issues/4 (https://github.com/SleepKiller/swbf-unmunge/issues/4).
Title: Re: swbf-unmunge
Post by: Giftheck on July 18, 2017, 01:34:21 AM
I'm getting a ZeroEdito crash when I try to load the WLD. file created by this. I'm testing it on Rends Courscant: City for SWBF1, I checked the options for unmunging to SWBF1, and I get that crash.
Title: Re: swbf-unmunge
Post by: SleepKiller on July 18, 2017, 02:15:18 AM
Quote from: Gistech on July 18, 2017, 01:34:21 AM
I'm getting a ZeroEdito crash when I try to load the WLD. file created by this. I'm testing it on Rends Courscant: City for SWBF1, I checked the options for unmunging to SWBF1, and I get that crash.
Thanks for the bug report. The .pth file output by the tool was missing some braces, that could have been causing the crash. I just published a release fixing this. (Along with fixing .msh file material output for SWBF1, though that was a change I just had waiting.) I haven't tested the map you said, if it's still crashing ZE drop me a link to it and I'll take closer look at it when I get the chance.
Title: Re: swbf-unmunge
Post by: Giftheck on July 18, 2017, 02:20:48 AM
Yeah, it's still doing it :(

Here's the corus1.lvl that I'm trying to extract from:

https://mega.nz/#!VYgQHD6Z!YlkNOTPM4RiYQyDMwQ0nFZRchuzrL9E0lHlUX976tK0
Title: Re: swbf-unmunge
Post by: Delta-1035 on July 18, 2017, 10:08:35 AM
Can anyone please explain me how to use this step by step?

I'm trying it on a rep.lvl. Both the swbf-unmunge and the rep.lvl are on my desktop.

I launched the cmt.exe, loaded the swbf-unmunge and I got this:

swbf-unmunge <options>

Options:
-file <filepath> Set the input file to operate on.
-version <version> Set the game version of the input file. Can be 'swbf_ii' or 'swbf. Default is 'swbf_ii'.
-imgfmt <format> Set the output image format for textures. Can be 'tga', 'png' or 'dds'. Default is 'tga'.
-platform <format> Set the platform the input file was munged for. Can be 'pc', 'ps2' or 'xbox'. Default is 'pc'.


But then I don't know how to go haead. Everything I write seems to be wrong.

Sorry, I'm not familiar with this kind of programs, any help would be apprecciated.
Title: Re: swbf-unmunge
Post by: Led on July 18, 2017, 10:59:34 AM
open a command window

make sure your lvl file and the swbf-unmunge are in the same folder

use the command window to get to the folder, e.g.

cd c:\unmungetest

then on a command line type something like

swbf-unmunge -file rep.lvl -version swbf -imgfmt tga -platform pc


with any changes as appropriate
Title: Re: swbf-unmunge
Post by: Delta-1035 on July 18, 2017, 01:36:18 PM
I get an error:

Error: file_size(p): invalid argument: operation not permitted

As you can see

(https://s18.postimg.org/tfjttksl5/Immagine.jpg)

I tried with a different lvl file too, but the result it's the same.
Title: Re: swbf-unmunge
Post by: Led on July 18, 2017, 02:48:02 PM
do a "dir" command and lets see what files are in your current directory please
Title: Re: swbf-unmunge
Post by: SleepKiller on July 18, 2017, 07:01:04 PM
Led's right on the money here. That maddingly unhelpful error message (which I'll make a note to improve at some point) is coming from the function used to get the size of the file before loading it. It appears to be unable to find your file. You said you put the file and swbf-unmunge in the same directory, which is fine it is a nice simple way to make sure the tool can find the file. Unfortunately it doesn't seem to be able to, so what is going on?

So let me break down what is happening here. You're typing "desktop\test\swbf-unmunge" into the console which is letting it find and launch the program. However you're launching it from "C:\Users\Youreusername\. This means that the program will be caused to look for your file relative to the directory you launched it from. (Which will cause it to not be able to find the file.)

You can do two things to fix this. Type
cd desktop/test/
before running swbf-unmunge to change the current working directory. This will let it find the file.

Or you can keep running "desktop\test\swbf-unmunge" and instead change you're whole commandline to.

desktop/test/swbf-unmunge -file desktop/test/rep.lvl -version swbfThat should also let it find the file.

If you're still confused and it isn't working I would recommend reading up on working directories and playing around with simple commands like "copy" and "ren" before coming back to this.
Title: Re: swbf-unmunge
Post by: RepComm on July 18, 2017, 09:53:48 PM
Hi guys, I've started a GUI in java for this. Its basic, but its there.

https://github.com/RepComm/SWBFUnmungeGUI

Video: https://www.youtube.com/watch?v=Szt3ZqJENf8

I just started this afternoon, so it isn't done or anything (no file chooser yet, just drag'n'drop).

Multiple LVL files can be decompiled in a row, they don't need to be in the same directory because they are just processed one at a time. This is great if you have a directory of them, since you can just select the all and drop em all at once.

I've hooked the output stream of the tool to the text area at the bottom of the GUI, but I haven't been able to get anything out of it yet.. I don't know what all information is dumped by the tool, so I guess I'll have to get with you on that SK.
Title: Re: swbf-unmunge
Post by: Delta-1035 on July 19, 2017, 12:54:18 AM
Quote from: SleepKiller on July 18, 2017, 07:01:04 PM
Or you can keep running "desktop\test\swbf-unmunge" and instead change you're whole commandline to.
desktop/test/swbf-unmunge -file desktop/test/rep.lvl -version swbfThat should also let it find the file.
This worked, thank you very much!
Title: Re: swbf-unmunge
Post by: GSLOMG on July 19, 2017, 03:27:20 PM
When I try to excecute it it just says the application was unable to start correctly.
Title: Re: swbf-unmunge
Post by: Led on July 19, 2017, 06:01:14 PM
Quote from: GSLOMG on July 19, 2017, 03:27:20 PM
When I try to excecute it it just says the application was unable to start correctly.

what did you do to execute it?  and what version of windows are you using?
Title: Re: swbf-unmunge
Post by: SleepKiller on July 19, 2017, 10:48:39 PM
Quote from: RepComm on July 18, 2017, 09:53:48 PM
...
That's pretty cool. I'm sure people who are unfamiliar with (or just don't like using) command prompts will appreciate your efforts.

As for what is output by the tool. Currently it will write messages to stdout when something goes wrong reading a chunk or when something really goes wrong and an exception hits the handler in main. So there is output, but if everything is fine you'll never see it.

Quote from: GSLOMG on July 19, 2017, 03:27:20 PM
When I try to excecute it it just says the application was unable to start correctly.
Make sure you have the Visual C++ Redistributable 2017, you can get it here: https://go.microsoft.com/fwlink/?LinkId=746572 (https://go.microsoft.com/fwlink/?LinkId=746572)
Title: Re: swbf-unmunge
Post by: RepComm on July 20, 2017, 07:20:03 AM
Trivia question time!
Why make something like this in c++ instead of something a little more English like c#?

How possible is it to port the code to c#? (for another person, I know you're busy!)

How difficult would it be to make your code go the other way and write lvls instead?

Is it possible to create a builder class of sorts that would allow you to step through the lvl in programming so we can skip the compilers?
Title: Re: swbf-unmunge
Post by: Led on July 20, 2017, 08:47:31 AM
Quote from: RepComm on July 20, 2017, 07:20:03 AM
Trivia question time!
Why make something like this in c++ instead of something a little more English like c#?

Only computer science students use c#  :P
Title: Re: swbf-unmunge
Post by: SleepKiller on July 21, 2017, 07:20:16 AM
Quote from: RepComm on July 20, 2017, 07:20:03 AM
Trivia question time!
Why make something like this in c++ instead of something a little more English like c#?

How possible is it to port the code to c#? (for another person, I know you're busy!)

How difficult would it be to make your code go the other way and write lvls instead?

Is it possible to create a builder class of sorts that would allow you to step through the lvl in programming so we can skip the compilers?
I'm lazy, so here have a poorly made, poorly recorded video reply! (I really don't know why the colour and quality is so bad in the video. Recording is hard.) https://www.youtube.com/watch?v=_JNAwpxp0h4&feature=youtu.be (https://www.youtube.com/watch?v=_JNAwpxp0h4&feature=youtu.be)

I really am a little bit sorry, I know my accent and mumbling is probably going to make it hard to understand what I'm saying. If you need anything clarified (or if I misunderstood a question somewhat) just let me know. I'll probably feel less lazy and write a written reply next time.
Title: Re: swbf-unmunge
Post by: RepComm on July 21, 2017, 09:00:31 AM
Cool!
Quote from: Led on July 20, 2017, 08:47:31 AM
Only computer science students use c#  :P
This is truuuuue..
Title: Re: swbf-unmunge
Post by: SleepKiller on July 23, 2017, 10:58:14 PM
There is a hot new version of the tool out on GitHub. Go there for the list of changes if you're interested. It fixes a lot of things related .msh file output. (As well as a couple small things here and there.)

Just a quick note to the people who I've told (either in this topic or by PM) that I'll try and work on something. I haven't forgotten, I've just had other more important things in the tool to fix. (Like .msh files not crashing Zero Editor.) They are on my to-do list still.
Title: Re: swbf-unmunge
Post by: Javitolo98 on July 24, 2017, 04:46:45 AM
I don't know if someone have the same problem but in the new versions of swbf-unmunge ,the .exe file closes at the second of open it
Title: Re: swbf-unmunge
Post by: Giftheck on July 24, 2017, 05:01:00 AM
Quote from: JTN on July 24, 2017, 04:46:45 AM
I don't know if someone have the same problem but in the new versions of swbf-unmunge ,the .exe file closes at the second of open it

It's command line, you have to use it through command prompt.
Title: Re: swbf-unmunge
Post by: SleepKiller on July 24, 2017, 07:46:37 AM
Quote from: JTN on July 24, 2017, 04:46:45 AM
I don't know if someone have the same problem but in the new versions of swbf-unmunge ,the .exe file closes at the second of open it
The usage of the application changed when I introduced commandline options. When I did that I removed the primitive fallback for selecting a file when nothing was specified.

If you don't want to use a command prompt (can't say I blame you) I would recommend checking out RepComm's fine tool here (https://github.com/RepComm/SWBFUnmungeGUI) that let's you use the tool in a much more user friendly fashion.
Title: Re: swbf-unmunge
Post by: NB20026 on July 24, 2017, 08:01:46 AM
Why only version 0.1.1 work ? :confused:
Title: Re: swbf-unmunge
Post by: SleepKiller on July 25, 2017, 06:34:12 AM
I've posted a new minor version fixing various things related to world output.

This one should let you extract and use the map you were having problems with Gistech. Albeit with some minor touch ups still, the .sky file will likely crash Zero Editor for reasons I'll try to write up at some point. I'll try to make a complete tutorial on getting the map back into Zero Editor when I have the time. But for now if you ignore the .sky/.prp/.bnd files (don't rename them alongside the .pln file basically) you can edit and use maps extracted by the tool now.

Quote from: RC-1138 on July 24, 2017, 08:01:46 AM
Why only version 0.1.1 work ? :confused:
I suspect it is because you are not using it correctly, you can try RepComm's GUI https://github.com/RepComm/SWBFUnmungeGUI (https://github.com/RepComm/SWBFUnmungeGUI) if you're unfamiliar with command line apps and don't feel like learning how to use them.
Title: Re: swbf-unmunge
Post by: Javitolo98 on July 27, 2017, 10:40:34 AM
Now the the tool export the mshs but it looks weird ,It seems as if it had been crushed,For example this is supposed to be the emperor
(https://lh3.googleusercontent.com/q7NmYwZg8aLNO898UgF6PzMy6KgY8BFHFNSkhK2RSzxliS_xZzAm3YdO3A-oYQ0RGrTvkYVCPs3wHWbmV_K-pObTDrQbAOFd3XQU3iGnVssb2GiUC7VopAIt3cfsDJXKC6s--jXG2PIJiARdKggTccGCFmiykzLC9GgagGk8uzxHJ10XxJfMua_qnlVHxRP6x8iYPtmGM7W9WGOD2Q6KcXkKckAUkLhf_tyoRfJYQqH_rn6TmllGJbZObVWzSuCTDW-USeBZOPIKt8csW01HFjJ_QjZbJ5bmLkf9TTt5o_ftBKpz6jjSLKxREmeDtG24dhKiZHOUS1r3rKjbaX-od49UVu3Oj4aKRun3SEjXk29B7Ktn9L15wcGvfqcWLgeFukCLojAU9FIeZOI7JTebwyBmBC7LA2XRuWaW6kfdfFvw49oqFATGBTP4p41Qe4vhhx90XVap7qOc4R-0u6HxRg-0HeRniFkwGjBwqSvfEA450XCbUzW5KRnQwEPW3C5kNSZfLCyukeZ8o69bW9PBagRW1ZiiZeoAxr2U6ujcfogskZXPFm6kN__7_VUUWmCi49p5gcydchHyrWDECVuV_MhLcEyAyM79sokhM5bwVQQ0_tXZ37sa_7GT=w971-h645-no)
Title: Re: swbf-unmunge
Post by: SleepKiller on July 28, 2017, 07:57:26 AM
For anyone who is interested I've posted a new major(?) release of the tool. Still not 1.0 but it's getting there, see GitHub for a surprisingly (to me at least) changelist.

Quote from: JTN on July 27, 2017, 10:40:34 AM
Now the the tool export the mshs but it looks weird ,It seems as if it had been crushed,For example this is supposed to be the emperor
I can't actually see that picture but I took a guess at what the problem might be, found and fixed it. (At least in most cases for SWBFII models at least, SWBF1 is another story (https://github.com/SleepKiller/swbf-unmunge/issues/8).
Title: Re: swbf-unmunge
Post by: Delta-1035 on July 28, 2017, 11:39:53 AM
Quote from: SleepKiller
I can't actually see that picture but I took a guess at what the problem might be, found and fixed it. (At least in most cases for SWBFII models at least, SWBF1 is another story.

Let me post a working image of the bug:
[spoiler](https://s12.postimg.org/l0ixr96al/mshbug.jpg)[/spoiler]
This should be a clone trooper.

Quote from: SleepKillerFor anyone who is interested I've posted a new major(?) release of the tool.

Thank you!

EDIT: The new version does not work for me, I'm using it the same way as the previous one and with the same lvl files - it gives me the "has stopped working" error when trying to load files. (win7)
Title: Re: swbf-unmunge - v0.5.0 - GUI Update
Post by: RepComm on July 28, 2017, 01:07:34 PM
Updated GUI for 0.5.0 release! You can get it here:
https://github.com/RepComm/SWBFUnmungeGUI/releases/tag/0.5.1

This version is compatible with swbf-unmunge.exe v 0.5.0, as it uses the new <option>s
Next release should include backward compatibility.

-File Browser implemented (with multiselect), which is nice if you can't drag'n'drop.

Thanks for the sweet update SK!
Title: Re: swbf-unmunge - v0.5.0 - GUI Update
Post by: SleepKiller on July 28, 2017, 06:48:12 PM
Quote from: Delta-1035 on July 28, 2017, 11:39:53 AM
Let me post a working image of the bug:

This should be a clone trooper.
As of the latest version it should only be happening for models munged by SWBF1's tools yeah?

Quote from: Delta-1035 on July 28, 2017, 11:39:53 AM
EDIT: The new version does not work for me, I'm using it the same way as the previous one and with the same lvl files - it gives me the "has stopped working" error when trying to load files. (win7)
Darn. I'm not sure how to do about debugging this one sorry. Some quick testing on part suggests that the tool dislikes leading '/' on file paths.

So this didn't work for me,
"./bin/release/swbf-unmunge -file /bin/release/test/rep.lvl -version swbf"
but this did,
"./bin/release/swbf-unmunge -file bin/release/test/rep.lvl -version swbf".

I really don't know how to approach this sorry aside from throwing random suggestions out there. You can always post your command line and I can try to mimic your folder layout and such and then see what happens. (I suspect it could also be a problem relating to Windows 7 and if that's the case I really am stumped as I don't have a copy handy to install on a VM and test or anything.)

Quote from: RepComm on July 28, 2017, 01:07:34 PM
...
It seems like you've done what I do all the time and get two similar things confused. The platform input switch is on the wrongside of the UI, that or your labeling is incorrect. Other than that tiny thing, nice work.
Title: Re: swbf-unmunge - v0.5.1
Post by: RepComm on July 29, 2017, 03:15:41 PM
Quote from: SleepKiller
It seems like you've done what I do all the time and get two similar things confused. The platform input switch is on the wrongside of the UI, that or your labeling is incorrect. Other than that tiny thing, nice work.
I appreciate your tactfulness! You're completely right, and I've rebuilt the project with that fix. Same link applies.
--
I have also discovered that I am actually running/waiting/reading from the executed command in the GUI's thread (Swing), which makes the gui unresponsive while it's waiting. This doesn't break anything of course, but I'll be using a library I made a while back to dispatch the execution in another thread.

Title: Re: swbf-unmunge - v0.5.1
Post by: Delta-1035 on July 30, 2017, 03:02:59 AM
Quote from: SleepKillerAs of the latest version it should only be happening for models munged by SWBF1's tools yeah?
Nope, v.4 did that on swbf2 models.


Quote from: SleepKillerDarn. I'm not sure how to do about debugging this one sorry. Some quick testing on part suggests that the tool dislikes leading '/' on file paths.
So this didn't work for me,
"./bin/release/swbf-unmunge -file /bin/release/test/rep.lvl -version swbf"
but this did,
"./bin/release/swbf-unmunge -file bin/release/test/rep.lvl -version swbf".
I really don't know how to approach this sorry aside from throwing random suggestions out there. You can always post your command line and I can try to mimic your folder layout and such and then see what happens. (I suspect it could also be a problem relating to Windows 7 and if that's the case I really am stumped as I don't have a copy handy to install on a VM and test or anything.)

I'm usign the same line that worked fine with the previous v3.2 and v.4.

" desktop\test\swbf-unmunge -file desktop\test\***.lvl "

Still v5.1 crashes on me, even with the GUI :(

I'm attaching a screenshot with the error info, I hope it will be helpfull.
Title: Re: swbf-unmunge - v0.5.1
Post by: RepComm on July 30, 2017, 02:59:13 PM
Hi, I have no idea if it will help, but when you use my GUI, all files get converted to absolute drive paths (including unmunge executable location). It may or may not solve your issue. I don't speak c++ error language.
Title: Re: swbf-unmunge - v0.5.1
Post by: SleepKiller on August 01, 2017, 06:20:21 AM
I've posted a new version of the tool. It features cloth support and override texture support. (Also bug fixes and a couple other minor changes.) I'm closing on the point where I'll be pretty happy with the state of the tool and will slap v1.0.0 on it. If anyone has any suggestions or requests that I haven't seen yet feel free to let me know, depending on the complexity/difficulty/interest factor of it I might do it before labeling the tool stable and moving on.

Quote from: Delta-1035 on July 30, 2017, 03:02:59 AM
...
The screenshot is helpful as it tells me (after some Googling on Windows exception codes) an access violation is causing the crash. It happens with every .lvl you try right? I will try to mess around with some key things I changed from 0.4.x to 0.5.x and see if I can find the problem. No promises though, I really am not setup to help debug these things but I will give it a good shot.
Title: Re: swbf-unmunge
Post by: Delta-1035 on August 01, 2017, 10:57:08 AM
Quote from: SleepKillerThe screenshot is helpful as it tells me (after some Googling on Windows exception codes) an access violation is causing the crash. It happens with every .lvl you try right?
Yep, it happens with every lvl. Still no luck with 0.5.2.

Quote from: SleepKillerI will try to mess around with some key things I changed from 0.4.x to 0.5.x and see if I can find the problem. No promises though, I really am not setup to help debug these things but I will give it a good shot.

v0.3.2 worked fine for me while v0.4 didn't, maybe you should check the changes from 0.3.2 to 0.4

I'm happy that you'll try to give it a look, I'd love to have it working again, thank you!
Title: Re: swbf-unmunge
Post by: SleepKiller on August 03, 2017, 01:49:30 AM
I've posted a... strange new version of the tool. It adds alternate modes of operation for it, so instead of reading and "unmunging" a file it now has a mode that will explode it into it's child chunks, it then has a counterpart mode that let's it reassemble that same file after edits have been made. See GitHub for usage info and documentation.

Quote from: Delta-1035 on August 01, 2017, 10:57:08 AM
...
I'm so confused. I don't see anything that could be causing an access violation in the changes from v0.3.2 to v.0.4. I could try sending you a build of each commit (there are only 9) for the changes from v0.3.2 to v.0.4, you would then be able to help me pinpoint exactly what change caused the problem. Bit of an extreme option, but lacking a copy of Windows 7 myself I'm not sure what else to do.

A fine example of the "it works on my machine" problem.
Title: Re: swbf-unmunge - v0.6.0
Post by: NB20026 on August 03, 2017, 05:17:10 AM
Still in 0.6.0 I have invincible models :confused:
Title: Re: swbf-unmunge - v0.6.0
Post by: SleepKiller on August 03, 2017, 06:16:05 AM
Quote from: RC-1138 on August 03, 2017, 05:17:10 AM
Still in 0.6.0 I have invincible models :confused:
Well it would be very surprising if v0.6.0 fixed problems you were having with models since none of it's changes were fixes for them.

You need to provide me with more information otherwise I can not help. I get that english may not be your first language so I get that it may be difficult for you to do. But in short I need to know the following.

What context is the model not showing up in? In SWBF Viewer? XSI? Zero Editor? Or Ingame?

What model are you having trouble with?

Where did you get the model from? (What .lvl it came from.)
Title: Re: swbf-unmunge
Post by: Delta-1035 on August 04, 2017, 12:42:09 AM
Quote from: SleepKiller
I'm so confused. I don't see anything that could be causing an access violation in the changes from v0.3.2 to v.0.4. I could try sending you a build of each commit (there are only 9) for the changes from v0.3.2 to v.0.4, you would then be able to help me pinpoint exactly what change caused the problem. Bit of an extreme option, but lacking a copy of Windows 7 myself I'm not sure what else to do.
A fine example of the "it works on my machine" problem.
Yeah, I was wrong, sorry, v4 actually works fine!
Title: Re: swbf-unmunge
Post by: SleepKiller on August 04, 2017, 09:43:37 PM
Quote from: Delta-1035 on August 04, 2017, 12:42:09 AM
Yeah, I was wrong, sorry, v4 actually works fine!
All good!

As I said I have no copy of Windows 7 to test with so I can only take guesses as to what is causing it.

My first one is the way the tool is saving files. I've attached a build that has all the changes from v0.4.x to v0.6.x except it saves files using the C++ standard API (the way it was doing it in v0.4.0). If you could quickly let me know if this fixes it for you that would be great!

Title: Re: swbf-unmunge - v0.6.0
Post by: Newmodder on August 05, 2017, 12:35:49 PM
Any new interest in the voices? :)
Title: Re: swbf-unmunge - v0.6.0
Post by: SleepKiller on August 06, 2017, 12:44:52 AM
Quote from: Newmodder on August 05, 2017, 12:35:49 PM
Any new interest in the voices? :)
The completionist in me does want to add support for sound files and I did look into this today to get an idea of how much work it would be. It certainly looks possible, but a nontrivial amount of work still. Maybe when I have a spare weekend at some point I'll sit down and work my way through the format. For now though I can't make time to do it sadly.
Title: Re: swbf-unmunge - v0.6.0
Post by: Javitolo98 on August 07, 2017, 10:55:51 AM
I have the same crash problem as Delta-1035 and the version you attached works fine
Title: Re: swbf-unmunge - v0.6.0
Post by: RepComm on August 07, 2017, 01:10:22 PM
Okay, I've started testing on a windows 7 desktop I have access to.

Here is the error while just running it like JTN and Delta have described.
[spoiler=Error Spit out]
Problem Event Name: APPCRASH
  Application Name: swbf-unmunge.exe
  Application Version: 0.0.0.0
  Application Timestamp: 5982dfca
  Fault Module Name: KERNELBASE.dll
  Fault Module Version: 6.1.7601.23807
  Fault Module Timestamp: 5915fe14
  Exception Code: c0000005
  Exception Offset: 0000000000001b54
  OS Version: 6.1.7601.2.1.0.768.3
  Locale ID: 1033
  Additional Information 1: d71f
  Additional Information 2: d71fd7e4b67198e93f06d817469bafc2
  Additional Information 3: 4170
  Additional Information 4: 417047293685f64cd2568faab0e1570d

Read our privacy statement online:
  http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409

If the online privacy statement is not available, please read our privacy statement offline:
  C:\Windows\system32\en-US\erofflps.txt
[/spoiler]

I'm going to run this thing in visual studio (from source) and see where the code fails. I'll edit this post after the fact.

Edit- I'm installing VS 2017, but in the mean time I'm trying with 2010 express that is already installed. I get this error whilst trying to open the project : [spoiler=VS2010ExpressX64TargetError]C:\Users\Jonathan\Downloads\swbf-unmunge-master\swbf-unmunge.vcxproj : warning  : Platform 'x64' referenced in the project file 'swbf-unmunge' cannot be found. Please make sure you have it installed under '%VCTargetsPath%\Platforms\x64'.

C:\Users\Jonathan\Downloads\swbf-unmunge-master\swbf-unmunge.vcxproj : error  :  Platform 'x64' referenced in the project file 'swbf-unmunge' cannot be found. Please make sure you have it installed under '%VCTargetsPath%\Platforms\x64'. The project cannot be loaded.
[/spoiler]

edit- Okay, I've got VS 2017 installed (finally..). Right now I've resolved a few errors regarding opening the project, but I cannot seem to get tbb include references to work. I cannot use any references to tbb, glm, or gsl yet. I suspect your build instructions on GitHub are what I really need to follow :P

I'll continue tomorrow.
Title: Re: swbf-unmunge - v0.6.0
Post by: SleepKiller on August 07, 2017, 06:57:57 PM
Quote from: JTN on August 07, 2017, 10:55:51 AM
I have the same crash problem as Delta-1035 and the version you attached works fine
Awesome thanks for testing it. I'll make that change for the master branch.

edit: It's done. I've posted a new release with the change in place.

Quote from: RepComm on August 07, 2017, 01:10:22 PM
...
Yeah the tool uses the C++17 features that have been implemented in VS 2017. I probably didn't make that clear in the readme.

As for the dependencies they are resolved using vcpkg (https://github.com/Microsoft/vcpkg)'s  integrate function. vcpkg is really simple to install and use, although any unknown piece of software is scary, if you can work through the instructions for using it and acquiring packages (the x64 versions) you should have no trouble building the tool.
Title: Re: swbf-unmunge - v0.6.0
Post by: 1ИCΘ6И17Θ on August 08, 2017, 04:55:25 AM
Quote from: Newmodder on August 05, 2017, 12:35:49 PM
Any new interest in the voices? :)
Wow, I came for the same thing.
I'm gonna give this neat tool a try as soon as I can.  :P
Title: Re: swbf-unmunge - v0.6.1
Post by: NB20026 on August 08, 2017, 10:14:58 AM
every version don't work only 0.1.1 please help
Title: Re: swbf-unmunge - v0.6.1
Post by: SleepKiller on August 08, 2017, 06:57:25 PM
Quote from: RC-1138 on August 08, 2017, 10:14:58 AM
every version don't work only 0.1.1 please help
Sorry but until you respond to my past two replies to you I can not offer any help.

First Reply - http://www.swbfgamers.com/index.php?topic=12158.msg114810#msg114810 (http://www.swbfgamers.com/index.php?topic=12158.msg114810#msg114810)
Second Reply - http://www.swbfgamers.com/index.php?topic=12158.msg115014#msg115014 (http://www.swbfgamers.com/index.php?topic=12158.msg115014#msg115014)
Title: Re: swbf-unmunge - v0.6.1
Post by: NB20026 on August 08, 2017, 10:24:47 PM
Sorryw with this 0.6.0 I have 0.1.1 and I think this work
Title: Re: swbf-unmunge - v0.6.1
Post by: SleepKiller on August 10, 2017, 08:56:08 AM
Hey guys, I'm going to be taking a break from my keyboard for a while. As such I won't be able to update or provide support for this (or model-edit) anymore. (Well eventually I will be able to of course, but if I feel like it then is another matter.)

Anyway I hope the tool it's stable and has a good feature set. I feel as though it does but I had still hoped to get another release or two out fixing some final bugs and maybe adding support for sounds. Ah well such is life, someone else is welcome to "finish" it though! (It's open source after all.)

Special apologies to RC-1138 who I'm kind of leaving hanging here. I'm pretty sure I've fixed everyone else's bug reports/feature requests (excluding sounds and scripts) even if I didn't tell you about it.
Title: Re: swbf-unmunge - v0.6.1
Post by: Delta-1035 on August 10, 2017, 11:24:34 AM
V0.6.1 seems to work fine for me, thank you very much! Nice work you did with this tool!
Title: Re: swbf-unmunge - v0.6.1
Post by: Ginev on August 23, 2017, 11:15:03 PM
Since i am noob with such things can someone tell me step by step what exactly i need to do in order to unmunge let say spa1.lvl from my Battlefront 2 folder?
Title: Re: swbf-unmunge - v0.6.1
Post by: Raigiku on October 06, 2017, 12:09:41 PM
Holly molly you are a god. Hopefully no one takes this tool down.
Title: Re: swbf-unmunge - v0.6.1
Post by: Giftheck on October 06, 2017, 02:03:42 PM
Indeed it is. Sleepkiller did good work with it :tu: I have yet to give the newest version of the tool a go, but I'm hoping to do so in the near future.
Title: Re: swbf-unmunge - v0.6.1
Post by: 411Remnant on October 06, 2017, 04:05:41 PM
Quote from: Ginev on August 23, 2017, 11:15:03 PM
Since i am noob with such things can someone tell me step by step what exactly i need to do in order to unmunge let say spa1.lvl from my Battlefront 2 folder?
Maybe someone can do something of a step by step? At first I was against this tool, but if it means modders can revisit earlier work that assets got erased, maybe its not so bad. I know I would like to unmunge one of my earlier mods to get a weapon odf I made that I was never quite sure what I did with.
Title: Re: swbf-unmunge - v0.6.1
Post by: RepComm on October 07, 2017, 12:11:40 AM
I'm working on some formatted instructions (though, I'll probably use Ginev's question as an example at the bottom soon).
http://www.swbfgamers.com/index.php?topic=12452
Title: Re: swbf-unmunge - v1.0.1
Post by: SleepKiller on October 13, 2017, 10:27:45 PM
I've posted v1.0.0 v1.0.1. It just fixes a few bugs I found and has a couple small new things. It doesn't do anything major as you might expect from a jump from 0.6 to 1.0 but that is because this is mostly just me saying "I am confident the tool is now stable." As always you can find the new release on the GitHub release page.

v1.1.0 will have something more interesting, if I make it.
Title: Re: swbf-unmunge - v1.0.1
Post by: 1ИCΘ6И17Θ on October 13, 2017, 11:42:48 PM
Sound support?

Suspense intensifies
(https://pics.onsizzle.com/heavy-breathing-4358816.png)
Title: Re: swbf-unmunge - v1.0.1
Post by: LitFam on October 14, 2017, 03:13:18 AM
Will there be support for .anims file types, also will mix up textures be fixed for star wars battlefront wars battlefront 2 (2005) models?

I posted an attachment of the mix-up textures. BTW I am using the latest version 1.0.1
Title: Re: swbf-unmunge - v1.0.1
Post by: SleepKiller on October 14, 2017, 08:33:32 PM
Quote from: i|\|(06|\|i70 on October 13, 2017, 11:42:48 PM
Sound support?

Suspense intensifies
In a hypothetical 1.1.0 sound support would be one of the things I would be looking to add. As strange as it sounds though, at the moment I'm not setup to reverse engineer file formats. So I can't do it now but maybe in the future.

As always since this is just a hobby project, no promises.

Quote from: LitFam on October 14, 2017, 03:13:18 AM
Will there be support for .anims file types, also will mix up textures be fixed for star wars battlefront wars battlefront 2 (2005) models?

I posted an attachment of the mix-up textures. BTW I am using the latest version 1.0.1
I've actually fixed that bug at least twice. I didn't know it was still a problem. I'll take a look at it soon!

EDIT: As a workaround however if it's what I'm thinking of fixing yourself could be as simple as flipping the texture vertically in your favourite image editor. Try it in the meantime.

As for animations. If you mean getting the premunged .zaabin and .zafbin files back it does that and they're named correctly. (They're also the only chunks I've encountered related to animations.) If you mean turning .zaabin/.zafbin back into a set of *.msh animations then no I don't think that will ever happen, the value proposition for reverse engineering them is poor.
Title: Re: swbf-unmunge - v1.0.1
Post by: LitFam on October 14, 2017, 11:34:40 PM
Quote from: SleepKiller on October 14, 2017, 08:33:32 PM
EDIT: As a workaround however if it's what I'm thinking of fixing yourself could be as simple as flipping the texture vertically in your favorite image editor. Try it in the meantime.

Could you please elaborate more, please. I use paint.net and Gimp.
Title: Re: swbf-unmunge - v1.0.1
Post by: SleepKiller on October 15, 2017, 12:05:31 AM
Quote from: LitFam on October 14, 2017, 11:34:40 PM
Could you please elaborate more, please. I use paint.net and Gimp.
Sure. In Gimp from the drop down menus at the top of the window go,

Image -> Transform -> Flip Vertically

That should do the trick I think, try Flip Horizontally instead if it doesn't fix it.
Title: Re: swbf-unmunge - v1.0.1
Post by: LitFam on October 15, 2017, 12:16:23 AM
Thanks! :cheer:

This is what I mean by .anims file types look at the attachment.
Title: Re: swbf-unmunge - v1.0.1
Post by: SleepKiller on October 15, 2017, 01:56:38 AM
Quote from: LitFam on October 15, 2017, 12:16:23 AM
This is what I mean by .anims file types look at the attachment.
You'll have to enlighten me as to what those files are used for during the munge process, as they don't make it in any form into the finished .lvl. The *.zaabin/*.zafbin files should be all you need to use the animations.
Title: Re: swbf-unmunge - v1.0.1
Post by: LitFam on October 15, 2017, 07:02:21 AM
I tried that. I only set the skeleton name, then when I munged the munge log gave me an animation error.

Am I supposed to set the skeleton name, animation name, etc? Could you please help me thanks.

Here is the error I get in the log:

[spoiler]ERROR[levelpack req\bot_inf_501st_legion_clone_trooper.req]:Could not open munged\pc\humanevolved.anims for input. DOS reports:
No such file or directory
ERROR[levelpack req\bot_inf_501st_legion_clone_trooper.req]:Could not open munged\pc\humanevolved.anims for input. DOS reports:
No such file or directory

   2 Errors    0 Warnings
[/spoiler]
Title: Re: swbf-unmunge - v1.0.1
Post by: SleepKiller on October 15, 2017, 08:07:26 AM
I have no clue what levelpack does with or expects from the file. (That is to say I haven't the time to test my hypothesises on it.)  One workaround might be to try and create a dummy *.anims file.

I would first try this and see if it worked.
ucft
{
}


Then I would try this if that didn't work.
ucft
{
ANIM
{
}
}


So just name the file what it is expecting and put it in the same folder as the *.zaabin/*zafbin files. Let me know how it goes for you.
Title: Re: swbf-unmunge - v1.0.1
Post by: LitFam on October 15, 2017, 08:55:58 AM
Thank you sleep killer you made me shed a tear :cheers:

Now I don't have to use the evolved mod anymore  :cheer:
Title: Re: swbf-unmunge - v1.0.1
Post by: SleepKiller on October 15, 2017, 06:06:08 PM
Glad to hear it worked. Which one made levelpack play nice? If you tell me I can make the tool automatically produce it for any animation files it finds.
Title: Re: swbf-unmunge - v1.0.1
Post by: LitFam on October 15, 2017, 07:07:33 PM
This one worked for me

[spoiler]ucft
{
}[/spoiler]
Title: Re: swbf-unmunge - v1.0.1
Post by: SleepKiller on October 15, 2017, 07:58:52 PM
Thanks! In the next version of the tool it'll automatically create dummy .anims files.
Title: Re: swbf-unmunge - v1.0.1
Post by: LitFam on October 15, 2017, 08:16:02 PM
Thanks a million it saves people a copy and paste.
Title: Re: swbf-unmunge - v1.0.1
Post by: 411Remnant on October 16, 2017, 05:56:44 PM
 :o Um....well....I guess if that idle animation is being used for personal/private use, no harm no foul. [spoiler]What I mean by that is the animator for those probaly didnt intend for people to get thier hands on them due to it being exclusive to frayedwired studios mod. I know if I was the one who created that, I would be upset. However...[/spoiler]


Contrary that is a very handy way to use this tool and it is pretty neat how many functions it has. I can see someone using this to get those custom animation files for kit fisto and assaj ventress from that official DLC battlefront 2 had for the xbox. It could be cool to see how those files function since they had extra bits of animation.

Someone mentioned the idea of sound un-mugning and while that is also a nifty idea, I think it would just be easier to find that desired sound or better yet, turn down all the audio settings in battlefront except the fx sounds, use a screen recorder that records sound, record the sound, convert the desired sound into a wav format and just munge that into your sound file. Though I do see the voice lines being something that people would have a hard time trying to extract individually using the method I suggested.
Title: Re: swbf-unmunge - v1.0.1
Post by: LitFam on February 07, 2018, 01:45:51 PM
@SleepKiller

I have seemed to have found a bug. Besides the textures UV(s) being flipped when I load a .msh model with corrected flipped textures into the .msh viewer the textures are darker and not there original brightness.

Cheek image in the attachment.
Title: Re: swbf-unmunge - v1.0.1
Post by: Giftheck on February 07, 2018, 01:47:25 PM
Quote from: LitFam on February 07, 2018, 01:45:51 PM
I have seemed to have found a bug. Besides the textures UV(s) being flipped when loaded into .msh viewer the textures are darker.

That's an issue with the model and not the textures. Import the model into Mod Tool then re-export it and the issue will vanish.
Title: Re: swbf-unmunge - v1.0.1
Post by: LitFam on February 07, 2018, 01:48:18 PM
Mod Tool? Do you mean XSI Softimage?
Title: Re: swbf-unmunge - v1.0.1
Post by: Giftheck on February 07, 2018, 01:49:44 PM
Quote from: LitFam on February 07, 2018, 01:48:18 PM
Mod Tool? Do you mean XSI Softimage?

Yeah. The free version is called Softimage Mod Tool 7.5.
Title: Re: swbf-unmunge - v1.0.1
Post by: LitFam on February 07, 2018, 02:25:14 PM
What if I can't import the model in Softimage  :'(

When I try I get a error.
Title: Re: swbf-unmunge - v1.0.1
Post by: SleepKiller on February 07, 2018, 02:38:33 PM
Quote from: Gistech on February 07, 2018, 01:47:25 PM
That's an issue with the model and not the textures. Import the model into Mod Tool then re-export it and the issue will vanish.
Any idea what exactly is at fault here? Material colour? Vertex colours? I'll try to remember to take a look at this sometime soon.
Title: Re: swbf-unmunge - v1.0.1
Post by: Giftheck on February 07, 2018, 02:41:02 PM
Quote from: SleepKiller on February 07, 2018, 02:38:33 PM
Any idea what exactly is at fault here? Material colour? Vertex colours? I'll try to remember to take a look at this sometime soon.

I'm not entirely sure myself. I tried importing a few meshes from an unmunged version of Gogie's Scarif (he gave me permission to do so) and once I imported them, I simply followed the 'normal procedure' for imported objects (such as hiding lowres, collisions and shadowvolumes) and then re-exported, and the models came out as normal.
Title: Re: swbf-unmunge - v1.0.1
Post by: Giftheck on February 09, 2018, 03:21:38 AM
So, AnthonyBF2 is working on a PSP SWBF2 mod. I thought I'd try this on the PSP version, as it is supposed to be very similar to the PS2 build.

It works... sort of. It can't rip everything. But it rips a lot from my test (rep.lvl)
Title: Re: swbf-unmunge - v1.0.1
Post by: Ginev on February 10, 2018, 11:36:41 PM
Gistech are there working textures?
Title: Re: swbf-unmunge - v1.0.1
Post by: Giftheck on February 11, 2018, 04:45:52 AM
Quote from: Ginev on February 10, 2018, 11:36:41 PM
Gistech are there working textures?

No.
Title: Re: swbf-unmunge - v1.1.0
Post by: SleepKiller on February 14, 2018, 01:08:57 AM
There is a new minor release out. It includes fixes that improve the output of extracted models (such as fixing the normals on hardskinned meshes, which I believe was causing the darkening LitFam posted above) and some cool new stuff.

The big highlight for me that I worked on was adding support for Xbox files (both models and textures) and PS2 textures (while also fixing up PS2 model extraction). As a small example attached below is a screenshot one of the DLC heroes extracted from the Xbox DLC files.

I mean the ability to extract the console files is almost completely useless but I had a lot of fun implementing it. See the full changelog and download the new release on GitHub.
Title: Re: swbf-unmunge - v1.1.0
Post by: LitFam on February 14, 2018, 07:44:16 AM
Looking forward to test the new version later today :cheers: if I find any bugs I will report them.
Title: Re: swbf-unmunge - v1.1.0
Post by: 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.
Title: Re: swbf-unmunge - v1.1.0
Post by: AnthonyBF2 on February 15, 2018, 06:16:24 PM
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.

You could copy the wlrd section from the map file and paste it into its own level file, then unmunge it.
Title: Re: swbf-unmunge - v1.1.0
Post by: SleepKiller on February 15, 2018, 08:25:45 PM
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.
Title: Re: swbf-unmunge - v1.1.0
Post by: DylanRocket on February 16, 2018, 04:04:58 PM
Thanks for adding console support! There seems to be a few issues with some of the extracted models however:

(https://i.imgur.com/V7OWoIO.png)

This is from the Xbox DLC Rhen Var Habor map. So far I've only encountered this issue with map models, not unit models.
Title: Re: swbf-unmunge - v1.1.0
Post by: SleepKiller on February 16, 2018, 04:28:28 PM
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.
Title: Re: swbf-unmunge - v1.1.0
Post by: DylanRocket on February 16, 2018, 06:16:11 PM
That partially fixed the issue:

(https://i.imgur.com/f0uoaRf.png)
Title: Re: swbf-unmunge - v1.1.0
Post by: RepComm on February 16, 2018, 09:09:06 PM
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.
Title: Re: swbf-unmunge - v1.1.0
Post by: DylanRocket on February 17, 2018, 09:14:57 AM
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.
Title: Re: swbf-unmunge - v1.1.0
Post by: RepComm on February 17, 2018, 04:39:20 PM
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.
Title: Re: swbf-unmunge - v1.1.0
Post by: SleepKiller on February 18, 2018, 05:08:12 PM
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.
Title: Re: swbf-unmunge - v1.1.0
Post by: Giftheck on February 20, 2018, 12:37:17 AM
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](https://i.imgur.com/4R6kxd7.jpg)[/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)
Title: Re: swbf-unmunge - v1.1.0
Post by: 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.
Title: Re: swbf-unmunge - v1.1.0
Post by: SleepKiller on March 05, 2018, 03:00:53 PM
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.
Title: Re: swbf-unmunge - v1.1.0
Post by: Teancum on March 05, 2018, 04:30:05 PM
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
Title: Re: swbf-unmunge - v1.1.0
Post by: 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.
Title: Re: swbf-unmunge - v1.1.0
Post by: NB20026 on March 08, 2018, 08:04:47 PM
Why I can unmunge files to 150 mb max ?
Title: Re: swbf-unmunge - v1.1.0
Post by: Teancum on March 09, 2018, 08:35:03 AM
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
Title: Re: swbf-unmunge - v1.1.0
Post by: SleepKiller on March 09, 2018, 04:56:13 PM
Quote from: Teancum on March 09, 2018, 08:35:03 AM
Didn't work for me. Maybe I didn't use the switch to specify it was swbf and not swbf_ii
Ah I see, were you able to get it in the end? I can send you over the source files I got from unmunge if you need. Let me know if their are any other maps that aren't working right.

Quote from: RC-1138 on March 08, 2018, 08:04:47 PM
Why I can unmunge files to 150 mb max ?
I don't know. The tool has no internal limit on file size and should work gracefully on munged files that are multiple gigabytes in size.
Title: Re: swbf-unmunge - v1.1.0
Post by: NB20026 on March 09, 2018, 09:51:25 PM
I saw it unmunge but for example when I try BF3 side I see this error maybe textures are too high ?
Title: Re: swbf-unmunge - v1.1.0
Post by: Teancum on March 10, 2018, 12:32:58 AM
Quote from: SleepKiller on March 09, 2018, 04:56:13 PM
Ah I see, were you able to get it in the end? I can send you over the source files I got from unmunge if you need.
Can you go ahead and send the files? Upload here, PM, whatever. I can get it to extract, but in the end it freezes ZeroEdit once the loading bar is full. I have a few maps that do that, but most I can recover with a little renaming and whatnot.

Title: Re: swbf-unmunge - v1.1.1
Post by: SleepKiller on March 10, 2018, 04:18:26 PM
I think I know what was causing the crash. I've posted a new release that should fix it.

Anyway attached here is the extracted jango1 source.
Title: Re: swbf-unmunge - v1.1.1
Post by: RepComm on April 30, 2018, 06:53:00 PM
I have a bit of work to do still, but as far as I'm able to test, this works:
https://github.com/RepComm/NodeUnmungeGUI/releases

This is a windows 64bit release of the Node.js/electron.js implementation of SWBFUnmungeGUI.
I am pretty busy with final prep for going overseas, but I know it works on my laptop.

The readme isn't where it needs to be, but the interface is nearly identical to the Java version (which is now archived on github), and it is pretty straight forward.

Anyone that wants to test can do so, just extract the directory and run NodeUnmungeGUI.exe
I do want to hear feedback, so feel free to PM me here, or contact me on discord RepComm (Jon)#4638
Title: Re: swbf-unmunge - v1.1.1
Post by: Javitolo98 on May 13, 2018, 12:11:39 PM
Hi, I used this tool to extract Bantha55's naboo: siege on Theed,with the objetive of remaster it, but for some reason the terrain textures are messed up, and it delete the water properties, when I munge it the game crash in the loading screen. The first two probles are to know if you can fix that in next releases,for the third problem, Anyone know what could cause the crash?, thanks.
Title: Re: swbf-unmunge - v1.1.1
Post by: SleepKiller on May 15, 2018, 07:04:12 PM
If I remember correctly the texture info is actually fine it's just a visual bug with the way Zero Editor renders it. (Because I don't fully understand the terrain file format.) To fix it try picking a texture, setting the alpha to zero and painting over all the map.

As for the water, it's known that it's documented that the output for terrain is incomplete. The water is the easiest of the things that are incomplete to fix as such if I make another release it'll be low down on my to-do list for it. If you use the original map ingame as a reference painting water in the right places shouldn't be too hard.
Title: Re: swbf-unmunge - v1.1.1
Post by: 411Remnant on May 16, 2018, 10:14:43 PM
I noticed when extracting some models, it will crash if you use some of the extracted ones. I know it's not perfect but does anyone have any tips on how they have fixed this problem?
Title: Re: swbf-unmunge - v1.1.1
Post by: Giftheck on May 17, 2018, 01:42:36 AM
Quote from: 411Remnant on May 16, 2018, 10:14:43 PM
I noticed when extracting some models, it will crash if you use some of the extracted ones. I know it's not perfect but does anyone have any tips on how they have fixed this problem?

I think they have to be imported and re-exported in Softimage Mod Tool.
Title: Re: swbf-unmunge - v1.1.1
Post by: Newmodder on May 19, 2018, 10:31:16 AM
Sorry that i keep bugging after the same queston but any news on audio extraction? :)
Title: Re: swbf-unmunge - v1.1.1
Post by: SleepKiller on May 20, 2018, 07:12:10 PM
Nope, I am not actively working on swbf-unmunge at the moment. If I ever do work on it again you'll see commits on GitHub and if a new release contains new features the minor version will increase. (So instead of it being v1.1.1 it'll go to v1.2.0)
Title: Re: swbf-unmunge - v1.1.1
Post by: flipdark95 on May 30, 2018, 10:12:13 PM
Hey, was just pointed to your tool when I asked about how to extract models from BFII. It looks like a amazing piece of work, but I'm having trouble extracting any of the game's .lvl files with it. It keeps saying the file does not exist.

I'm using the GUI plugin, so I don't know if that impacts things. I've made sure the settings are for BFII and the .lvl file I'm trying to extract as a test is myg1.lvl, which apparently contains all of the assets used for Mygeeto.
Title: Re: swbf-unmunge - v1.1.1
Post by: RepComm on May 31, 2018, 03:01:44 AM
Quote from: flipdark95 on May 30, 2018, 10:12:13 PM
..
I'm having trouble extracting any of the game's .lvl files with it. It keeps saying the file does not exist.

I'm using the GUI plugin, so I don't know if that impacts things. I've made sure the settings are for BFII and the .lvl file I'm trying to extract as a test is myg1.lvl, which apparently contains all of the assets used for Mygeeto.

Hey, I'm the GUI guy, and I got kinda lucky I happened to check the site here so soon. I'm not in range of WiFi because I'm actually in a tiny part of Brazil until January (still setting up things, including WiFi).

I know that if you're using the restarted GUI project that you had very little instruction because I hadn't got to writing it yet (I've never been so busy in my entire life than the past month). I'm sorry you're having issues, and if you could do me a huge favor and screen shot what's going on (error, maybe include the file in an explorer window so we can see exactly where the tool should be looking for this file) it would help me out a bunch! You can attach a screenshot to a reply here.

There are a few things that could be wrong with how file paths are handled on a few systems that I haven't been able to test yet.
I also know I need to build a 32bit version and take out a bunch of unneeded files to pack everything down into smaller download sizes.

You needing help with either tool or GUI helps us fix them, so thank you!
Title: Re: swbf-unmunge - v1.1.1
Post by: flipdark95 on May 31, 2018, 05:16:56 AM
Glad to be help you guys out, even indirectly :)

Okay so here's what I did. I should mention that my install of BFII is on steam, located at A:\Games\Steam\steamapps\common\Star Wars Battlefront II

I installed SWBFUnmunge at A:\Modding\Battlefront 2005\SWBFUnmunge. And I put your GUI plugin in that folder.

This is the filepath inside SWBFUnmunge.
(https://i.imgur.com/gTvV5Ju.png)

This is the .lvl file I'm trying to extract. I'm using it as a test for being able to pull files out of mods so I can use them as references in my Star Wars modelling.
(https://i.imgur.com/QO4SkaJ.png)

This is the command I used to try and extract the files.
(https://i.imgur.com/TfVTjpQ.png)

This is the error log after I try to run the command to extract everything from the .lvl file.
(https://i.imgur.com/ksiAsAJ.png)
Title: Re: swbf-unmunge - v1.1.1
Post by: RepComm on May 31, 2018, 09:46:40 AM
Yep, that's a problem with my GUI (java one, which is older than the new JavaScript one) for sure. Thanks for responding so quickly!

It looks like either the file paths are getting goofed up. My sister's have always liked forward slash / more than backslash.
I think that it's getting escaped correctly because the first letters of each folder/file is still there, otherwise it would look more like A:?odding?attlefront 2005?WBFUnmunge?wbf-unmunge.exe

I'll have to dig into my repo so I can release a fix.

If you're itching to do it while I write up a fix, you can copy that command and replace those ¥ characters with forward slashes, like this:
A:/Modding/Battlefront 2005/SWBFUnmunge/swbf-unmunge.exe -files A:/Games/Steam/steamapps/common/Star Wars Battlefront II/GameData/Data/_lvl_pc/myg/myg1.lvl -version swbfii -imgfmt tga -platform pc -outversion swbfii -verbose

Another thing to check is use account control. It could be denying swbf-unmunge.exe from accessing the file, which is sometimes handled like a 'file not found' exception. If this is the case, try copying myg1.lvl to the desktop or somewhere with less security like downloads and go from there.

Time for me to update my tools since people are actually trying to use them now, lol.
Title: Re: swbf-unmunge - v1.1.1
Post by: SleepKiller on May 31, 2018, 07:29:13 PM
I can't say what's up with the strange characters, but looks like RepComm's tool isn't quoting it's paths.

swbf-unmunge.exe -files A:/Games/Steam/steamapps/common/Star Wars Battlefront II/GameData/Data/_lvl_pc/myg/myg1.lvl

Should be,
swbf-unmunge.exe -files "A:/Games/Steam/steamapps/common/Star Wars Battlefront II/GameData/Data/_lvl_pc/myg/myg1.lvl"

otherwise the path will split after "Star/" due to the space.
Title: Re: swbf-unmunge - v1.1.1
Post by: flipdark95 on June 01, 2018, 12:22:13 AM
Thanks to both of you with the fast replies :D

I've applied quotes to my script but it still seems to be coming up with the same error though.

A:\Modding\Battlefront 2005\SWBFUnmunge\swbf-unmunge.exe -files "A:\Games\Steam\steamapps\common\Star Wars Battlefront II\GameData\Data\_lvl_pc\myg\myg1.lvl" -version swbf -imgfmt tga -platform pc -outversion swbf -verbose

Is this the correct command to use?
Title: Re: swbf-unmunge - v1.1.1
Post by: Led on June 01, 2018, 12:51:39 AM
likely that you mean swbf2
Title: Re: swbf-unmunge - v1.1.1
Post by: RepComm on June 01, 2018, 02:41:04 AM
Ah, good catch SK!
Sleepkiller's tool usage says
Quote from: https://github.com/SleepKiller/swbf-unmunge/blob/master/readme.md-version <version> Set the game version of the input file. Can be 'swbf_ii' or 'swbf. Default is 'swbf_ii'.
-outversion <version> Set the game version the output files will target. Can be 'swbf_ii' or 'swbf. Default is 'swbf_ii'.

The GUI (both new and old) should be handling this correctly. I forgot about the underscore last post here.
Because your lvl is coming from swbf2 (steam), version should be swbf_ii (not something you'll have to worry about normally, just setting the switch in the GUI is fine and it's really wants it's doing anyways).

Final commands should be

A:\Modding\Battlefront 2005\SWBFUnmunge\swbf-unmunge.exe -files "A:\Games\Steam\steamapps\common\Star Wars Battlefront II\GameData\Data\_lvl_pc\myg\myg1.lvl" -version swbf_ii -imgfmt tga -platform pc -outversion swbf_ii -verbose

Or more likely (at least it's what I had to do)

A:/Modding/Battlefront 2005/SWBFUnmunge/swbf-unmunge.exe -files "A:/Games/Steam/steamapps/common/Star Wars Battlefront II/GameData/Data/_lvl_pc/myg/myg1.lvl" -version swbf_ii -imgfmt tga -platform pc -outversion swbf_ii -verbose


My terminal just likes forward slashes I guess.

I have to check first to be correct, but the newest reboot project for my GUI should handle paths just great. The quotes are automatically added because of using Node's path module instead of Java botchery.
It's still no excuse, and I'll patch the old version (if I can, I made that repo read-only. I'll see what I can do).

The only reason I'm not avidly pushing the use of the new java-less version instead of using the buggy old one is because I haven't built 32 bit yet, and I haven't written out the readme/instructions properly. Both of which are priority on my to-do with also patching the older project.
Title: Re: swbf-unmunge - v1.1.1
Post by: flipdark95 on June 01, 2018, 03:05:51 AM
Well, my error message changed to just saying it can't access the file because higher elevation is needed, so that's honestly a step in the right direction. So it seems the path is all good now, it's just I need to move the file or change permissions.

Thanks guys you're both being a absolute help :)
Title: Re: swbf-unmunge - v1.1.1
Post by: SleepKiller on June 02, 2018, 08:10:08 AM
I usually copy the .lvls I want to extract (or rather in my case test extracting) to the same folder as swbf-unmunge. You could give this a go as well, it should help sidestep the file access problems.
Title: Re: swbf-unmunge - v1.1.1
Post by: Giftheck on August 12, 2018, 12:54:40 AM
I've received permission from Rends to unmunge his Coruscant maps so I can alter the vehicle spawns. However, I can't open the outputted files in Zeroedit. It's the SWBF1 version, so I've used the SWBF switches.
Title: Re: swbf-unmunge - v1.1.1
Post by: SleepKiller on August 12, 2018, 05:47:45 AM
This is with v1.1.1 yeah? It did fix a bug that caused extracted .bnd and .prp files to crash Zero Editor on load.
Title: Re: swbf-unmunge - v1.1.1
Post by: Giftheck on August 12, 2018, 05:49:07 AM
Quote from: SleepKiller on August 12, 2018, 05:47:45 AM
This is with v1.1.1 yeah? It did fix a bug that caused extracted .bnd and .prp files to crash Zero Editor on load.

Yes.
Title: Re: swbf-unmunge - v1.1.1
Post by: SleepKiller on August 12, 2018, 06:01:44 AM
Cool, just double checking! I don't have time to chase it down myself right now but I'd suggest starting by trying a process of elimination if you haven't already. Change the extension on all the world files (.pth, .lyr, etc) to have '.ignore' on the end, except the .wld file itself.

Then try loading the world, if it loads remove '.ignore' from one of the other world files and try again. Repeat until you get a crash.

If you get a crash on the first one it means there is either something wrong with an .odf, .msh or the .wld file itself.

If you do some testing be sure to let me know what it turns up.
Title: Re: swbf-unmunge - v1.1.1
Post by: Giftheck on August 12, 2018, 10:14:27 AM
Yeah, it's doing it on the WLD file after I've followed your instructions to make the editor ignore everything else. I wouldn't think it's the MSH/ODF files that are the problem as I've tried both the unmunged ones and the officially-released Rends building/prop assets for the map.
Title: Re: swbf-unmunge - v1.1.1
Post by: SleepKiller on August 12, 2018, 08:03:47 PM
Straight away or does it go through the loading bar a bit? Can you post or PM me the .wld file?
Title: Re: swbf-unmunge - v1.1.1
Post by: Giftheck on August 13, 2018, 02:47:08 AM
Just goes right up to the end of loading then Zeroedit closes itself.

I've sent you the code for the WLD file via PM.
Title: Re: swbf-unmunge - v1.1.1
Post by: Giftheck on August 14, 2018, 11:40:34 PM
I got it to work after deleting the MSH and ODF folders and replacing them with the ones from Rends' official assets release.
Title: Re: swbf-unmunge - v1.1.1
Post by: genadiyrool on March 16, 2019, 10:26:19 AM
hello, everyone
is this umunge program actually working?
every time i try to umunge even the smallest lvl file i get an error:
"Message: Size of supplied memory is less than size of supposed chunk."
does anyone have a solution? or maybe there is another way to edit modded content? thanks
Title: Re: swbf-unmunge - v1.1.1
Post by: Delta-1035 on May 06, 2020, 05:24:17 AM
So there is no way to properly unmunge swbf1 player models? Even adding -version swbf and -outversion swbf seems to not work.
Title: Re: swbf-unmunge - v1.1.1
Post by: BAD_AL on June 18, 2020, 11:36:06 PM
Sleepkiller,
Could you add the ability for the user to specify an additional file for hash lookup?

I just discovered the ToolsFL\bin\Hash.exe program generates the hashes for the given string.
It would be cool to be able to add to the known hashes so that more stuff gets unmunged well.
Title: Re: swbf-unmunge - v1.1.1
Post by: SleepKiller on June 19, 2020, 09:00:05 PM
Maybe! I have ideas for at least one more update to swbf-unmunge. A key one is having a preprocess function that goes through a list of .lvl files and builds a list of hashes from the strings in them for later use during the actual "unmunging". If that next release happens I will for sure look at also including the ability to specify custom hash lists as well.
Title: Re: swbf-unmunge - v1.1.1
Post by: BAD_AL on June 28, 2020, 09:26:39 AM
Quote from: SleepKiller on June 19, 2020, 09:00:05 PM
Maybe! I have ideas for at least one more update to swbf-unmunge. A key one is having a preprocess function that goes through a list of .lvl files and builds a list of hashes from the strings in them for later use during the actual "unmunging". If that next release happens I will for sure look at also including the ability to specify custom hash lists as well.
Looking at the .lvl files, the mission.lvl file is a good string capture target.
But which others?  And of those, which sections?

Title: Re: swbf-unmunge - v1.1.1
Post by: TheJediMan132 on August 07, 2020, 12:52:07 PM
This is an awesome tool man this looks pretty handy. But what I can't figure out is , I made my own like custom side and all and I want to put it in this custom map (just for fun ofc) what is the actual process of remunging these extracted files? Like instead of .lua all the mission .lvl extracts are .scripts. Do we gotta manually go through the files and copy paste the information on our own new built world etc?
Title: Re: swbf-unmunge - v1.1.1
Post by: Giftheck on August 07, 2020, 01:45:23 PM
The unmunge tool doesn't work on scripts, so you would need to rebuild those yourself.
Title: Re: swbf-unmunge - v1.1.1
Post by: AnthonyBF2 on August 08, 2020, 06:58:52 PM
Quote from: TheJediMan132 on August 07, 2020, 12:52:07 PM
This is an awesome tool man this looks pretty handy. But what I can't figure out is , I made my own like custom side and all and I want to put it in this custom map (just for fun ofc) what is the actual process of remunging these extracted files? Like instead of .lua all the mission .lvl extracts are .scripts. Do we gotta manually go through the files and copy paste the information on our own new built world etc?

BAD_AL has a couple of tools he made that converts unmunged script chunk files back into source code but it's not a guarantee it will work. It only works on very simple scripts.
Title: Re: swbf-unmunge - v1.1.1
Post by: Dark_Phantom on August 09, 2020, 08:12:01 AM
I have one for BF1 that works under the same conditions. Only simple scripts.
Title: Re: swbf-unmunge - v1.1.1
Post by: BAD_AL on August 09, 2020, 09:48:27 AM
Quote from: AnthonyBF2 on August 08, 2020, 06:58:52 PM
BAD_AL has a couple of tools he made that converts unmunged script chunk files back into source code but it's not a guarantee it will work. It only works on very simple scripts.
The good news is that it usually works pretty well on the mission files, but the extracted scripts should be examined and possibly modified before you use them.

It has a thread over at gametoast: http://gametoast.com/viewtopic.php?f=64&t=33479
Title: Re: swbf-unmunge - v1.1.1
Post by: AnthonyBF2 on August 10, 2020, 12:06:39 AM
Quote from: BAD_AL on August 09, 2020, 09:48:27 AM
The good news is that it usually works pretty well on the mission files, but the extracted scripts should be examined and possibly modified before you use them.

It has a thread over at gametoast: http://gametoast.com/viewtopic.php?f=64&t=33479

In my experience, it works with most mission scripts. Certain scripts that have more complex bits of code, like Death Star or Tantive don't work.
Title: Re: swbf-unmunge - v1.1.1
Post by: test133337 on April 09, 2021, 11:18:52 AM
hey is there a way to munge the extracted version of the unmunge back together after it was extracted?

for example if you have ingame.lvl and extract it with unmunge, you get 6 folders
config
effects
msh
munged
odf
texture

if i wanted to change a value in a hud-file which is in config and want to put it back together into a ingame.lvl file, how would i do that?



Title: Re: swbf-unmunge - v1.1.1
Post by: AnthonyBF2 on April 09, 2021, 11:35:30 PM
That's not going to work. Many files that are ripped are not re-usable. You'll need to learn how to use BF2 mod tools and compile a new ingame.lvl from scratch, and if you have 1.3 or 1.5 patch, replacing ingame.lvl will break mod support.
EhPortal 1.34 © 2024, WebDev