Friday, October 27, 2023

Dark Forces Agent Menu modify

Dark Forces Data->Cutscenes->AGENTMNU.LFD->AGENTDLG(ANIM)->1(DELT)

python ..\..\dftools-master\lfdtool.py AGENTMNU.LFD AGENTMNU

python ..\..\..\dftools-master\animtool.py AGENTMNU\AGENTDLG.ANM AGENTDLG

https://darkforces.reviews/database/specs/delt-lfd-resource-dlt-files

https://github.com/njankowski/dftools can decode, but not re-encode

D:\Games\TheForceEngine-v1.09.530\ModPrep\Dark Forces Data\Cutscenes\AGENTMNU\AGENTDLG>..\..\..\..\..\bmpdf\DF2.EXE /D AGENTDLG_1.DELT AGENTDLG_1.BMP ..\..\MENU\MENU.PLT
This version of D:\Games\TheForceEngine-v1.09.530\bmpdf\DF2.EXE is not compatible with the version of Windows you're running. Check your computer's system information and then contact the software publisher.

to dosbox

BMPDF\DF2.exe /D AGENTD~2.DEL 1.BMP

The actual image is offset by (4D 00, 3D 00) or (77, 61) I assume that is to center it on the 320x200 screen. DF2.exe encodes the top 77 and left 61 pixels as "transparent" or black or 0, while delt.py decodes all the tranparenet pixels transparent, with the actual image data centered in 319x187 png. We don't want to re-encode that blank spaces so crop it down at 77,61

edit the words img placeholder

BMPDF\2DF.exe /D 1e.BMP 1.DEL /0=0

ok, the bytes look a bit different, but mostly the same, but it is a different size

if we copy the header back over

Error: Invalid picture - out of bounds file: 1H.DEL

If we only edit the size, but leave offset to 0,0

Each line's StartX and StartY are likely relative to OffsX and OffsY. On the original, the top and bottom lines probably don't contain data for the rounded corners, and are likely short by 4 then 2 pixels.

... fires up vscode, delttool.py => delt.py, and sets some breakpoints. Yeah different sizes for lines, but also, portions of the line are compressed(not just per line, but sections of the line), so I can't just find the bits and alter them.

Ok, going back to 2DF.exe... tring 2DF.EXE /D /0=0 1.BMP 1ORIG.DEL, and it creates a DEL file that is slightly smaller than the original AGENTDLG_1.DELT. Decoding show the same as the input, so maybe it is just better compression?

Well animtool.py and lfdtool.py don't re-encode, So I'm sticking with dosbox, I guess.

df2.exe /D and 2df.exe /D were not what i need. 2df.exe /M

2df.exe /m AGENTDLG.txt

ANIM AGENTDLG.ANM 1
AGENTD1.BMP /0=0

2df.exe /m AGENTMNU.txt

LFD AGENTMNU.LFD 1
AGENTDLG.ANM

Now I have a single DELT in a single ANIM in an LFD. hopefully using this as a mod doesn't overwrite bits not present. didn't work. Maybe I need to pack it in a gob, maybe the engine doesn't load mods for the menu, IDK.

No comments:

Post a Comment