Author Topic: Cutscene Help  (Read 4849 times)

Offline Smoke39

  • Endtrail
  • ****
  • Posts: 202
  • T:REP 597
    • View Profile
Cutscene Help
« on: September 27, 2017, 03:56:16 AM »
I have a scope mostly working by using a cutscene to change the FOV, and making the camera move along with the player.  There are two technical problems, though:

1. Sector properties are not updated when moving from one sector to another (e.g., fog color and distance don't change when entering/exiting a cave).  This one's not so bad, since players are unlikely to move too far while scoped anyway.  I could also disable the scope if you move too far, if I really wanted to minimize the issue.

2. Level geometry occlusion doesn't always update.  So, for example, if you zoom in, then walk around a corner, any level geometry that was originally blocked will still not be rendered (screenshot).  I think I've only seen this happen on level 5 (even the corridors of level 8 seem fine), but it's a pretty big error to expect players to just re-scope and ignore.

Currently, as a workaround, I have it so you can't move while zoomed in.  If you try, it just deactivates the scope.  This isn't terrible, but it's kinda clunky and feels like a lame compromise.

Anyone have any idea if there's some "proper" way to update the camera so sector properties and level occlusion actually get updated?  Here's how I'm doing it currently:

when activating the scope:
Code: [Select]
Camera.StartCinematic( CMF_NO_LETTERBOX | CMF_SHOW_HIDDEN_OBJECTS | CMF_NO_INITIAL_FADEOUT );
// at least one of these allows camera position to be updated in OnTick() after key acquisition cutscene
Camera.ClearLookAtActor();
Camera.ClearFinalView();
Camera.ClearViewTracks();

in OnTick(), while scope is active:
Code: [Select]
kStr s;
if ( Sys.GetCvarValue("r_fov",s) )
Camera.fov = s.Atof() / ScopeMag;

kPuppet @owner = self.Owner().Actor();
// update camera orientation
Camera.origin    = EyePos();
Camera.pitch     = owner.Pitch();
Camera.roll      = owner.Roll();
Camera.yaw       = owner.Yaw();

I tried using Camera.SetEyeView() to see if it would more robustly update the camera's position, but it did nothing on its own, and fixed neither issue when used in conjunction with setting Camera.origin.  I've also messed with some other camera functions, but haven't been able to get them to even do anything. :/

Offline Badger

  • Endtrail
  • ****
  • Posts: 219
  • T:REP 772
    • View Profile
Re: Cutscene Help
« Reply #1 on: September 27, 2017, 10:56:49 AM »
Quote
2. Level geometry occlusion doesn't always update.  So, for example, if you zoom in, then walk around a corner, any level geometry that was originally blocked will still not be rendered (screenshot).  I think I've only seen this happen on level 5 (even the corridors of level 8 seem fine), but it's a pretty big error to expect players to just re-scope and ignore.

Having worked with cutscenes briefly, all the other code for stuff loading stuff is still relative to turok himself, not the camera. You probably have to have the game itself render more chunks to fix.

Number 1 sounds pretty bad. Does this mean you'd be able to skip triggers?

Offline Rok

  • Global Moderator
  • *****
  • Posts: 633
  • T:REP 1968
    • View Profile
Re: Cutscene Help
« Reply #2 on: September 27, 2017, 01:13:48 PM »
A scope feature sounds cool! Like in T2. Wish I could help :(
Raptor Rok is metal.

Offline Smoke39

  • Endtrail
  • ****
  • Posts: 202
  • T:REP 597
    • View Profile
Re: Cutscene Help
« Reply #3 on: September 27, 2017, 02:08:38 PM »
Having worked with cutscenes briefly, all the other code for stuff loading stuff is still relative to turok himself, not the camera. You probably have to have the game itself render more chunks to fix.

Number 1 sounds pretty bad. Does this mean you'd be able to skip triggers?

Well, the player still moves like normal (CMF_LOCK_PLAYER is omitted from StartCinematic()).  Buttons, checkpoints, save totems, and enemy ambushes still work, so it seems to me like it's just rendering stuff that gets locked in when starting a cutscene, unless there's some way to signal a refresh we don't know about.

I considered "restarting" the cutscene to force a refresh, but CinematicState() doesn't return a reference, so as far as I can tell we can only skip the fade out with StartCinematic() flags, not the fade in.

A scope feature sounds cool! Like in T2. Wish I could help :(

Well, like I said, I have a workaround in place, so it's really just a matter of whether you can move while scoped or not.  Do you think the feature would be worth it if you unscoped any time you moved?

Maybe I'll put together a preview so y'all can try it out first.  I've been thinking about putting one together for another experimental feature, anyway.

Offline BehemothProgrammer

  • Endtrail
  • ****
  • Posts: 224
  • T:REP 791
    • View Profile
Re: Cutscene Help
« Reply #4 on: September 27, 2017, 09:36:20 PM »
I remember trying to do a third person thing before. I was only able to Start the cinema again after a certain distance with the fade in effect playing everytime in order to update the static meshes/sectors. Maybe another thing you could try is positioning the player where you're zooming in and try to get it to look like it's zooming in and not use the Camera, but there's no way to change the fov that way...idk. Or just live with it, I'm sure most of the time people won't walk around always scoped. They're more likely to stand or more around a bit in the same area in order to shoot the enemy in the distance then no scope when they got him. I'd probably go with call StartCinema when player moved a certain distance as the best choice I know of to keep scoped movement.
Turok 2 Co-Op Mod

QTurok | Turok: Mountain of the Sun | WolfenTurok 3D | and more...

Offline Jay Doomed

  • Global Moderator
  • *****
  • Posts: 803
  • T:REP 2632
    • View Profile
Re: Cutscene Help
« Reply #5 on: September 28, 2017, 04:09:13 PM »
I agree with bp not many people will be walking while scoped lol. I say do it!! :)
"Whatever it is, it doesn't belong in this world."

Offline Smoke39

  • Endtrail
  • ****
  • Posts: 202
  • T:REP 597
    • View Profile
Re: Cutscene Help
« Reply #6 on: September 28, 2017, 04:29:31 PM »
I'd probably go with call StartCinema when player moved a certain distance as the best choice I know of to keep scoped movement.

I considered something similar, but it doesn't take much movement to reveal big holes in the level.  On the other hand, there aren't a whole lotta places you'd even want to use a scope on level 5, and it seems to be the only level with problems.  Maybe I'm worrying too much about an edge case?

Anyway, I've mocked up a few different methods and posted them, along with the other feature I alluded to, in the Turok+ thread for y'all to try out for yourselves.  Le'me know what you guys think.

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal