Lacrima Castle
HelpSearchMembersCalendar

Welcome Guest ( Log In | Register )

4 Pages V « < 2 3 4  
Reply to this topicStart new topic
> RAI PAY ATTENTION TO THIS TOPIC, YU Sprites
jcdietz03
post Apr 22 2019, 05:36 PM
Post #46


Time Waster
******

Group: Flunkies
Posts: 339
Joined: 1-July 07
From: Boston
Member No.: 1609



External libraries is cheats
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Yourself
post Apr 24 2019, 04:00 AM
Post #47


Twilight Gospel
*****

Group: Arcs
Posts: 245
Joined: 27-December 05
From: The Closet
Member No.: 25



It's an included library. Anyway...

IPB Image

I can rip all of the individual sprites of the animations for at least three files. I even got the right invisible background color now. I pretty much solved chunk 1.

The only thing left to do is to figure out chunk 0 table fields. There are two tables:
- Table 0 starts at 00C0.
- Table 1 is actually a bunch of smaller tables, indexed by the array at 0010-00C0.

Legend:
- 04.2 means offset 4 from start, 2 bytes.
- All values are ints. Usually signed ints.

A table 0 row represents a processed sprite, and looks like this (8 bytes):
+00.2: Index into the sprite array of chunk 1.
+02.2: X offset?? (Usually negative.)
+04.2: Y offset?? (Signed.)
+06.2: (Either 0000 or 0010?)

The variables probably indicate that something needs to be done to a raw sprite. That's why there are multiple rows using the same indexed sprite.


Each table 1 represents an animation, and looks like this (8 bytes):
+00.2: Pointer (from start of file) to a table 0 row, or 0 if end of current animation.
+02.2: (Always zero?)
+04.2: Number of sprites to grab from that pointer.
+06.2: Time?

The number of sprites to grab allows the overlay of multiple sprites in a single instance of the animation. For example, in Valkyrie (0731-0), this row in a table1 (during the Revolution animation):
CODE
F0 06 00 00 03 00 06 00

means to grab these (consecutive) rows in table 0:
CODE
000006F0    DC 00 BC FF 14 00 00 00
000006F8    96 00 BC FF 14 00 00 00
00000700    D0 00 BC FF 14 00 00 00

which correspond to instances of:
0. Valkyrie's after-image.
1. Valkyrie.
2. The lightning on the sword.
which are placed on top of each other in that order, so the shadow is on the back and the lightning is in front.

I believe that the last row of an animation table (i.e. the row that starts with 00 00) holds some metadata about the animation. Possibly determines looping/stopping.

It may even indicate which row to loop once you reach the end. For example, the 11 at the end might indicate that you jump to row 0x11 to loop.
CODE
58 04 00 00 01 00 06 00
60 04 00 00 01 00 0C 00
68 04 00 00 01 00 06 00
70 04 00 00 01 00 06 00
78 04 00 00 01 00 0C 00
80 04 00 00 01 00 0C 00
88 04 00 00 01 00 0C 00
90 04 00 00 01 00 0C 00
98 04 00 00 01 00 0C 00
A0 04 00 00 01 00 06 00
A8 04 00 00 01 00 0C 00
B0 04 00 00 01 00 0C 00
B8 04 00 00 01 00 0C 00
C0 04 00 00 01 00 06 00
C8 04 00 00 01 00 06 00
D0 04 00 00 02 00 06 00
E0 04 00 00 01 00 0C 00
E8 04 00 00 01 00 0C 00
F0 04 00 00 01 00 0C 00
F8 04 00 00 01 00 0C 00
00 00 00 00 00 00 11 00


~~~
How would you like your "keen" eye to watch my "sure" foot kick your "smart" ass? - Xaldin, KH2 parody
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Carnivorous Sheep
post Apr 25 2019, 03:24 AM
Post #48


Lazy


Group: Arcs
Posts: 19
Joined: 20-July 06
Member No.: 172



I consider this work pretty much complete.
IPB Image

There are three remaining issues:
1. Transparency. It is currently bothersome to get these Python image libraries to make animated GIFs with transparency.
2. Image x,y offsets. The offset interpretation of the data was correct, but the sprites can be offset beyond the bounds of the canvas. I can correct for this by detecting how far they're off-bound and offsetting the entire image, but you'd lose information about the original.
3. Palette swapping. There's no palette-swap info in these files.

These can all be taken care of in-bulk using an image processing program like ImageMagick.

The loop index interpretation seems to be right, but I know of no way to represent that in an image file.


~~~
"Though always keen and eager the sheepdog never really mastered the herding of carnivorous sheep."

IPB Image
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Buddhu
post Apr 29 2019, 08:31 PM
Post #49


Casual Chatter
**

Group: Arcs
Posts: 67
Joined: 29-October 06
From: Anywhere but school~
Member No.: 259



Cool shit, thanks Rai
I haven't looked at these files in at least 30 years though so I don't know what's a valkyrie \_(ツ)_/


~~~
Air conditioners are just glorified refrigerators.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
San
post Apr 30 2019, 03:35 AM
Post #50


Shy
*

Group: Arcs
Posts: 37
Joined: 15-August 07
From: Under a Bridge
Member No.: 1637



IPB Image

I doubled the size of the canvas (halfway in each direction) to fix the offset issue, since it turns out that you can't automate it based on the subsprite offsets. I used ImageMagick to fix transparency (SLOOOOW).

I put up a repo on GitHub.


~~~
IPB Image
Ok, according to the "How Evil Are You?" quiz, I´m pure evil. According to the FF-Fan quiz, I´m Laguna. According to the "What Pokemon Are You?" quiz I´m a..... BUTTERFREE!?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

4 Pages V « < 2 3 4
Reply to this topicStart new topic
3 User(s) are reading this topic (3 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 22nd February 2025 - 02:19 PM