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

Rename and document Adult Ruto functions #2288

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

Conversation

JordanLongstaff
Copy link

No description provided.

src/overlays/actors/ovl_En_Ru2/z_en_ru2.c Outdated Show resolved Hide resolved
src/overlays/actors/ovl_En_Ru2/z_en_ru2.c Outdated Show resolved Hide resolved
src/overlays/actors/ovl_En_Ru2/z_en_ru2.c Outdated Show resolved Hide resolved
src/overlays/actors/ovl_En_Ru2/z_en_ru2.c Outdated Show resolved Hide resolved
src/overlays/actors/ovl_En_Ru2/z_en_ru2.c Outdated Show resolved Hide resolved
@JordanLongstaff
Copy link
Author

JordanLongstaff commented Nov 9, 2024

Thanks for the tips. Most of this was info I didn't see. 👍

Copy link
Contributor

@cadmic cadmic left a comment

Choose a reason for hiding this comment

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

Very nice work!

@@ -2,7 +2,7 @@
#include "z64cutscene_commands.h"

// clang-format off
static CutsceneData D_80AF411C[] = {
static CutsceneData gWaterMedallionCS[] = {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: gWaterMedallionCs is more consistent with existing names (e.g. gIceCavernSerenadeCs)

Copy link
Author

Choose a reason for hiding this comment

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

The rest of the named CS data variables in csdis_re.py end in CS, not Cs.

Copy link
Collaborator

Choose a reason for hiding this comment

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

That is a tool for processing assets, external to the games code. When considering naming conventions of code for the game we are speaking within the context of src/ and related header files

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh sorry, I see what you are saying. The symbol names within HARDCODED_SYM_ROM.
Those should change to conform to rest of the codebases style (also what is this script even doing?)

Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't realize the naming was inconsistent sorry, disregard

src/overlays/actors/ovl_En_Ru2/z_en_ru2.c Outdated Show resolved Hide resolved
src/overlays/actors/ovl_En_Ru2/z_en_ru2.c Outdated Show resolved Hide resolved
src/overlays/actors/ovl_En_Ru2/z_en_ru2.c Outdated Show resolved Hide resolved
src/overlays/actors/ovl_En_Ru2/z_en_ru2.c Outdated Show resolved Hide resolved
src/overlays/actors/ovl_En_Ru2/z_en_ru2.c Outdated Show resolved Hide resolved
src/overlays/actors/ovl_En_Ru2/z_en_ru2.c Outdated Show resolved Hide resolved
src/overlays/actors/ovl_En_Ru2/z_en_ru2.c Outdated Show resolved Hide resolved
src/overlays/actors/ovl_En_Ru2/z_en_ru2.c Outdated Show resolved Hide resolved
src/overlays/actors/ovl_En_Ru2/z_en_ru2.c Outdated Show resolved Hide resolved
src/overlays/actors/ovl_En_Ru2/z_en_ru2.c Outdated Show resolved Hide resolved
Copy link
Contributor

@mzxrules mzxrules left a comment

Choose a reason for hiding this comment

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

Again, the bodies of EnRu2_UpdateEyes and EnRu1_UpdateEyes are identical, so the variables shouldn't be named differently.

Comment on lines +175 to 178
s32 EnRu2_GetSwitchFlag(EnRu2* this) {
s32 params_shift = PARAMS_GET_U(this->actor.params, 8, 8);

return params_shift;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This isnt related to your changes, but params_shift doesnt even fit our style regarding variable names haha.
You can name it switchFlag. Actually, is a temp even required?

Additionally, if you feel like doing so, it would be helpful to give the params macro a helpful name.
For example
#define ENRU2_GET_SWITCH_FLAG(thisx) PARAMS_GET_U(thisx->params, 8, 8)

Comment on lines +181 to 185
s32 EnRu2_GetType(EnRu2* this) {
s32 params = PARAMS_GET_U(this->actor.params, 0, 8);

return params;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

same as a above but named type, and also making ENRU2_GET_TYPE()

Comment on lines +292 to +294
/**
* Gradually increases Ruto's Y-coordinate as she rises up through the blue warp in the Chamber of Sages.
*/
Copy link
Collaborator

Choose a reason for hiding this comment

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

worth noting this is changing her model Y offset while her actual position is unaffected. The shape.YOffset field is also in terms of model space, which is why the values are so high.

I would reword the comment to say "Model Y Offset" instead of "Y-coordinate".
And maybe consider changing the function name to RaiseModel, but maybe this implementation detail doesnt have to be mentioned in the name

Comment on lines +299 to +302
/**
* Sets up Ruto's actor in the Chamber of Sages. Note: this gets called every time the Chamber of Sages
* is loaded, regardless of story progress (or which Temple you just finished).
*/
Copy link
Collaborator

Choose a reason for hiding this comment

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

Regarding the note, this is less a consequence of the actors implementation and has more to do with the fact that all sage actors are loaded when you enter chamber of sages, right?

The comment may be better worded as
Note: All sages actors are present in the Chamber of Sages regardless of which dungeon was just completed. This function runs unconditionally, even if it is not relevant for Ruto

Comment on lines +334 to +338
/**
* Occurs in the Chamber of Sages (regardless of which medallion you've earned). Sets up the cutscene data for
* Ruto to give Link the Water Medallion, but this only happens if she should do so. Otherwise, this function
* does nothing except loop endlessly until Link leaves the Chamber of Sages.
*/
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 this can be a bit more concise. I restate the note mentioned in EnRu2_SpawnWaterMedallion since the reader might not have seen that comment, and its arguably more important here due to the endless loop

Suggested change
/**
* Occurs in the Chamber of Sages (regardless of which medallion you've earned). Sets up the cutscene data for
* Ruto to give Link the Water Medallion, but this only happens if she should do so. Otherwise, this function
* does nothing except loop endlessly until Link leaves the Chamber of Sages.
*/
/**
* Sets up the Water Medallion Cutscene if coming from Water Temple.
* All sage actors are present in the Chamber of Sages regardless of which dungeon was just completed.
* This function will loop endlessly if the current sage cutscene is not for the Water Medallion.
*/

Comment on lines -636 to +812
s32 func_80AF383C(EnRu2* this, PlayState* play) {
s32 EnRu2_IsPlayerInRange(EnRu2* this, PlayState* play) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

In range for what? it has a very specific position check.
Seems to be for starting the encounter, so EnRu2_IsPlayerInRangeForEncounter

Comment on lines +823 to +826
/**
* Checks if Link is close enough to Ruto and conditionally triggers the encounter cutscene in the Water Temple.
*/
void EnRu2_TriggerEncounterInRange(EnRu2* this, PlayState* play) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This function spends most of its time waiting doing nothing while it waits for link, so CheckToStartEncounter or similar seems nice to me

Comment on lines +833 to 839
/**
* Triggers the encounter cutscene in the Water Temple, unconditionally. Appears to be unused.
*/
void EnRu2_TriggerEncounter(EnRu2* this, PlayState* play) {
this->action = ENRU2_WATER_TEMPLE_ENCOUNTER_BEGIN;
OnePointCutscene_Init(play, 3130, -99, &this->actor, CAM_ID_MAIN);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This isnt really triggering the encounter right, that already happened above. This is more like SetupBeginEncounter.
Also want to note inconsistency between ENRU2_WATER_TEMPLE_ENCOUNTER_BEGIN and EnRu2_BeginEncounter

Copy link
Author

Choose a reason for hiding this comment

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

No, the difference between this and the other function is that this is unconditional whereas the other one requires Link to be in the same room. Both of them trigger the cutscene where Link meets Ruto, but this one is unused.

Comment on lines -788 to 993
switch (func_80AF26A0(this)) {
switch (EnRu2_GetType(this)) {
case 2:
Copy link
Collaborator

Choose a reason for hiding this comment

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

An enum for these type values could be helpful if you want to make it

Comment on lines -790 to +994
func_80AF2E1C(this, play);
EnRu2_InitCrossingArms(this, play);
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is crossing arms? Like what cutscne does this correspond to? Might be helpful to name it after that, so the corresponding type name is also clear.

Copy link
Author

Choose a reason for hiding this comment

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

Two places. One is when you complete the Water Trial, the other is during the "Seal Ganon" cutscene.
It's named after the pose she strikes where she crosses her arms in an X.

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

Successfully merging this pull request may close these issues.

4 participants