Jump to content

Home

Info on *.LVL files


Riley75

Recommended Posts

LVL files definitely don't have to remain the exact size that they currently are. It would be possible, for example, to swap in a new texture that's bigger or smaller. The file would just have to be reconstructed, and the file size marker would have to be changed.

 

Have you successfully enlarged mission.lvl by 1 or more bytes?

 

Your .dds findings were the basics needed to make the Bviewer come together for Nimlot. I'm pondering a model and mission file editor being formed into this eventually...

Link to comment
Share on other sites

Have you successfully enlarged mission.lvl by 1 or more bytes?

 

Not the mission.lvl file, no. I haven't been working on that file, to be honest. All my deciphering so far has been on the map files, Load files, and FPM files.

 

I'm looking at it now, and there is one thing about it that is puzzling:

mission-lvl.gif

 

There's an "lvl_" chunk, set to size 0x1770 (6000 bytes). I'm guessing that "lvl_" just means "embedded *.lvl file". Sort of a look-inside-me-for-the-actual-chunk.

 

Immediately following that is what looks like a chunk marker - the "k½†". But it's a different 4-byte code after every "lvl_" chunk. Directly inside that is the "scr_" section.

 

In order to know how to add in new missions into the game, I think we'd have to figure out what those funny chunk markers are all about. Are they just arbitrary? Do they act as a reference to something else? Perhaps a hash-map key to something? I've tried reading them as integers and floating-point values -- neither seems to come out with any kind of meaningful pattern.

 

any idea which of those chunks have the bumpmapping data?

 

Individual textures (in the "tex_" chunks) can store bump-maps. The *.dds file format supports all kinds of different surface textures, from standard RGB-based pixel data to bump-maps to cubic-environment-maps. I'm not sure how widely used bump-maps are in Battlefront.

 

Available texture formats in *.dds files

Scroll down to where it says "Signed Formats".

Link to comment
Share on other sites

I'm currently revising my code and actually added support for the MIP maps (it was only throwing out the chunk, now it exports in correct DDS MIP structure). But, I am stumped on a second file format, which most skins seem to have a second face. The format in Hex is 17 00 00 00, and I am having a hard time finding any info for this. I was thinking it would be the bump map for the skin, but it doesnt make sense why it wouldnt be in the same DXT1 or DXT3 format. Anyone have any ideas, Riley? :)

Link to comment
Share on other sites

A day or so ago I updated the tex_ chunk page on my site with a complete description of how to properly extract textures: http://personal.riley-man.com/swbf/editing/swbf-lvl-tex.html

Just scroll down. :)

 

For the textures that have multiple pixel formats (ie. more than one FMT_ section), you'll have to extract each into its own *.dds file.

 

The link in my previous post ("Available texture formats in *.dds files") lists all the pixel formats. ;) The 17 00 00 00 is equivalent to decimal 23, which means it's in 16-bit R5-G6-B5 format.

 

My guess is that they often have multiple pixel formats for compatibility with all video cards. Some video cards might not have built-in support for decompressing the DXT# pixel format on the fly. So the game code would only load the pixel format it needs (probably preferring DXT, since it's compressed and can thus load more of them into the video card's memory).

Link to comment
Share on other sites

Just posting some updates...

 

Information on the storage structure of several additional chunk types has been added to my site. Also, on the gametoast.com forums, there has been a fair bit of progress made on how Scripts (using the Lua programming language) are used by Battlefront.

 

Keep looking in those two places for the most recent discoveries. And if anyone has anything else to add, we are, of course, always looking forward to any new editing information you might be aware of!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...