Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EPF/PAL Animations #29

Closed
DizzyThermal opened this issue Dec 31, 2023 · 6 comments
Closed

EPF/PAL Animations #29

DizzyThermal opened this issue Dec 31, 2023 · 6 comments

Comments

@DizzyThermal
Copy link
Owner

Many graphics in NTK have animations. This includes map tiles/objects, character items/weapons/armor, and monsters.

In order to achieve this, my current assumption is that the palette index OR the entire palette itself must be changed.

#2 talks about the PAL header containing an animation count and an array of animation offsets, however, it wasn't clear exactly how to implement this.

Creating this issue to brainstorm approaches - all ideas welcome!

@DizzyThermal
Copy link
Owner Author

Using the Masters ward as reference:
mastersward

EPF: shield0.dat:Shield0.epf
PAL: char.dat:Shield.pal

After dumping all the EPF frames, I see 20 frames (using Palette[0]):
image

Focusing on Frame 129 (Front-face of the shield):
Shield0 epf-129

Shield.pal has 22 palettes, so if I scrub the palette from 0-21 for Frame 129, I get:
image

I don't think that simply changing the palette index will achieve the color animation of NTK/Baram.

Maybe the palette index itself doesn't change, but the color within the palette changes - not sure.

EPF/PAL TL;DR:
A palette is an array of 256 colors.. EPFs - for every pixel - point to a particular color within a palette. So each "pixel" in an EPF is 1 byte (0-0xFF -- opposed to 4-bytes rr/gg/bb/aa) pointing to a color within the 256-color palette.. I've never nailed down the correct industry term for this graphics format, maybe Indexed Color Palette?

Anyways, just some notes..

@DizzyThermal
Copy link
Owner Author

I tried to shift through all the colors of the first palette and wound up with these 256 frames:
image

If there's 8 frames in the animation, I'd think 256 colors / 8 frames = 32 color offset, but if I do that it doesn't seem to work:
image

I think I'm getting close..

@DizzyThermal
Copy link
Owner Author

DizzyThermal commented Jan 1, 2024

Created a topic on ResHax.com to get some hopefully get some collaboration going :)

https://reshax.com/topic/375-nexustk-epfpal-frame-color-animations/

@zaventh
Copy link
Contributor

zaventh commented Jan 23, 2024

Looks like you solved this. Perhaps those findings has implications for #27 as well. I took a look at it for a bit but this was my first time really delving deep into these file formats so I didn't get too far. Maybe I could borrow those fancy tools you have? 🙂

@DizzyThermal
Copy link
Owner Author

I need to breakout the file formats and EPFViewer into its own project, but I do intend on open sourcing the tools 😁

I think the "missing colors" might just be color offsets - on top of cycling the palettes. I still haven't found the perfect "Merchant armor" color.

I'm going to try to do this sometime this week, work got busy - stay tuned!

@DizzyThermal
Copy link
Owner Author

What I wanted to know animation loops was figured out and implemented in this Godot 4.x project:
https://github.com/DizzyThermal/EPFViewer

Closing the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants