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

En_Kaizoku and object_kz documented: the pirate fighter miniboss #1788

Open
wants to merge 26 commits into
base: main
Choose a base branch
from

Conversation

isghj5
Copy link
Contributor

@isghj5 isghj5 commented Jan 12, 2025

I haven't documented an actor in a long time, so I'm rusty and this may need more scrutiny.

A good amount of this documentation was taken from OOTs version of this actor. All of the object is named, all of the functions are named, however there are still several struct values and states undocumented.

Screenshot_2025-01-12_14-50-57

@hensldm hensldm added documentation Improvements or additions to documentation Overlay Asset Needs-second-approval Second approval Needs-first-approval First approval labels Jan 12, 2025
assets/xml/objects/object_kz.xml Outdated Show resolved Hide resolved
assets/xml/objects/object_kz.xml Outdated Show resolved Hide resolved
assets/xml/objects/object_kz.xml Outdated Show resolved Hide resolved
src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.h Outdated Show resolved Hide resolved
Comment on lines 23 to 24
/* 1 */ KAIZOKU_ANIM_OOT_CONVERSATION, // giving player membership card?
/* 2 */ KAIZOKU_ANIM_OOT_JUMP, // replaced with _LAND
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can drop the OOT part of the name and just add a comment that they are unused remnants from that game instead

Copy link
Contributor Author

@isghj5 isghj5 Jan 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, What should "KAIZOKU_ANIM_OOT_CONVERSATION" be renamed to then? There are 4 other animations used in the game that actually involve talking, and this one does not in this game. Naming the animation CONVERSATION without specifying its not used, could cause confusion.

src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.h Outdated Show resolved Hide resolved
this->unk_2EC = this->picto.actor.world.rot.z;
this->picto.actor.world.rot.z = 0;
this->colorType = KAIZOKU_GET_TYPE(this);
KAIZOKU_GET_TYPE(this) = 0; // clear param, which was rot.z, resets skew
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be better to have a SET_TYPE instead of abusing the getter in this way

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you feel about reverting the macro alltogether, reverting to naked rot.z manipulation, with the comment alone?

Setter feels opposite: it's not setting a parameter to be used later as a parameter, its clearing the parameter from a hijacked general purpose parameter before it can corrupt the model in-game with irrelevant data.

I guess I make a clear macro instead KAIZOKU_CLEAR_Z_ROT(this); which actually signals the intent.

src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c Outdated Show resolved Hide resolved
src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c Outdated Show resolved Hide resolved
src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c Outdated Show resolved Hide resolved
@AngheloAlf AngheloAlf removed the Needs-first-approval First approval label Jan 22, 2025
assets/xml/objects/object_kz.xml Outdated Show resolved Hide resolved
assets/xml/objects/object_kz.xml Outdated Show resolved Hide resolved
assets/xml/objects/object_kz.xml Outdated Show resolved Hide resolved
src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.h Outdated Show resolved Hide resolved
src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.h Outdated Show resolved Hide resolved
src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c Outdated Show resolved Hide resolved
src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c Outdated Show resolved Hide resolved
src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c Outdated Show resolved Hide resolved
src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c Outdated Show resolved Hide resolved
src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c Outdated Show resolved Hide resolved
Copy link
Collaborator

@tom-overton tom-overton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't get time to look at the C file today, but I'll look at it tomorrow.

assets/xml/objects/object_kz.xml Outdated Show resolved Hide resolved
assets/xml/objects/object_kz.xml Outdated Show resolved Hide resolved
assets/xml/objects/object_kz.xml Outdated Show resolved Hide resolved
assets/xml/objects/object_kz.xml Outdated Show resolved Hide resolved
assets/xml/objects/object_kz.xml Outdated Show resolved Hide resolved
Comment on lines 62 to 67
typedef enum KaizokuTextOffset {
/* 0 */ KAIZOKU_COVERSATION_INTRO_1, // shout before landing
/* 1 */ KAIZOKU_COVERSATION_INTRO_2, // after landing
/* 2 */ KAIZOKU_COVERSATION_WIN, // after losing to player
/* 3 */ KAIZOKU_COVERSATION_LOSS // after defeating player
} KaizokuTextOffset;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like you could just name these in a way such that the comments (and the disambiguation between INTRO_1 and INTRO_2) are unnecessary, e.g.:

typedef enum KaizokuTextOffset {
    /*  0 */ KAIZOKU_COVERSATION_SHOUT_FROM_ABOVE,
    /*  1 */ KAIZOKU_COVERSATION_INTRO,
    /*  2 */ KAIZOKU_COVERSATION_DEFEAT,
    /*  3 */ KAIZOKU_COVERSATION_VICTORY
} KaizokuTextOffset;

I renamed the latter two to have them from the actor's perspective. If you really wanted to be explicit about who is defeating who, you could name the latter two like:

    /*  2 */ KAIZOKU_COVERSATION_DEFEATED_BY_PLAYER,
    /*  3 */ KAIZOKU_COVERSATION_DEFEATED_PLAYER

Also, the enum is called KaizokuTextOffset, but then the values are prefixed with KAIZOKU_CONVERSATION. Should the enum be KaizokuConversation, or should these be prefixed with KAIZOKU_TEXT_OFFSET_? I think it's probably the latter, but I'm not sure.

Copy link
Contributor Author

@isghj5 isghj5 Jan 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to avoid both being called "defeat" with a small not "by" that confuses them at a glance, for now I'll change it to PLAYER_VICTORY/DEFEAT to match the actionfuncs

src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.h Outdated Show resolved Hide resolved
src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.h Outdated Show resolved Hide resolved
src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.h Outdated Show resolved Hide resolved
assets/xml/objects/object_kz.xml Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Asset documentation Improvements or additions to documentation Needs-second-approval Second approval Overlay
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants