swbf-unmunge - v1.1.1

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

Previous topic - Next topic
July 06, 2017, 10:20:57 PM Last Edit: March 10, 2018, 04:16:56 PM by SleepKiller
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. (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.
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.

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

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.

July 06, 2017, 11:13:17 PM #1 Last Edit: July 06, 2017, 11:27:28 PM by LitFam
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.


Great progress for modding! And great work!  :tu:
AR Clan Discord: https://discord.gg/gmmSm5e | Star Wars: Battlefront - 20th Anniversary (2004-2024)

Great job :cheers:
Was working on a similar project but it's way not as good as yours

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.
Never let a person named AnthonyBF2 touch your BF2.

why I msh files are inviicible ? :confused:

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.

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. 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.

SleepKiller, you are a beast. I am very interested in looking at your work under the hood.

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.
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

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.

It's possible make it that can extract the scripts from a mission.lvl? when I extract it only extracts a munged folder

July 11, 2017, 05:08:31 AM #12 Last Edit: July 11, 2017, 05:50:05 AM by LitFam
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

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  ;)
"Birth, pain, fear, death; the cycle of existence." -Dread Master Calphayus.

SWBF1 Maps: Tatooine: Mos Anek, Kashyyyk: Village, Naboo: Province, Tatooine: Gulch.

SWBF2 Maps: Space Carida.

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. 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.)