-
Notifications
You must be signed in to change notification settings - Fork 125
Start documenting Distortion World and its camera #464
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
Conversation
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 is a real behemoth of a module, nice first chunk!
Overall thought I want to hear opinions on - would it be worth us picking some prefix to use for distortion world functionality e.g. DW
? I'm usually not a fan of stuff like that since it reduces grep-ability, but in this case there's so much DW-specific functionality and preprending everything with DistortionWorld
makes it pretty verbose. I'm kinda torn about it myself, but that just came to mind when looking at some of the function and struct names here.
include/overlay009/ov9_02249960.h
Outdated
u16 unk_0A; | ||
u32 unk_0C; | ||
u8 reserved_10[16]; | ||
} DistortionWorldPersistedData; |
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.
thought: Should this be Persistent
instead of Persisted
(same applies to other usages throughout)? I think it's a little unclear what Data
means too.
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.
Should this be
Persistent
instead ofPersisted
(same applies to other usages throughout)?
I started calling it "Persisted" throughout the code base, which includes other, non-distortion world related parts of the code.
If this is a case of bad English from my part then sure, we can rename this as part of a refactor ^^ It'll be a refactor that's not DW-specific tho'
I think it's a little unclear what
Data
means too.
I guess this is intended, as this "Data" refers primarily to a chunk of data present in the save data that maps can use to store whatever they need (documented here, and in the save data, this is this variable). So, by nature, this data is generic.
Even if, at the level of a single module, this naming may sound less clear, the intent here is to provide a consistent name throughout the code base for this part of the save data, which would allow better grep-ability and a quick way to understand what "PersistedData" refers to when encountering such a struct (as those structs that end up in the save data are quite spread out).
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.
Sounds good. If I'm understanding what this does right, persistent definitely sounds more correct to me, but we could do a rename separate from this.
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.
Let's rename it later then.
@@ -4424,7 +4424,7 @@ | |||
.short \arg1 | |||
.endm | |||
|
|||
.macro ScrCmd_31F | |||
.macro ResetDistortionWorldPersistedCameraAngles |
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.
question: Would this be nearly as clear as just ResetDistortionWorldCameraAngles
?
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 script command calls the following function:
pokeplatinum/src/overlay009/ov9_02249960.c
Lines 1612 to 1622 in c15cb4f
void DistortionWorld_ResetPersistedCameraAngles(FieldSystem *fieldSystem) | |
{ | |
GF_ASSERT(fieldSystem != NULL); | |
PersistedMapFeatures *persistedMapFeatures = MiscSaveBlock_GetPersistedMapFeatures(FieldSystem_GetSaveData(fieldSystem)); | |
DistortionWorldPersistedData *data = PersistedMapFeatures_GetBuffer(persistedMapFeatures, DYNAMIC_MAP_FEATURES_DISTORTION_WORLD); | |
data->cameraAngleX = 0; | |
data->cameraAngleY = 0; | |
data->cameraAngleZ = 0; | |
} |
Which only acts upon the camera angle in the persisted data. I'm worried calling it ResetDistortionWorldCameraAngles
would imply there is an effect that is immediately visible (although it may have such an effect indirectly, I didn't test).
Also, this script command is only called in map script scripts_distortion_world_giratina_room.s
, so I don't think having a longer name has a huge impact.
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.
Sounds good. Might be a good candidate to substitute in DW
if we do want to abbreviate that across the board.
c15cb4f
to
4353799
Compare
I don't think it would reduce grep-ability that much. You could grep for
I'm more worried about people not getting right away what "DW" stands for (Doctor Who?), but it's only a matter of learning once the acronym. We could also use the |
I worry about this, as well. What about |
Sounds good to me. |
4353799
to
7554186
Compare
My bad, this slipped off my radar - re: the Beyond abbreviation concerns, I think I would rather us apply the shorthand universally rather than just when using it as a module prefix or not at all - applying it some of the time feels like it adds some inconsistency that may make the Distortion World-related code slightly harder to traverse. I don't want to hold this PR up much longer though - we can also revisit the naming in future PRs. I just wanted to avoid ground-retreading in future Distortion World PRs since it'd be nice to stay consistent. |
7554186
to
69c1ecc
Compare
No problem, life got (and still gets) on my way for me ^^ I'll need to take some time to properly get back to this PR and module.
Agreed, I just pushed an update to the name of the structs. Shortened the names to
Agreed. We still have some Those appear mostly in the middle of function names (e.g.
Yep, let's ask ourselves the question later on once the module is more documented. Having a better vision of what this module interacts with may help. I'll rebase this PR and fix conflicts once it is greenlit. |
Sorry for my lack of response here; I think that |
Apologies again, still quite busy. The newest set of changes look good to me. Should just need to sort out the conflicts and we'll call this one good. |
69c1ecc
to
5acb2b4
Compare
This begins the documentation of overlay009, which is in charge of managing stuff related to the Distortion World. For now, the scope of this commit has been limited to the following: - start documenting structures used throughout this overlay, more specifically the `DistortionWorldSystem` struct - start documenting the structures found inside the files of the `tw_arc.narc` NARC - document functions and structures related to camera management inside the Distortion Word, including the templates found inside the `tw_arc.narc` NARC Signed-off-by: Kuruyia <[email protected]>
…istortion World This documents the `ScrCmd_31F` map script command, that is only used in the Giratina Room map of the Distortion World to reset the camera angles that are present in the persisted map features data. Signed-off-by: Kuruyia <[email protected]>
5acb2b4
to
d649ae0
Compare
Should be good to merge :) |
This begins the documentation of overlay009, which is in charge of managing stuff related to the Distortion World.
For now, the scope of this PR has been limited to the following:
DistortionWorldSystem
structtw_arc.narc
NARCtw_arc.narc
NARCThis also documents the
ScrCmd_31F
map script command, that is only used in the Giratina Room map of the Distortion World to reset the camera angles that are present in the persisted map features data.