Geranimo
Sorry, I got your PM but I missed this post. I covered some of this in my reply, but I’ll go over it again briefly for anyone else and try to answer your questions here more specifically:
How do I know what part of the character the bone ID represents?
The best way I know of right now is to use
brawlbox and
these bone mdl0 files provided by
Z
zankyou
Where can I find the bones positions of each playing character in the melee memory (when the game is running)
Internal player data offset 0x5E8 holds a pointer to the bone data of an individual player entity. Each entry on this data table is 0x10 bytes long (indexed by
bone ID) and contains a pointer (offset 0x0) to data used by things like hitboxes as a means of referencing bones. It contains
XYZ position floats starting at offset
0x38.
(
internal player ->
0x5E8 ->
(boneID * 16) ->
0x38 ==
X position of a specific bone)
From an external player data pointer (like those passed to most player-related functions) you can load the pointer value at offset
0x2C to get the
internal player data pointer.
(
external player ->
0x2C ==
internal player data pointer)
You can use player-related functions,
r13, or one of the
static player block entity pointers as a means of acquiring an
external player data pointer. An example using the static player blocks that begin at RAM address 80453080 in Melee v1.02:
(
80453130 ==
external player 1 data pointer)
(
80453F10 ==
external player 2 data pointer)
etc.
So, a couple of examples:
80453130 ->
0x2C ->
0x5E8 ->
0 ->
0x38 ==
player 1 topN X position
80453F10 ->
0x2C ->
0x5E8 ->
0x10 ->
0x3C ==
player 2 transN Y position
Are the XPos, YPos and Zpos relative to the TopN or the bone?
I believe all child bones are relative to their parent bone, and TopN is the parent of the whole skeleton. You can reference a
parent bone from the bone data at offset
0xC.
You can reference TopN from the bone table as mentioned above, or you can take a shortcut by loading the XYZ floats at internal player data offset
0x6F4.
(
internal player ->
0x6F4 ==
XYZ position floats for TopN)
How are the X, Y and Z coords placed (ex in my screen x is left to right, y is top to bottom, etc)
I’ve been a bit confused about this myself. The game rotates the player 90 degrees on stage, so it’s easy to confuse X and Z… For bones, I think it’s relative to how you would expect to find them in a T-pose, so they are rotated from what you might expect in a stage orientation.
Where is the duration of the hitbox? For example, cpt falcon's uair hits during 8 frames, however, line 844 in the excel file, there's only 3 states for it: clean, mid and late. How do I know the duration of each of the clean, mid and late hitboxes?
Hitboxes are a part of the player subaction event system. Check out
Crazy Hand in the
Customized Movesets subforum to explore how event data works.
In a nutshell, hitbox initialization data (the 5 “Data” columns D, E, F, G, and H in the
spreadsheet you linked) is a type of subaction event, and each is a part of a larger body of data that gets parsed alongside other events to describe scripted interactions with action state animations. Chunks of data are read at a time in the form of keyframes defined by in-line timer events; and a hitbox is simply terminated by another event that follows initialization--so it may potentially span multiple keyframes.
Together, a hitbox initialization, timer, and hitbox termination event in sequence are used to create a window of time for the hitbox to be active.
The game doesn’t actually keep track of the remaining time in an active hitbox--rather it keeps track of the time until the next chunk of subaction event data is read. You can remove the termination event and expect a hitbox to last for the entire duration of an action state.
It might be possible to write a code that scans the remaining event data for a subaction in order to calculate the remaining frames based on the subaction timer, but it would probably be a little meaty. You would have to inform the code of different event data lengths to be recognized by opcode, and the only way I can think to do that is to create an array.
It’s possible though to easily check if (any)
hitbox is currently active on a player by referencing the
flag bit stored at internal player data offset
0x2219 (bit 0x10) by both the hitbox initialization and termination events.
(
internal player ->
0x2219 (bit 0x10) ==
active hitbox flag)