I like to do stuff myself sometimes. Often I don't really know how to do these things. I rely on Google to help me find out how. Occasionally, Google fails me utterly. Either I don't know what words to type in, or I just can't find it. This is where I put the solutions to problems that I failed to find on google.
Saturday, October 28, 2023
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.
Tuesday, October 10, 2023
Force Engine - Mac data
Mac rendered at 640x480 apposed to Dos at 320xsomething
Maybe not 480, probably 400? Menu says 640x400...640x395 measured? |
600x400 doubled pixels, so 300x200? |
Anyway, 384x200 is "teensy":
Most parts are the same, but
- the loading screen was 640x480
- hud textures were double resolution
- weapons data stored in WEAPONS.GOB, but otherwise the same content
- minor differences in levels
- fonts smoother(extra Glowing!.fnt ?)
- music same/different. music is stored in resource fork?
- cutscenes: same except for AGENTMNU.LFD and MENU.LFD (font was upscaled, the button names were changed from "DOS" to "QUIT", and a mysterious widening of two parallel red lines.
The big changes below are not changes, just re-ordered arm1 <-> arm2 messages |
Hotkeys, quit hotkey changed to qQ from dD |
NARSHADA.O is missing an object(missing the remote sprite), and extra LOGIC: ANIM in nava card:
SECBASE.O only has an extra LOGIC: ANIM similar to the one in NARSHADA
TEXT.MSG is mac-ified:
The midi instruments are stored in instruments1,2, all in the resource fork(I think that is all that and menu/icon things are all the resource fork data):
instruments in 2 are roughly double the size of 1 so probably 16bit?
Stereo Panning? ... listens. It seems to work. dos version doesn't have an option for it, but it seems to work by default.
I don't know if there is a way to send the midi data out of the mac version, or if the instruments provided are all we get.
cutscenes (extracted with DF2.exe in dosbox, probably could have used lfdtool.py in win):
python ..\..\..\..\..\dftools-master\delttool.py AGENTDLG_11.DELT ..\AGENTMNU.PLT |
I think I need some more context.
All the other AGENTDLG_##.DELT are just various menu ui bits, "are you sure you want to quit", "yes", "no" buttons and such.
AGENTMENU.ANIM
D:\Games\TheForceEngine-v1.09.530\ModPrep\Dark Forces Data\Cutscenes\AGENTMNU>python ..\..\..\..\dftools-master\animtool.py extract AGENTMNU.ANM AGENTMNU
Extracting "D:\Games\TheForceEngine-v1.09.530\ModPrep\Dark Forces Data\Cutscenes\AGENTMNU\AGENTMNU.ANM" into directory "D:\Games\TheForceEngine-v1.09.530\ModPrep\Dark Forces Data\Cutscenes\AGENTMNU\AGENTMNU"
Macified text.
D:\Games\TheForceEngine-v1.09.530\ModPrep\Dark Forces Data-dos\LFD\MENU>python ..\..\..\..\dftools-master\fnttool.py FONT8.FON
Traceback (most recent call last):
File "D:\Games\TheForceEngine-v1.09.530\dftools-master\fnttool.py", line 4, in <module>
from PIL import Image
ModuleNotFoundError: No module named 'PIL'
D:\Games\TheForceEngine-v1.09.530\ModPrep\Dark Forces Data-dos\LFD\MENU>pip install Pillow
Collecting Pillow
Downloading Pillow-10.0.1-cp39-cp39-win_amd64.whl (2.5 MB)
|████████████████████████████████| 2.5 MB 3.2 MB/s
Installing collected packages: Pillow
Successfully installed Pillow-10.0.1
WARNING: You are using pip version 21.0; however, version 23.2.1 is available.
You should consider upgrading via the 'c:\python39\python.exe -m pip install --upgrade pip' command.
D:\Games\TheForceEngine-v1.09.530\ModPrep\Dark Forces Data-dos\LFD\MENU>python ..\..\..\..\dftools-master\fnttool.py FONT8.FON
Loaded built-in palette "SECBASE"
Converting "D:\Games\TheForceEngine-v1.09.530\ModPrep\Dark Forces Data-dos\LFD\MENU\FONT8.FON"
Traceback (most recent call last):
File "D:\Games\TheForceEngine-v1.09.530\dftools-master\fnttool.py", line 44, in <module>
main()
File "D:\Games\TheForceEngine-v1.09.530\dftools-master\fnttool.py", line 40, in main
from_fnt(args)
File "D:\Games\TheForceEngine-v1.09.530\dftools-master\fnttool.py", line 23, in from_fnt
fnt.to_image(fnt.read(image), rgb_palette).save(f'{imageName}.png')
File "D:\Games\TheForceEngine-v1.09.530\dftools-master\formats\fnt.py", line 23, in read
raise Exception('File does not have FNT magic identifier.')
Exception: File does not have FNT magic identifier.
oh it isn't a 'fnt' it is a 'font'
|
\(〇_o)/ |
Gimp to the rescue |
Mac - Dos |
The mission briefing uses a different font:
Jan looks a bit smoother
Yep, some of those pixels have been al/tered.
I cant find the upscaled jan and mon mothma images. TFE looks like it is
s_menuActor = lactorAnim_load(bgAnim, &bounds, 0, 0, 0);
which does a:
sprintf(animName, "%s.ANIM", name);
name -> bgAnim -> brief -> bgAnim -> &s_sharedState.briefingList.briefing[briefingIndex];
list gets loaded in with:
if (!parseBriefingList(&s_sharedState.briefingList, "briefing.lst"))
which is in DARK.GOB. I probably should have guess that,
LEV: SECBASE LFD: dfbrief.lfd ANI: brf-mon PAL: brf-jan
DFBRIEF.LFD ... meld showed them as identical, but I'll check 'brf-mon' or 'brf-jan' or 'brf-nil'
brf-jan.anim -> brf-jan_0.DELT has the background, but it is the same as the dos version 311x200.
I'm still not sure where the extra pixels come from.