Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

Star Wars: Battlefront II - *.lvl (ucbf identifier)

Featured Replies

  • Author
  • Localization

AlphaTwentyThree, posted Tue Dec 01, 2015 10:17 am (10228)


Can somebody help me to unpack these files? I know that some of them are encrypted but the ones containing sound files are not. Here are samples: http://www28.zippyshare.com/v/bLD0pitU/file.html.
Header creation not needed, I'll add that myself. I only have a problem with the offsets/sizes.
Thanks for your help!
  • Author
  • Localization

Acewell, posted Wed Dec 02, 2015 7:31 pm (10258)


This is what riley-man's analysis of SWBF lvl files says, it might be the same for SWBFII but i don't know, you might be able to write a bms script from this
Code:
Basic Algorithm - Iterate Through Chunks
This section explains how to iterate through all the chunks in any *.lvl file. 
This can be used to find all the chunks in a file, or all the chunks of a particular type.

The first eight bytes of a chunk is the "chunk header".  Everything that follows is the "chunk data". 
The following table illustrates how the chunk header is organized.

Data Type    Size (bytes)    Description
int          4               Chunk marker, as a 32-bit integer.  This could also be read as a char[4], for languages that do not use zero-terminated strings.
int          4               32-bit integer specifying the number of bytes to follow. Note that if this is not a multiple of 4,
                             there will be extra zero bytes of padding so that the next chunk begins at a 4-byte boundary.


The following functions are general purpose, and can be used when reading in chunks.

/* Returns the actual number of bytes that will follow the 8-byte chunk header (including the padded zero bytes, if any) */
int getTrueChunkSize(int sizeAsRead) {
    int remainder, result;
    result = sizeAsRead;
    remainder = ( sizeAsRead % 4 );
    if ( remainder != 0 ) {
       result -= ( 4 - remainder );
    }
    return( result );
}

The following algorithm will read in all chunks in a given file.  Generic function "readInt" is not necessarily an actual function. 
For C/C , you can use the fread function in stdio.h, for example. 
Similarly, seekInFile() is not necessarily an actual function (its C/C equivalent would be fseek). 
This algorithm assumes you have opened a random-access binary file.

int fileMarker, fileSize;
int chunkMarker, chunkSize;
int curFilePosition;
int bytesReadSoFar;

fileMarker = readInt();
fileSize = readInt();

bytesReadSoFar = 0;
curFilePosition = 8;
while ( bytesReadSoFar < fileSize ) {
    seekInFile(curFilePosition);
    chunkMarker = readInt();
    chunkSize = readInt();
    ... Read / Process this chunk according to chunkMarker ...
    curFilePosition = getTrueChunkSize(chunkSize) 8;
    bytesReadSoFar = getTrueChunkSize(chunkSize) 8;
}


  • Author
  • Localization

AlphaTwentyThree, posted Wed Dec 02, 2015 9:18 pm (10261)


Actually... I have no idea what to do with this, sorry. ;)
  • Author
  • Localization

Acewell, posted Wed Dec 02, 2015 9:47 pm (10263)


kidding or no? surely someone that has written as many bms scripts as you can make sense of it. :?
  • Author
  • Localization

Teancum, posted Wed Dec 02, 2015 11:36 pm (10268)


Battlefront's lvl files are compiled assets that don't do much good after compilation. The lvl format isn't really a traditional container. Is there something specific you're looking for? I previously extracted the entire sound bank into separate .wav formats, but that's something different entirely. Everything in the lvl files can be obtained in a usable format in the game's mod tools. If you need the sounds, sift through the following thread at Gametoast.com

http://www.gametoast.com/viewtopic.php?f=64&t=28297
  • Author
  • Localization

AlphaTwentyThree, posted Thu Dec 03, 2015 7:20 am (10272)


I'm after the music but I want to split the files first. I know that lvl files are compiled bun in the case of the sound files there's a file table at the beginning or at least so it seems, so the sounds should all be exctractable nicely!
I sifted through the thread and actually all they do is import the file and split it by hand. That is a possibility but you'll get plain PCM for the split parts. I want to do a streamed music rip so I'll need the split streams.
To be honest, I thought that the file table would be something to work with to write a QuickBMS script. Maybe I'm wrong? :\
@Acewell: not kidding. :\ I'm not good at programming other than QuickBMS I'm afraid. Let's hope for somebody to write something or give some other hints. :)
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.