Opened 11 years ago

Last modified 7 years ago

#38 new enhancement

Cutscene skipping

Reported by: Iritscen Owned by: Alloc
Priority: major Component: Daodan/Win
Keywords: Cc:

Description (last modified by Iritscen)

Although Gumby attempted to do this in BSL back in 2008, it wasn't possible to fully recreate the cutscene behavior using BSL and so if the player chose to actually watch a cutscene, there was maybe a 50% chance that it would be buggy. This is a task better taken on with the Daodan so that functions connected to cutscene mode can be hooked instead of trying to replace them with BSL calls. Edit: Also, I've just read an old post that said that there is unused cutscene-skipping code still present in Oni, so that might be something to look into.

Change History (12)

comment:1 Changed 11 years ago by Iritscen

  • Description modified (diff)

comment:2 Changed 7 years ago by s10k

Another alternative to do this is to pre-record the gameplay cutscenes (maybe in some low and high resolution, player would have the option to choose) and use the movie_play script command to play the pre-rendered cutscene.

I've checked and it is very easy to convert the existing video files to the bink format using the rad tools here:
http://www.radgametools.com/bnkdown.htm

Then after using the movie_play command we would only need to edit the original scripts to restore the game at the correct location. We could even use the "fast_mode" variable to fast skip the "true" cutscene (all in background while the pre-rendered video plays).

comment:3 Changed 7 years ago by Iritscen

If someone wrote the BSL necessary to jump the game world ahead to the post-cutscene state, then that would solve the problem on its own :-) Pressing a "skip" key could simply trigger that code. It's just that no one was willing to do that work for every cutscene.

comment:4 Changed 7 years ago by s10k

«Pressing a "skip" key could simply trigger that code. It's just that no one was willing to do that work for every cutscene.»

You can't press keys in cutscenes I believe (especially the ones with vertical black borders). You would need to remove the black borders and put a chr_wait_animation hook to detect when player wants to skip the cutscene.

Also the bsl needed to edit to play the movies is minimal compared to edit each cutscene manually. It is a trade-off of movies file size / downloading with manual bsl editing work.

comment:5 Changed 7 years ago by Alloc

What's the "fast_mode" thing? If it indeed speeds up cutscenes couldn't we just use that? In that case the only change we'd need to make to all the BSLs would be to disable fast_mode at the end of each cutscene.
Replacing the cutscenes with videos doesn't sound like a very great idea, considering that we probably got like > 30min of cutscenes and if we recorded at 1080p that would be quite some data. Also it would always only fit one specific resolution.

comment:6 Changed 7 years ago by Iritscen

Gumby already used fast mode in his cutscene skipping script, but it was buggy. It would probably make more sense to try to fix his script (if possible) before we considered any other option. I don't recall what issues he ran into, and I don't have time right now to check back in my chat log history, but I'll post more info when I have it (or you guys can just test it yourself :-).

comment:7 Changed 7 years ago by s10k

"Replacing the cutscenes with videos doesn't sound like a very great idea, considering that we probably got like > 30min of cutscenes and if we recorded at 1080p that would be quite some data. Also it would always only fit one specific resolution."

Yes that may be an issue. I just made a fast calculations and if oni had 10 cutscenes of 10 minutes each the user would need about 24GB for cutscenes using oni's video codec @ 1080p.

"What's the "fast_mode" thing? If it indeed speeds up cutscenes couldn't we just use that? In that case the only change we'd need to make to all the BSLs would be to disable fast_mode at the end of each cutscene."

Yes that was what I was thinking about, just with the movie playback in the middle.

Btw I am some ideas in mind for skipping the cutscenes. I will work on it and if I am successful I will post the results here. ;)

P.S. Would be nice to know the problems that Gumby faced while working on this, so I can be aware of them.

Last edited 7 years ago by s10k (previous) (diff)

comment:8 Changed 7 years ago by Iritscen

All that I learned by looking back at old chat logs is that cutscene skipping had a problem with sounds. Maybe it's what the soundstop() function in his script was intended to prevent, by manually stopping any sounds that might still be playing when the cutscene is done being skipped?

Also, I'd forgotten this, but we actually shipped the 2009-07 AE with the skipping script, but immediately removed it in 2009-07a because it was somehow disrupting some cutscenes when they weren't being skipped (I guess since the script overrides existing cutscene-related functions, and something in his replacement functions was not perfectly equivalent with Oni's original internal functions).

Finally, the built-in code that Oni contains for skipping cutscenes (which can be accessed with the Daodan) apparently has the same issue as Gumby's. Both solutions rely on fast mode, yet cause some kind of sound-related issue, like sounds still playing after the skipped cutscene.

Gumby eventually decided that cutscene-skipping would have to be implemented in the Daodan DLL. Personally I don't think that's a good idea, because I don't see how it would make it any easier to implement the feature.

I would suggest that it would be most efficient to stick with BSL, and use a trainer (Alloc's OniTrainer?) to get the locations and other state information about all characters at the end of a cutscene, and then just code those locations/etc. in BSL form. The Daodan can be used to look for key input during a cutscene and then call the appropriate skip function in the BSL.

comment:9 Changed 7 years ago by Alloc

I would suggest that it would be most efficient to stick with BSL, and use a trainer (Alloc's OniTrainer?) to get the locations and other state information about all characters at the end of a cutscene, and then just code those locations/etc. in BSL form. The Daodan can be used to look for key input during a cutscene and then call the appropriate skip function in the BSL.

Hm, sounds like a lot of work though to do this for every single cutscene. Also, how would you interrupt a running BSL cutscene function and how would you know which other BSL function (the "appropriate skip function") to run to match the current cutscene?

If the only issue with the fast_mode is sounds playing after the cutscene (yeah, think I can remember this effect :) ) isn't there a way to just stop all currently playing sounds, either by BSL or Daodan code?
In that case wouldn't my above suggestion work? It would then require a single change to every original cutscene function, stopping fast_mode at their end (and possibly stopping all playing sounds), the Daodan would intercept the appropriate input and enable fast_mode (and possibly kill all sounds after a moment).

comment:10 Changed 7 years ago by s10k

The sounds aren't a problem. I believe I have found one way to skip them.

Iritscen for now I just need to know if the the daodan function to check for a keypress in Windows is currently available for Mac too.

I guess is this one:

«
int d_waitforkey keys
Waits for a keypress from the player
» from here

Right now I have a prototype working but it uses the space bar for jump and uses the chr_wait_animtype 0 jump technique. It is fully compatible with both OS and does not need any daodan extensions.

However if the d_waitforkey function is available at the MacOS side it will make my life much easier to get this working.

comment:11 Changed 7 years ago by s10k

Quick update:

I couldn't get the "int d_waitforkey keys" working in my Windows Oni.

I tried d_waitforkey("z"); dmsg("hi"); in the console and it always display "hi" even if I don't touch the "z" key.

The documentation says that it returns an int but when I put inside a if conditions it says that it doesn't return a boolean neither an int.

So I don't know how to use it or it is broken. Can you check?

comment:12 Changed 7 years ago by Iritscen

I never tried to use the Daodan's added BSL functions because we don't have them on Mac. But see here to refresh your memory :) http://oni.bungie.org/forum/viewtopic.php?pid=39336#p39336

Since your resulting script wouldn't be cross-platform, though, I suggest sticking with chr_wait_animtype.

Note: See TracTickets for help on using tickets.