PeopleSprites*.dat #3
locatellidaniel
started this conversation in
Discovery and Findings
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I know its confusing, and I'm looking at ways to explain this better, since I discovered this by trial and error.
At the bottom there is the Imhex pattern, and also a tiny html/js tool that does the parsing and renders the animations.
Main File structure
1. Variations
The first chunk is an array of what I call "variations". A variation is a valid combination of all the layerGroups of an animation. You cannot have for example a woman body with man legs, or a person carrying two things in the same hand.
So this represent all valid LayerGroup combinations. Interestingly this is the only thing that seems to change between PeopleSprites* files.
2. MidHeader
I have yet not found out what this chunk means.
3. Animations
This is an array of Animations (length of 101 per file).
The animation structure is:
Each animation contains usually 8 "Directions", that correspond to each possible isometric rotation of the animated object.
A Direction is an array of "Frames".
A Frame is composed of a set of references to "BitmapChunks" and a particular render order. The references are "indexes" and "layerGroups".
4. Bitmaps
This part is an array of bitmap chunks, which is byte data of image, similar to locations.dat where one byte corresponds to a color in the palette, but also some extra data like: position to draw the chunk in the frame, width and height of the chunk and more.
The bitmaps are not as straightforwards as it seems, there is sth that feels buggy. The last columns of pixels, should actually be the first column, and viceversa. I'm not sure why this is or is sth wrong with my code.
5. LayerGroups
There are 25 LayerGroups defined in each file. A LayerGroup groups together the BitmapChunks that are somehow related.
For example, the LayerGroup 0 represents all the BitmapChunks of "Legs".
It is an array of 6 elements. Each of these elements is a "Variation" of Legs:
So each LayerGroup is actually an array of indexes to the BitmapChunks array.
i.e. LayerGroup 0 ("Legs") is an array of numbers [0,448,...] which are indexes of the BitmapChunks array where the leg bitmaps start.
Rendering
Once all the data is loaded in memory. Rendering a Frame of an Animation is drawing all BitmapChunks that correspond to the selected Variation.
I cannot explain this without showing code, so it's better if I leave you what I have and we can start from there.
Pattern Code
The imhex pattern definition:
Parsing and Rendering Tool
A first draft version of a JS tool to render and test the content of a PeopleSprites file. Please forgive the ugly coding, will clean it up later.
Instructions:
gocrespriter-v1.zip
Beta Was this translation helpful? Give feedback.
All reactions