Skip to content

fix: NPCs wait while a video plays (Xardas' subtitle over the addon intro) - #550

Open
BoroBongo wants to merge 1 commit into
developfrom
fix/video-blocks-npc-ai
Open

BoroBongo wants to merge 1 commit into
developfrom
fix/video-blocks-npc-ai

Conversation

@BoroBongo

Copy link
Copy Markdown
Contributor

What

While a video plays (VR cinema), the NPC AI waits: no queued action starts, no state loop or perception runs. Like in the engine, where PlayVideo blocks the whole game, the dialog continues after the video.

Player-visible: in Gothic 2, Xardas' option about the addon intro (DIA_Addon_Xardas_AddonIntro) plays Intro_ADDON and then a line of Xardas. That line started 30 ms after the video, while the cinema had already paused the world (Time.timeScale = 0). The paused world never ended the line, so its subtitle stayed in front of the video the whole time.

  • AiHandler.Update returns early while Time.timeScale == 0 (only the cinema sets it).

Why

Found in a G2 playtest on develop (PCVR build), log:

[PlayVideo] Intro_ADDON
Player locks: Cinema (blocked: All)
[VRCinema] Playing ...\Intro_Addon.bik
[Dialog] Xardas says 'DIA_Addon_Xardas_AddonIntro_Add_14_10' (audio, 6.7 s)

How to test manually

  • G2 new game: talk to Xardas and pick the option that plays the addon intro video. No subtitle in front of the video; after the video (watched or skipped) Xardas says his line with its subtitle, and the dialog goes on.
  • G1/G2 chapter change video (e.g. a G1 chapter start): NPCs around continue normally after the video, the hero isn't stuck.
  • The intro video of a new game: the first dialog/routines start normally after it.

Save/load

No new state.

Known gaps / follow-ups

  • A line that already plays when a video starts keeps its subtitle during the video (script-wise the video comes before the line in the cases seen so far).
  • Flat mode has no cinema and doesn't pause - unchanged.

…das' addon intro) no longer covers the video with its subtitle

The cinema pauses the world (timeScale 0) like the engine, where the video blocks the game, but AiHandler kept starting queued actions. DIA_Addon_Xardas_AddonIntro plays Intro_ADDON and then a line: it started during the video, the paused world never ended it, so its subtitle stayed on the screen in front of the video. The AI now waits until the video ends.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant