-
Notifications
You must be signed in to change notification settings - Fork 601
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
base: main
Are you sure you want to change the base?
Conversation
Thanks for the tips. Most of this was info I didn't see. 👍 |
There was a problem hiding this 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[] = { |
There was a problem hiding this comment.
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
)
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?)
There was a problem hiding this comment.
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
There was a problem hiding this 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.
s32 EnRu2_GetSwitchFlag(EnRu2* this) { | ||
s32 params_shift = PARAMS_GET_U(this->actor.params, 8, 8); | ||
|
||
return params_shift; |
There was a problem hiding this comment.
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)
s32 EnRu2_GetType(EnRu2* this) { | ||
s32 params = PARAMS_GET_U(this->actor.params, 0, 8); | ||
|
||
return params; | ||
} |
There was a problem hiding this comment.
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()
/** | ||
* Gradually increases Ruto's Y-coordinate as she rises up through the blue warp in the Chamber of Sages. | ||
*/ |
There was a problem hiding this comment.
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
/** | ||
* 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). | ||
*/ |
There was a problem hiding this comment.
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
/** | ||
* 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. | ||
*/ |
There was a problem hiding this comment.
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
/** | |
* 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. | |
*/ |
s32 func_80AF383C(EnRu2* this, PlayState* play) { | ||
s32 EnRu2_IsPlayerInRange(EnRu2* this, PlayState* play) { |
There was a problem hiding this comment.
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
/** | ||
* 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) { |
There was a problem hiding this comment.
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
/** | ||
* 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); | ||
} |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
switch (func_80AF26A0(this)) { | ||
switch (EnRu2_GetType(this)) { | ||
case 2: |
There was a problem hiding this comment.
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
func_80AF2E1C(this, play); | ||
EnRu2_InitCrossingArms(this, play); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
No description provided.