-
Notifications
You must be signed in to change notification settings - Fork 263
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
Cutscene (demo) support for Wind Waker #717
Conversation
Nothing is fully working yet, but all of the main classes are in place
* Mostly implemented TVariableValue * Mostly implemented TAdaptor * Filled out some missing enum values related to TCamera * Void, Immediate, and Time TVariableValue updates are supported * Implemented JStudio::TObject base class Next TODOs: * Implement TFunctionValue * Implement FVB parsing
* Uncommented update() and remove() * Fixed up some errors preventing Camera data updates
Implemented most of the skeleton of FVB, although still missing implementations for most of the various function variable implementations.
…y through to the Demo camera, and they seem reasonable. - Fixed some issues in the BSpline interpolation implementation
…otation. Confirmed that the camera position (both eye and target) are working as expected with demo51.stb (the Wind Waker opening cutscene). Woo!
…ce NaNs at the end of the sequence I was incorrectly checking for an invalid curKeyIdx (because of the `/ 2`) which was skipping the end-of-list check and attempting to interpolate off the end of the array.
It currently overrides the camera parameters in d_s_play.execute(), but this is not correct. I need to find the proper place/method for this.
…s now a selectable Scene.
Adjacent to the array of SceneDescs there is now an array of DemoDescs. Contains the name, arc file, stb index, origin, and rotation. All the data needed to load and play the demo, except for the scene it is expected to be in.
Resuming the demo will snap the camera back to the demo camera
…ave been set on the demo cam.
Also made dStage_roomStatus_c a member of dStage_roomStatus_c, instead of its parent class. This is closer to the structure of the game, which will make it easier to add roomControl features in upcoming commits
The LBNK section of the Room info contains a u8 for each of the 12 layers. This int is the index of the Demo arc that the stage expects to be loaded for that layer (or 0xFF for no arc). For instance, Outset Island (Room 44 of 'sea') specifies 0x02 in LBNK[0]. It expects Objects/Demo02.arc to be loaded. Demo events will then load demos using filenames that map into that arc. In the game, this occurs just after dStage_dt_c_roomLoader() is called, during phase 2 of dScnRoom_Create().
… access STBs from the stage's demo arc
They were extracted from the game using a modified version of the excellent wwrando/wwlib/stage_searcher.py script from LagoLunatic. Most of this data comes from the PLAY action of the PACKAGE actor in an event from a Stage's event_list.dat. This action has properties for the room and layer that these cutscenes are designed for. HOWEVER, this data is often missing. It has been reconstructed by cross-referencing each Room's lbnk section (which points to a Demo*.arc file for each layer), the .stb files contained in each of those Objects/Demo*.arc files, and the FileName attribute from the event action.
This also adds support for playing cutscenes in Scenes with multiple rooms loaded (e.g. Great Sea)
That file is not present in Stage/Ocean/Stage.arc, it must a be a leftover. I've re-arranged the logic for loading demos to match the game and support the fallback-to-Stage behavior in case I can find counter.stb somewhere later
Now we just call demo.remove() when a cutscene is triggered. The game has no mechanism for this, it just assumes no demo is playing when one is started (seems fair)
…ting for user input But for now, we just suspend for one frame and then continue. - Added the "Control" object to TControl - This can be controlled by the STB file and is used to set the suspend state when waiting for user input (e.g. when a message is being displayed) - Parser now handles -1 object type (control) - Added suspend support
Put `debugger` statements in place to catch first usages of None and Plateau interpolation so that they can be confirmed working
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.
Apologies for the delay here, I was away from any computers for the entire previous week.
There's a lot of code here to go through and look at. Most of it looks reasonable, but I just need to make sure I can work on it in the future, since Wind Waker is a game I do fix up frequently.
In general, there's a lot of cases where you don't follow the existing conventions of the noclip codebase. I don't care too deeply about it, since it's stuff we can fix after merge, but I would like you to fix it. I've only flagged the first "infraction" of each type I saw, but please review the patch and make sure it's addressed everywhere.
There's also a question about how to expose this to users. Since certain cutscenes might be broken, actors might be missing, etc., I think the best way forward for this would be to remove the Cutscenes panel and just expose each individual scene as an entry in the toplevel Scenes panel. That way we can roll them out as they achieve parity, and we don't complicate the UI.
I think eventually it might make sense to tie this into the Studio mode UI so you can rewind / time skip around, but that's only a nebulous idea in my head and might not actually make sense.
@@ -188,7 +188,7 @@ export class mDoExt_McaMorf implements JointMatrixCalc { | |||
} | |||
|
|||
public setMorf(morfFrames: number): void { | |||
if (this.prevMorf < 0.0 || morfFrames < 0.0) { | |||
if (this.prevMorf < 0.0 || morfFrames <= 0.0) { |
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's this for?
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 it was causing issues with the npc animation. The original game logic is <=
here, and Aryll relies on morfFrames = 0.0
to be accepted by this if
.
src/ZeldaWindWaker/SComponent.ts
Outdated
@@ -113,6 +113,14 @@ export function cM_rndFX(max: number): number { | |||
return 2.0 * (max * (Math.random() - 0.5)); | |||
} | |||
|
|||
export function cM_deg2s(deg: number): number { | |||
return deg * 182.04445; |
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 already exists as cM__Deg2Short
. I need to fix the names on those.
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.
Ah, I should have spotted that. OK I've renamed cM__Deg2Short
to cM_deg2s
(so that it's easier to compare with the decomp). I only had to change one use case. I left the rest as they're named now. I hope that's what you had in mind.
The game attaches animation classes during `draw()` and then immediately removes them. Noclip uses a separate, nondestructive, style of animation logic.
Changed one use case to use the new name
I'm totally down with this. I actually waffled between these two styles. I'll make this change. |
Yep, my thoughts exactly! I'll get the basics in and then we can go from there. |
- Added "Cutscenes" category with the Wind Waker section - Currently all cutscenes are listed - Clicking one will load the correct Scene and begin playing the demo
When a demo is complete enough to be worth viewing, move it to the sceneDescs list
@magcius I'm happy with this. Anything else you think is worth changing before merging? |
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 apparently forgot to hit publish a few days ago.
Added public/private to data members Remove some redundant type info when using =
TitleShort.mov
AwakenShort4.mov
Added JStudio to JSystem. Most camera and actor functionality is supported. Messages, Lights, and Fog unimplemented.
Added all JStudio cutscene events from Wind Waker. This includes room, layer, and position info. Most are playable.
New "Cutscenes" UI element when in a Scene which has at least one demo (pictured above).
Added new "Title Screen" Scene which has the playable title screen demo.
Pausing during a demo allows noclip-style FPS camera. Resuming will snap back to the demo camera.
Moved
globals.roomStatus
into newglobals.roomCtrl
, along withdemoArcName
. This is closer to the game's structure and I suspect will make things easier in the future.Moved Aryll (d_a_npc_ls1) out of LegacyActors. She now responds to demo events (e.g. see Awaken on Outset)