swbf-unmunge - v1.1.1

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

Previous topic - Next topic
July 16, 2017, 09:28:24 AM #15 Last Edit: July 16, 2017, 10:02:15 AM by LitFam
I am using the SWB2 (evolved mod rep.lvl)

Update I just tested your latest version it still crashes.

July 16, 2017, 07:31:05 PM #16 Last Edit: July 16, 2017, 08:05:25 PM by 411Remnant
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.
Battfront Stuff if your interested.
http://www.youtube.com/user/411Remnant

July 17, 2017, 03:57:18 AM #17 Last Edit: July 17, 2017, 04:03:16 AM by LitFam
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)



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:
"When will you fools learn? No one escapes Commander Fox"
—Fox, after apprehending another criminal

https://media.giphy.com/media/2GjgvS5vA6y08/giphy.gif

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?

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.

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

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.

Yeah, it's still doing it :(

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

https://mega.nz/#!VYgQHD6Z!YlkNOTPM4RiYQyDMwQ0nFZRchuzrL9E0lHlUX976tK0
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

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.

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
Quote from: Abraham Lincoln. on November 04, 1971, 12:34:40 PM
Don't believe everything you read on the internet

I get an error:

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

As you can see



I tried with a different lvl file too, but the result it's the same.

do a "dir" command and lets see what files are in your current directory please
Quote from: Abraham Lincoln. on November 04, 1971, 12:34:40 PM
Don't believe everything you read on the internet

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.

July 18, 2017, 09:53:48 PM #29 Last Edit: July 18, 2017, 10:01:17 PM by RepComm
Hi guys, I've started a GUI in java for this. Its basic, but its there.

https://github.com/RepComm/SWBFUnmungeGUI

Video:

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.