LFD File editing

Want to edit the game, build your own craft and missions? Here you'll find help, tools, guides and people to discuss with.

LFD File editing

User avatar
Ace Antilles
Admiral (Moderator)
Posts: 7829
Joined: Sat Jan 22, 2000 12:01 am
Contact:

Post by Ace Antilles » Sun Jun 07, 2020 12:06 am

What editing programs still work to extract files from the LFD document format?
Stuff that's used in classic X-wing and TIE Fighter games.

I found LfdReader online but can't see anyway to make it work.
https://github.com/MikeG621/LfdReader
Chief XWAU Team annoying nitpicker.
Ace Antilles - The X-Wing Outpost
Image

User avatar
JaggedFel
Galactic Empire
Posts: 433
Joined: Wed Sep 06, 2006 11:01 pm
Contact:

Post by JaggedFel » Sun Jun 07, 2020 10:14 am

What in particular are you trying to extract? LFR is simply a library that I incorporate into other programs. There's a lot of different things that can go into an LFD file, so I don't have a master "down them all" program to extract/swap resources.
Ye Olde Galactic Empire Mission Editor v1.15.6
Current software WIPs: TIE Layout and Cutscene Editor, TIE/XvT Cockpit Editor
Libraries / Format specs: *.tie, *.plt, *.tfr, *.lfd , *.act, *.dat image files, *.fnt

User avatar
Ace Antilles
Admiral (Moderator)
Posts: 7829
Joined: Sat Jan 22, 2000 12:01 am
Contact:

Post by Ace Antilles » Sun Jun 07, 2020 11:45 am

JaggedFel wrote:
Sun Jun 07, 2020 10:14 am
What in particular are you trying to extract? LFR is simply a library that I incorporate into other programs. There's a lot of different things that can go into an LFD file, so I don't have a master "down them all" program to extract/swap resources.
Well I want to see what resource files can be seen and I suppose be nosey lol
I want to see if any of the old game images can be extracted. For example combat chamber pictures, voices, uniforms, backdrops, who knows.

I remember for example there used to be ways to edit cockpits in the old games and planets?
Scumm Revisited doesn't seem to go it so I wonder if there are any programs out there that do.
Chief XWAU Team annoying nitpicker.
Ace Antilles - The X-Wing Outpost
Image

User avatar
JaggedFel
Galactic Empire
Posts: 433
Joined: Wed Sep 06, 2006 11:01 pm
Contact:

Post by JaggedFel » Sun Jun 07, 2020 7:51 pm

Plenty of the old stuff can be pulled.

Combat chamber cutscene/layouts are done with normal images that can be pulled, voices are wrapped WAV files, uniforms should also be normal images, backdrops are ACT files, which originally were in the LFDs but for the later releases were done as separate files...

So, the list of what I've got. Some of these were designed for the original games, not current GOG/Steam builds, and relied on auto-detection so they can't work these days without some rewrites. I've also got a couple CLI tools I wrote just to help open things up, extract the binary and reverse engineer everything.

Fonts:
LucasartsFntEditor - for the separate FNT (font) files, located in the main directory. This is for all platforms, X-wing through XWA.
LfdFontReader - should give itself away, those fonts are in EMPIRE.LFD, INSTALL.LFD and TITLE.LFD

Images:
LfdImageReader - I used as a tool for extracting and testing. Haven't updated it years, needs an overhaul and it's not posted to git. Probably should. Can extract LFD:DELT images and single frames from LFD:ANIM animations, but I didn't add editing capability
PaletteReader - Another one I should probably upload to git, this one's real useful (and works!) because it shows the color indexes used by the images stored in the LFD:PLTT resource, this gives you indexes and RGB values. Depending on where the image is used, it may require multiple palettes to get the full color definition.
TieLayoutEditor - Something I started, but never finished. Displays the layouts like the concourse and cutscenes defined by the LFD:FILM resource, shows where images are, which animations are used, lists the audio cues, lists the PLTTs, etc. In its current state, doesn't do much more than display, although you can poke a couple of the top-level FILM settings. Decent candidate to post to git, at least so it's not lost. The idea was make this a one-stop to do overhauls and conversions.
XwingActEditor - Read/write backdrops
TieCockpitEditor - like the Layout Editor, but for cockpits and much more complete as a reader, can view the LFD:PANL resource.

Other:
TIE File Reader - Specifically made to update certain text strings in STRINGS.DAT and a couple LFDs (LFD:TEXT resource), mostly related to ship modding. Needs overhaul.
TieSoundEditor - Read/write the WAV files, which are LFD:VOIC (voice) and LFD:BLAS (blast? ie, sound effects) resources.
YOGEME also has the ability to update the image and text used in the Battle selection concourse.
Ye Olde Galactic Empire Mission Editor v1.15.6
Current software WIPs: TIE Layout and Cutscene Editor, TIE/XvT Cockpit Editor
Libraries / Format specs: *.tie, *.plt, *.tfr, *.lfd , *.act, *.dat image files, *.fnt

User avatar
Ace Antilles
Admiral (Moderator)
Posts: 7829
Joined: Sat Jan 22, 2000 12:01 am
Contact:

Post by Ace Antilles » Sun Jun 07, 2020 8:57 pm

JaggedFel wrote:
Sun Jun 07, 2020 7:51 pm
Plenty of the old stuff can be pulled.
Combat chamber cutscene/layouts are done with normal images that can be pulled, voices are wrapped WAV files, uniforms should also be normal images, backdrops are ACT files, which originally were in the LFDs but for the later releases were done as separate files...
Yeah it's images I would like to look at for example. I don't want to edit the old game, just extract.
TieLayoutEditor sounds cool.

These are all cool programs but unless I am totally thick, and please treat me like I am, I have no idea how to make them work!

Everything is a .CS file and I have no idea what to do with them. I don't have any associated programs.
I'm used to nice simple programs you click on an EXE.
Help me Jagged Fel. You're my only hope. ;)
Chief XWAU Team annoying nitpicker.
Ace Antilles - The X-Wing Outpost
Image

User avatar
JaggedFel
Galactic Empire
Posts: 433
Joined: Wed Sep 06, 2006 11:01 pm
Contact:

Post by JaggedFel » Sun Jun 07, 2020 11:07 pm

Well, apparently I never attached the zip file for the Act or Cockpit editors. Oops. They're there now. Go to the Release tab to grab the zip file, make sure each program lives in its own folder; they've been built at different times with different versions of the DLLs so I can't guarantee everything will work if you dump it all into one spot.

I'll work on cleaning up the other three so they can be posted with clean builds.
Ye Olde Galactic Empire Mission Editor v1.15.6
Current software WIPs: TIE Layout and Cutscene Editor, TIE/XvT Cockpit Editor
Libraries / Format specs: *.tie, *.plt, *.tfr, *.lfd , *.act, *.dat image files, *.fnt

User avatar
Ace Antilles
Admiral (Moderator)
Posts: 7829
Joined: Sat Jan 22, 2000 12:01 am
Contact:

Post by Ace Antilles » Sun Jun 07, 2020 11:18 pm

JaggedFel wrote:
Sun Jun 07, 2020 11:07 pm
Well, apparently I never attached the zip file for the Act or Cockpit editors. Oops. They're there now. Go to the Release tab to grab the zip file, make sure each program lives in its own folder; they've been built at different times with different versions of the DLLs so I can't guarantee everything will work if you dump it all into one spot.

I'll work on cleaning up the other three so they can be posted with clean builds.
SNIP all my previous comments.
AHA a break through now I am beginning to see. Sorry I'm not used to this GitHub. I had not even seen the release Tab.
Thanks for your patience. I look forward to seeing the other programs working :)
Chief XWAU Team annoying nitpicker.
Ace Antilles - The X-Wing Outpost
Image

Michal
Cadet 1st Class
Posts: 184
Joined: Sun May 05, 2002 11:01 pm
Contact:

Post by Michal » Mon Jun 08, 2020 6:43 pm

I would be interested in Lfd Reader release as well.
My current project X-Wing Game Series Twitter
My old project X-Wing Series Site, still online

User avatar
JaggedFel
Galactic Empire
Posts: 433
Joined: Wed Sep 06, 2006 11:01 pm
Contact:

Post by JaggedFel » Fri Jun 12, 2020 5:20 pm

Posted PaletteReader, took a bit more rewriting than I thought to get that current. Will work on LIR next since that's the one you really want, I know that's going to take some work.
Ye Olde Galactic Empire Mission Editor v1.15.6
Current software WIPs: TIE Layout and Cutscene Editor, TIE/XvT Cockpit Editor
Libraries / Format specs: *.tie, *.plt, *.tfr, *.lfd , *.act, *.dat image files, *.fnt

User avatar
Ace Antilles
Admiral (Moderator)
Posts: 7829
Joined: Sat Jan 22, 2000 12:01 am
Contact:

Post by Ace Antilles » Fri Jun 12, 2020 5:31 pm

JaggedFel wrote:
Fri Jun 12, 2020 5:20 pm
Posted PaletteReader, took a bit more rewriting than I thought to get that current. Will work on LIR next since that's the one you really want, I know that's going to take some work.
Thanks a lot. Appreciate the effort :)
I also find it interesting looking into this stuff even if it's outdated lol

Same way as Michals Twitter page has classic things on it
Chief XWAU Team annoying nitpicker.
Ace Antilles - The X-Wing Outpost
Image

Michal
Cadet 1st Class
Posts: 184
Joined: Sun May 05, 2002 11:01 pm
Contact:

Post by Michal » Fri Jun 12, 2020 7:34 pm

JaggedFel wrote:
Fri Jun 12, 2020 5:20 pm
Posted PaletteReader, took a bit more rewriting than I thought to get that current. Will work on LIR next since that's the one you really want, I know that's going to take some work.
Cool! Thank you.
Looking forward to LFD reader!
My current project X-Wing Game Series Twitter
My old project X-Wing Series Site, still online

User avatar
JaggedFel
Galactic Empire
Posts: 433
Joined: Wed Sep 06, 2006 11:01 pm
Contact:

Post by JaggedFel » Sat Jun 13, 2020 1:37 pm

Okay, LFD Image Reader is now up. I mention it in the readme, but there are going to be some images where the colors are obviously wrong. That's due to how TIE layers palettes on top of each other and this was originally written before I knew how to do the layouts. So no matter the assumptions I make with how I handle the palettes there were always going to be some that look weird.
Ye Olde Galactic Empire Mission Editor v1.15.6
Current software WIPs: TIE Layout and Cutscene Editor, TIE/XvT Cockpit Editor
Libraries / Format specs: *.tie, *.plt, *.tfr, *.lfd , *.act, *.dat image files, *.fnt

User avatar
JaggedFel
Galactic Empire
Posts: 433
Joined: Wed Sep 06, 2006 11:01 pm
Contact:

Post by JaggedFel » Thu Jun 18, 2020 3:01 pm

So I've uploaded Tie Layout Editor, it puts together the scenes, but you can see how some things were done. CITY split the background into two halves, the various AWARDS are half-images that are mirrored, etc. Very rough, nowhere near complete (there's a whole missing form that will show the events and run the timers, etc).
Ye Olde Galactic Empire Mission Editor v1.15.6
Current software WIPs: TIE Layout and Cutscene Editor, TIE/XvT Cockpit Editor
Libraries / Format specs: *.tie, *.plt, *.tfr, *.lfd , *.act, *.dat image files, *.fnt

User avatar
Ace Antilles
Admiral (Moderator)
Posts: 7829
Joined: Sat Jan 22, 2000 12:01 am
Contact:

Post by Ace Antilles » Thu Jun 18, 2020 5:01 pm

JaggedFel wrote:
Sat Jun 13, 2020 1:37 pm
Okay, LFD Image Reader is now up. I mention it in the readme, but there are going to be some images where the colors are obviously wrong. That's due to how TIE layers palettes on top of each other and this was originally written before I knew how to do the layouts. So no matter the assumptions I make with how I handle the palettes there were always going to be some that look weird.
Hi. I tried that out recently but I kept getting a crash?
I forgot to post. I'm away right now but I'll check it out again soon and post the error.
Thanks for your efforts :)
Chief XWAU Team annoying nitpicker.
Ace Antilles - The X-Wing Outpost
Image

Michal
Cadet 1st Class
Posts: 184
Joined: Sun May 05, 2002 11:01 pm
Contact:

Post by Michal » Thu Jun 18, 2020 6:09 pm

Cool, thank you. I will check both new programs out!
My current project X-Wing Game Series Twitter
My old project X-Wing Series Site, still online

User avatar
Ace Antilles
Admiral (Moderator)
Posts: 7829
Joined: Sat Jan 22, 2000 12:01 am
Contact:

Post by Ace Antilles » Thu Jun 18, 2020 7:42 pm

JaggedFel wrote:
Sat Jun 13, 2020 1:37 pm
Okay, LFD Image Reader is now up. I mention it in the readme, but there are going to be some images where the colors are obviously wrong. That's due to how TIE layers palettes on top of each other and this was originally written before I knew how to do the layouts. So no matter the assumptions I make with how I handle the palettes there were always going to be some that look weird.
Hi. Everytime I open a LFD I get a crash. The program starts ok but it's only when I click to open an LFD.
I'm trying to use it on the Steam version. Does it only work on the original CD version maybe?
Here's a pic if you want more info let me know but I hope it makes sense :)
LFD.PNG
You do not have the required permissions to view the files attached to this post.
Chief XWAU Team annoying nitpicker.
Ace Antilles - The X-Wing Outpost
Image

User avatar
JaggedFel
Galactic Empire
Posts: 433
Joined: Wed Sep 06, 2006 11:01 pm
Contact:

Post by JaggedFel » Thu Jun 18, 2020 8:49 pm

It definitely works with Steam, that's the one it finds on my computer (I've also got original copies). Is the directory shown correct with where your Steam install is? That error either means it doesn't really exist, or there's weird permissions issues.
Ye Olde Galactic Empire Mission Editor v1.15.6
Current software WIPs: TIE Layout and Cutscene Editor, TIE/XvT Cockpit Editor
Libraries / Format specs: *.tie, *.plt, *.tfr, *.lfd , *.act, *.dat image files, *.fnt

User avatar
Ace Antilles
Admiral (Moderator)
Posts: 7829
Joined: Sat Jan 22, 2000 12:01 am
Contact:

Post by Ace Antilles » Thu Jun 18, 2020 9:11 pm

JaggedFel wrote:
Thu Jun 18, 2020 8:49 pm
It definitely works with Steam, that's the one it finds on my computer (I've also got original copies). Is the directory shown correct with where your Steam install is? That error either means it doesn't really exist, or there's weird permissions issues.
Yeah that's my Steam install but it's not the C drive, regular default.
Maybe I'll move it there and see if it makes a difference. Thanks :)
Chief XWAU Team annoying nitpicker.
Ace Antilles - The X-Wing Outpost
Image

User avatar
JaggedFel
Galactic Empire
Posts: 433
Joined: Wed Sep 06, 2006 11:01 pm
Contact:

Post by JaggedFel » Thu Jun 18, 2020 11:53 pm

Shouldn't, my Steam is on E drive. Can you just open the LFD with notepad or something? It'll be gibberish, but I want to make sure it's not permissions-based.
Ye Olde Galactic Empire Mission Editor v1.15.6
Current software WIPs: TIE Layout and Cutscene Editor, TIE/XvT Cockpit Editor
Libraries / Format specs: *.tie, *.plt, *.tfr, *.lfd , *.act, *.dat image files, *.fnt

User avatar
Ace Antilles
Admiral (Moderator)
Posts: 7829
Joined: Sat Jan 22, 2000 12:01 am
Contact:

Post by Ace Antilles » Thu Jun 18, 2020 11:56 pm

JaggedFel wrote:
Thu Jun 18, 2020 11:53 pm
Shouldn't, my Steam is on E drive. Can you just open the LFD with notepad or something? It'll be gibberish, but I want to make sure it's not permissions-based.
I can open it with Notepad with no extra need to ask permission etc.
It seems to be a .Net issue maybe? Here's a longer code from the crash

Code: Select all

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.IO.DirectoryNotFoundException: Could not find a part of the path 'D:\Games\Steam EXTRA\steamapps\common\STAR WARS Tie Fighter\remastered\RESOURCE\EMPIRE.LFD'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at Idmr.LfdReader.LfdFile..ctor(String filePath)
   at Idmr.LfdImageReader.MainForm.opnFile_FileOk(Object sender, CancelEventArgs e)
   at System.Windows.Forms.FileDialog.OnFileOk(CancelEventArgs e)
   at System.Windows.Forms.FileDialog.HandleVistaFileOk(IFileDialog dialog)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4180.0 built by: NET48REL1LAST_B
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
LFD Image Reader
    Assembly Version: 1.2.7469.15170
    Win32 Version: 1.2.0.0
    CodeBase: file:///D:/Games/Games%20Files/X-Wing%20Trilogy/Editors/LFD%20Image%20Reader/LFD%20Image%20Reader.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4150.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4001.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.3752.0 built by: NET48REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.3752.0 built by: NET48REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4180.0 built by: NET48REL1LAST_B
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.3752.0 built by: NET48REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Idmr.LfdReader
    Assembly Version: 1.2.2.15168
    Win32 Version: 1.2.2.0
    CodeBase: file:///D:/Games/Games%20Files/X-Wing%20Trilogy/Editors/LFD%20Image%20Reader/Idmr.LfdReader.DLL
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
Chief XWAU Team annoying nitpicker.
Ace Antilles - The X-Wing Outpost
Image

User avatar
JaggedFel
Galactic Empire
Posts: 433
Joined: Wed Sep 06, 2006 11:01 pm
Contact:

Post by JaggedFel » Fri Jun 19, 2020 12:12 am

Wth.

Okay, so I added a button to redefine where TIE is located in the attached zip. Select the TIE95.EXE with it, then try opening an LFD.

If that doesn't work, try copying the RESOURCE directory and TIE95.exe to a different location, and then re-select the new TIE95 and try again.
You do not have the required permissions to view the files attached to this post.
Ye Olde Galactic Empire Mission Editor v1.15.6
Current software WIPs: TIE Layout and Cutscene Editor, TIE/XvT Cockpit Editor
Libraries / Format specs: *.tie, *.plt, *.tfr, *.lfd , *.act, *.dat image files, *.fnt

User avatar
Ace Antilles
Admiral (Moderator)
Posts: 7829
Joined: Sat Jan 22, 2000 12:01 am
Contact:

Post by Ace Antilles » Fri Jun 19, 2020 12:18 am

JaggedFel wrote:
Fri Jun 19, 2020 12:12 am
Wth.

Okay, so I added a button to redefine where TIE is located in the attached zip. Select the TIE95.EXE with it, then try opening an LFD.

If that doesn't work, try copying the RESOURCE directory and TIE95.exe to a different location, and then re-select the new TIE95 and try again.
That seems to have worked. Thanks a lot!
Really appreciate your skill and efforts on such old games :)
Chief XWAU Team annoying nitpicker.
Ace Antilles - The X-Wing Outpost
Image

User avatar
JaggedFel
Galactic Empire
Posts: 433
Joined: Wed Sep 06, 2006 11:01 pm
Contact:

Post by JaggedFel » Fri Jun 19, 2020 12:56 am

Good. So did it work when you selected the original location, or when you moved it?
Ye Olde Galactic Empire Mission Editor v1.15.6
Current software WIPs: TIE Layout and Cutscene Editor, TIE/XvT Cockpit Editor
Libraries / Format specs: *.tie, *.plt, *.tfr, *.lfd , *.act, *.dat image files, *.fnt

User avatar
Ace Antilles
Admiral (Moderator)
Posts: 7829
Joined: Sat Jan 22, 2000 12:01 am
Contact:

Post by Ace Antilles » Fri Jun 19, 2020 1:16 am

I selected the exe file in the location it was before
Chief XWAU Team annoying nitpicker.
Ace Antilles - The X-Wing Outpost
Image

User avatar
JaggedFel
Galactic Empire
Posts: 433
Joined: Wed Sep 06, 2006 11:01 pm
Contact:

Post by JaggedFel » Fri Jun 19, 2020 4:43 am

Alright. Well, in that case I have no idea what happened, other than maybe the registry value it uses to find the Steam location had a bad character in it that throws it off, since the location itself obviously works fine. I'll fix it up to handle this kind of thing properly and leave the "Ace" button in there so there's a manual workaround.
Ye Olde Galactic Empire Mission Editor v1.15.6
Current software WIPs: TIE Layout and Cutscene Editor, TIE/XvT Cockpit Editor
Libraries / Format specs: *.tie, *.plt, *.tfr, *.lfd , *.act, *.dat image files, *.fnt

Post Reply