.GFX format?

Discuss coding questions, pull requests, and implementation details.
User avatar
numidium3rd
Posts: 187
Joined: Sun Mar 25, 2018 12:34 am
Location: United States

.GFX format?

Post by numidium3rd »

I've made some progress on reverse-engineering the class questions screen. I found all the necessary data for getting it to work mechanically but there are a couple of graphical things I need to work out.

The screen uses GFX files for its animations - a format I haven't seen used elsewhere in DFU. I haven't found any documentation on these files. Has anyone looked into this before?

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: .GFX format?

Post by Interkarma »

First up, thank you so much for making a start on that UI. :)

I haven't looked deeply into the GFX format, other than opening it briefly in a hex editor. I can see the image dimensions at the front (320x80). I think (guessing) from there it follows one of the other formats internally, probably close to IMG.

I'm happy to help break this down soon. My main focus right now is clearing off last few items in 0.9 roadmap and kicking pre-alpha over the fence. I'll be able to take a deeper dive soon.

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: .GFX format?

Post by Interkarma »

Just confirming the GFX format is now solved and supported by ImageReader. It actually used a row offset & RLE format almost identical to TEXTURE files.

The only thing missing now is correct palette. My suspicion is this is handled by the .CEL data, which I'm yet to look at. Once this is reverse engineered, we should be able to put together the class questions UI in its entirety.

User avatar
numidium3rd
Posts: 187
Joined: Sun Mar 25, 2018 12:34 am
Location: United States

Re: .GFX format?

Post by numidium3rd »

Thanks for helping me out with this. It took me a while to figure out how this feature works mechanically. Graphical formats would have been a whole other ordeal, for me at least.

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: .GFX format?

Post by Interkarma »

My pleasure! Chipping away at CEL format - It's something a bit different. Looks like all this does is the lightning now. Once I have that, will wire up other moving parts for you to reference.

Even if we implement UI without lightning animation at first and add it later once reversed, that will be fine too. It's just window dressing and the UI can function without it for a while. Still, would love to sort this one out in time.

User avatar
numidium3rd
Posts: 187
Joined: Sun Mar 25, 2018 12:34 am
Location: United States

Re: .GFX format?

Post by numidium3rd »

I've made some progress using the GFX files. As Interkarma mentioned, the palette isn't quite right. The text also "moves" up and down a bit too fast for the animation so it breaks the illusion of a scroll.

In classic the text scrolls up and down smoothly and clips parts of the letters that are at the top and bottom of the visible portion. That will probably require some lower-level graphical work on my part since I haven't seen any utility DFU methods for cutting off part of a line of text.

Here's a video showing what I have so far:


User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: .GFX format?

Post by Interkarma »

Looking good! :)

Palette problems are solved, check my DemoClassQuestionsWindow.cs reference class for that one in LoadResources().

Scrolling speed and text clipping are easily fixed. I'm sorry for not providing more support on this yet. TextLabel and ListBox support a scissor rect that can clip to pixel-perfect screen space. I can help with these items soon.

I haven't made any progress on the .CEL format sorry. I thought this would be data for palatte animations only, but there seems to be a bit more to it. I might to find some help on this one.

User avatar
afritz1
Posts: 43
Joined: Thu Nov 24, 2016 1:19 am
Contact:

Re: .GFX format?

Post by afritz1 »

If it's any help, Arena has a .CEL format, which is a variant of .FLC. I don't know anything about Daggerfall's .CEL format though, sorry :(

https://github.com/afritz1/OpenTESArena ... File.h#L11

Code: Select all

// An FLC file is a video file. CEL files are nearly identical to FLCs, though with 
// an extra chunk of header data (which can probably be skipped).

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: .GFX format?

Post by Interkarma »

Hey that's interesting! I'll take a look at that when I can. Thank you! :)

User avatar
afritz1
Posts: 43
Joined: Thu Nov 24, 2016 1:19 am
Contact:

Re: .GFX format?

Post by afritz1 »

:+1:
I looked into it a bit, and if the .CEL files in question are MAGE.CEL, ROGUE.CEL, and WARRIOR.CEL, then they were copied from Arena and are the little video files for the streams of magic that appear after answering a character question :)

In my .FLC decoder, the prefix chunk type in .CEL files has byte value 0xF100 in the chunk frame header, and it is simply skipped during file reading. Hope this helps!

Post Reply