Extracting munged from LVL files?

Post everything from general questions, to modding questions, to map WIPs to releases. (SWBF1 only)

Moderator: Moderators

Post Reply
User avatar
giftheck
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2218
Joined: Mon Jan 19, 2009 5:58 pm
Projects :: Star Wars Battlefront Anniversary

Extracting munged from LVL files?

Post by giftheck »

Is there a way to extract munged files from the LVL files? I want to see if I can do it so I can rebuild core.lvl (I noticed BattleBelk had munged scripts for his "Interface Tool", and I noticed none of these scripts shipped with BFBuilder).

I DO NOT need the raw files (.wav, .tga etc), but the munged files (ie .texture, .font etc)
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: Extracting munged from LVL files?

Post by Teancum »

Just the extractor on SWBFfiles.
User avatar
giftheck
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2218
Joined: Mon Jan 19, 2009 5:58 pm
Projects :: Star Wars Battlefront Anniversary

Re: Extracting munged from LVL files?

Post by giftheck »

It doesn't extract fonts (although it recognises they're there).

Is there a fontmunge tool available?
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: Extracting munged from LVL files?

Post by Teancum »

If there is it'd be in /BF[1 or 2]_tools/Tools/Bin
User avatar
giftheck
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2218
Joined: Mon Jan 19, 2009 5:58 pm
Projects :: Star Wars Battlefront Anniversary

Re: Extracting munged from LVL files?

Post by giftheck »

That's just it, I don't believe there was. I thought about seeing if I could use the BF2 FontMunge, but I don't think it will work. Also, the fonts were not shipped with BF1. Shame the extractor was never finished.

EDIT: Is it possible to do a shell recompile?
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: Extracting munged from LVL files?

Post by Teancum »

Nope. Shell, Core and Ingame edits would be hackjobs at best.
BattleBelk
Private First Class
Posts: 77
Joined: Thu Jun 28, 2007 7:08 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Russia
Contact:

Re: Extracting munged from LVL files?

Post by BattleBelk »

here is specification for lvl file format:
http://personal.riley-man.com/swbf/edit ... ormat.html

munged chunks can be extracted manually by hexedit but its a lot of work so I made scirpts for 010 Editor and extarcted all chunks

I alredy have all chunks for core.lvl
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: Extracting munged from LVL files?

Post by Teancum »

NICE! Now that is possible. More work, sure, but possible.

The 'short end' is this:
1-Make a mod map, localize EVERYTHING you need to localize for the whole game (I'd recommend just copying over SWBF2's localizations and starting there)
2-Copy the chunks out of the core.lvl into the main core.lvl

Yeah, sounds easy, but I realize it's not. I'm just saying it's possible now. No need to rebuild all the extra crap.

This leads me to a question on the LVL format though -- Are the files stored on a chunk-by-chunk basis, or is there a master table with file sizes and offsets in at the beginning of the LVL file (the site didn't go into that much). If it's just one chunk right after another then that makes life incredibly easy. I don't know how I forgot about this site. Looking at it now makes so much more sense then it did 2 years ago, and will help a lot with the Xbox mod.

*EDIT*

Looks like we can manage hex replacement, but do we need to change the overall filesize in the header? Xentax thinks we do:

http://wiki.xentax.com/index.php?title= ... ront_LVL_1
BattleBelk
Private First Class
Posts: 77
Joined: Thu Jun 28, 2007 7:08 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Russia
Contact:

Re: Extracting munged from LVL files?

Post by BattleBelk »

It's chunk-by-chunk basis and chunk table in a .req file

lvl file can have sub-lvl chunks or just sub-chunks, for example textures for fonts wrapped in .font chunk

some munged files also generates after munge own req file wich means they requests other chunks and those chunks will be placed before

duplicate chunks will be ingnored

some chunks has hash instead normal text string (BF2_ModTools\ToolsFL\bin\hash.exe)
BattleBelk
Private First Class
Posts: 77
Joined: Thu Jun 28, 2007 7:08 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Russia
Contact:

Re: Extracting munged from LVL files?

Post by BattleBelk »

Teancum wrote: Looks like we can manage hex replacement, but do we need to change the overall filesize in the header? Xentax thinks we do:

http://wiki.xentax.com/index.php?title= ... ront_LVL_1
LevelPack.exe from mod tool can do it for us just need set correct req file and cmd bat file for munge chunks in lvl file
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: Extracting munged from LVL files?

Post by Teancum »

So let me make sure I understand correctly:

1-We extract the chunks we need
2-We modify req files in /_MUNGED to point to the chunks we've placed there
3-We use LevelPack.exe in a correctly configured .bat file to munge the chunks back into a proper lvl file.
BattleBelk
Private First Class
Posts: 77
Joined: Thu Jun 28, 2007 7:08 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Russia
Contact:

Re: Extracting munged from LVL files?

Post by BattleBelk »

yes

sometimes even not need extract original munged chunks as they was before lvl pack, possible cut blocks between needed chunks and set req file like this:
Hidden/Spoiler:
[code]ucft
{
REQN
{
"block"
"raw1"
}

REQN
{
"texture"
"my_custom_texture_1"
}

REQN
{
"block"
"raw2"
}

REQN
{
"texture"
"my_custom_texture_2"
}

REQN
{
"block"
"raw3"
}
}[/code]
In this req I have files:
raw1.block, raw2.block, raw3.block - raw data blocks between my munged textures.

and for all extracted chunks/blocks need add 8 byte header
4 byte - ucfb
4 byte - integer (size) of following bytes
User avatar
giftheck
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2218
Joined: Mon Jan 19, 2009 5:58 pm
Projects :: Star Wars Battlefront Anniversary

Re: Extracting munged from LVL files?

Post by giftheck »

So, it is actually possible to build a new core.lvl for BF1? Cool, I wish I knew how to extract these chunks correctly and build the .reqs for them.
Post Reply