swbf-unmunge Step By Step Basics

Started by RepComm, October 07, 2017, 12:03:16 AM

Previous topic - Next topic
October 07, 2017, 12:03:16 AM Last Edit: March 01, 2018, 10:31:35 PM by RepComm

Hello, lets talk step by step about SleepKiller's SWBF Unmunge commandline tool.

[spoiler=What is all this jargain you speak? I don't follow you're words, human..]
"Munge," or more commonly "compile," is how we refer to the 2004/2005 Battlefront games files,
how we manage the games' content, and transferring assets into their final *.LVL file state.

Our current set of game tools are responsible for taking common asset files such TGA/DDS textures,
MSH 3d scenes, among many others, and compiling/munging them first into built binary files,
and then finally into *.LVL files.

No common tool has existed to go the other way, taking compiled *.LVL game files,
and converting them to our nice, editable content/assets;
Until SleepKiller started his amazing swbf-unmunge commandline tool.

His tool works essentially the same as the mod tools work: batch/bash scripts that run executable tools on the commandline, iterating over directories of assets given a set of instructions to follow in *.req files (which I think stands for 'request', as in "I request these files be compiled for my game, please!".
[/spoiler]

If you need to take game assets and use them ingame, you follow the 'munge'/compile process,
but what if you need compiled *.LVL files back in their original state?

If you're reading this, you probably already know that SleepKiller's fancy new tool exists, and
that it can do the above mentioned process for you (albeit, it's not complete as of 10/6/2017), but
how do we use it?


Lets assume you don't even have the tool yet, what's the first step?
Swbf-unmunge topic is the tools official topic by it's creator,
but we're looking for the tool download itself, which is here, on its GitHub releases page.

The most recent stable version today (10/7/2017) is "v0.6.1", so let's describe that process first.

Simply click the link that our red arrow points to, which downloads a zip containing our tool.
When it's finished downloading, you'll need to extract it to a folder (because there are several files,
and you don't want them all over your desktop, for example).
I'll extract them to my desktop in a new folder "SWBFUnmunge."

Now we'll need an *.LVL file to experiment on, so I'll get load.lvl from my game's directory:
C:/Program Files/LucasArts/Star Wars Battlefront/GameData/Data/_LVL_PC/Load/load.lvl
You can choose whatever file you wish, but I'll assume you're using this one.

Lets copy/paste it to /SWBFUnmunge/ where our tool is, just for fun.

swbf-unmunge.exe is the actual tool, and it works by commands, so let's create our command just to test it out.
There are two generic ways to run the correct command, and the proper usage is described on the tool's front page here.
1. Open command prompt
    (cmd.exe, and depending on the location of LVL files you're using, you might right click it and 'Run As
    Administrator'), and navigate to the folder we extracted swbf-unmunge:
        I'll type cd C:/Users/Jon/Desktop/SWBFUnmunge/
        Next, we'll type swbf-unmunge
        If this works, it should output the correct usage, as displayed:
       
        If not, you should see an error about the command not existing,
        meaning you're 'cd'ed in the wrong directory.
    If all went well, type swbf-unmunge -file load.lvl -version swbf -outversion swbf -imgfmt png
    After the command runs, you should see the files populate in a new folder "/load/" in the same directory as in
    input file we used "load.lvl", we asked the tool to export PNG files, so you should be able to see the textures
    of load.lvl inside the newly created folder, along with any other assets. Pretty cool!

2. If you're cool like me, you can type 'cmd' into the address bar of the file explorer, if you're currently in
    /SWBFUnmunge/, where we extracted swbf-unmunge.exe and it's files.
    This will open a new command window, already 'cd'ed to the directory of your file explorer.
    type swbf-unmunge -file load.lvl -version swbf -outversion swbf -imgfmt png
    Viola.

*Editing more in future with more explanations, and how to use all the options, and (optionally) my GUI*


Much appreciated, RepComm  :tu:
In Progress:
--Star Wars: Battlefront - Anniversary Edition (formerly Star Wars: Battlefront - Legacy Edition)

On Hold:
--Star Wars Battlefront: Elite Squadron For SWBF1
--Endor: Imperial Base

August 08, 2019, 10:35:09 AM #2 Last Edit: August 08, 2019, 10:37:09 AM by Led
Quote from: RepComm on October 07, 2017, 12:03:16 AM

Hello, lets talk step by step about SleepKiller's SWBF Unmunge commandline tool.


edit by Led--no need to quote all of that.


Hello
please help me...
my .lvl file does not exist. What may be happened?


Thank you

I assumed someone else would have done this by now but I guess not, so I will.

1) make a batch file, and put this code in it:
Quoteswbf-unmunge.exe -file shell.lvl -version swbf_ii -outversion swbf_ii -imgfmt tga -platform pc -verbose -mode extract

2) put the batch file alongside swbf-unmunge.exe and the LVL file you want to rip

3) double click the batch file to rip the file

4) right-click the batch file, select "edit" to change the parameters to edit different files, platform type, or game type

I've found this to be much easier than any of the other methods people have posted.
Never let a person named AnthonyBF2 touch your BF2.


YESYESYESYESYESYESYESYESYES!!!!!!!! IV BEEN LOOKING FOR THIS FOR SO LONG

Quote from: ivocaprison on September 22, 2022, 09:31:55 AMYESYESYESYESYESYESYESYESYES!!!!!!!! IV BEEN LOOKING FOR THIS FOR SO LONG

Please do not bump topics.
In Progress:
--Star Wars: Battlefront - Anniversary Edition (formerly Star Wars: Battlefront - Legacy Edition)

On Hold:
--Star Wars Battlefront: Elite Squadron For SWBF1
--Endor: Imperial Base