Page 1 of 2

.GFX format?

Posted: Fri Jul 05, 2019 3:11 pm
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?

Re: .GFX format?

Posted: Fri Jul 05, 2019 10:23 pm
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.

Re: .GFX format?

Posted: Mon Aug 05, 2019 8:58 am
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.

Re: .GFX format?

Posted: Sun Aug 11, 2019 7:13 pm
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.

Re: .GFX format?

Posted: Sun Aug 11, 2019 9:03 pm
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.

Re: .GFX format?

Posted: Sun Aug 25, 2019 9:29 pm
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:


Re: .GFX format?

Posted: Sun Aug 25, 2019 10:20 pm
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.

Re: .GFX format?

Posted: Mon Aug 26, 2019 12:54 am
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).

Re: .GFX format?

Posted: Mon Aug 26, 2019 2:05 am
by Interkarma
Hey that's interesting! I'll take a look at that when I can. Thank you! :)

Re: .GFX format?

Posted: Mon Aug 26, 2019 2:26 am
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!