Page 1 of 2

Problem with video sequence

Posted: 22 Jun 2017, 06:56
by Berserk Cyborg
I can not get cam2diif.ogg to play not matter what I try. It's as if it does not exist and is completely skipped altogether. I have not found any documentation on how the message brief files are interpreted other than analyzing the patterns from the other files. Any idea how to make it play? Once it plays I am ready for testing to be done with the new campaign research fix and the difficulty modifiers in my usual branch (after doing some squashing).

Re: Problem with video sequence

Posted: 16 Jul 2017, 23:35
by Per
Did you figure this out?

The message code is some of gnarliest, most horrible we have left now, and the interface to it is pretty horrid, too. It can be pretty hard to figure out what is going wrong in it.

Re: Problem with video sequence

Posted: 19 Jul 2017, 21:54
by Berserk Cyborg
Unfortunately, I have not found a solution so far. I did try putting it on its own line in base/messages/brief2-dii.txt and modifying the 2-end script to include it, but it just plays the one after it instead.

it plays brfcom4s.ogg and cam2/c2diif2.ogg just fine in:

Code: Select all

MB2_DII_MSG,0,1,3,brfcom4s.ogg,1,TRANS_MSG1,0,0000,cam2/cam2diif.ogg,3,CAM2_DII_MSG1,CAM2_DII_MSG2,CAM2_DII_MSG9,0,0000,cam2/c2diif2.ogg,1,CAM2_DII_MSG1,0,0000
Edit:
I noticed that it might actually be playing for a very brief moment now. It lasts long enough to see the subtitles in the video (nothing else) and then it abruptly ends and moves onto the next sequence.

Re: Problem with video sequence

Posted: 25 Jul 2017, 21:55
by Berserk Cyborg
Here is what I discovered so far:

Code: Select all

error   |02:28:44: [seq_Play:496] starting playback of: sequences/cam2/cam2diif.ogg
error   |02:28:44: [seq_InitOgg:452] seq_InitOgg

error   |02:28:44: [seq_Play:636] Ogg logical stream 987d523 is Theora 320x240 12.50 fps video
error   |02:28:44: [seq_Play:660] Ogg logical stream 28797b16 is Vorbis 1 channel 22050 Hz audio

-----MISSING--------
error   |02:28:40: [audio_write:441] starting source
error   |02:28:41: [audio_write:424] Audio sync
--------------------

error   |02:28:44: [seq_Shutdown:912] seq_Shutdown
error   |02:28:44: [seq_Shutdown:960]  **** frames = 0 dropped = 0 ****

error   |02:28:44: [seq_Update:856] video finished
error   |02:28:44: [seq_Shutdown:912] seq_Shutdown
error   |02:28:44: [seq_Shutdown:916] movie is not playing

The only thing I see not being output is the messages "starting source" and "Audio sync". The other sequences show them so it is probably related to it being skipped.

Edit: Well, I found a way to play it after all. Hate to include another hack into the source, but it does finally play with the diff below.
sequenceFix.diff
(1.36 KiB) Downloaded 49 times

Re: Problem with video sequence

Posted: 26 Jul 2017, 21:06
by Per
Is there some easy way for me to reproduce this issue?

What I'd do is just sprinkle seq_Play() with debug() calls, and see what happens. I guess it is not playing the audio for some reason, and that the video is timed on the audio somehow.

Also, how do you play the video? I notice that the old wzscript has some video play functions that qtscript doesn't.

Re: Problem with video sequence

Posted: 26 Jul 2017, 21:29
by Berserk Cyborg
Try hackAddMessage("MB2_DII_MSG", MISS_MSG, CAM_HUMAN_PLAYER, true). That is the general form I have seen and been using. I prefer to put all of them in an array and use an index var in conjunction with eventVideoDone() until it reaches the last one.

Re: Problem with video sequence

Posted: 28 Jul 2017, 21:48
by Per
I started looking at the message code, and had to clean it up a bit to avoid going insane. Please consider reviewing and/or testing my changes before I push them:https://github.com/perim/warzone2100/co ... 5787064c8a

With this commit, there will be a tab in the debug menu to see all currently defined messages.

Next step, I'm thinking of adding a qtscript function to load message files, that way we don't need them in the resource system, and you can more easily test stuff (don't need to be in the correct level to just load up a video using the debug menu, for example).

Re: Problem with video sequence

Posted: 29 Jul 2017, 20:12
by Berserk Cyborg
By defined does that mean only the ones that have played so far? I see that CAM2_OUT is missing in the debug tab in the final Beta mission.

Regarding Beta-end: In transport.cpp line 1129 there is a possibility to break any mission with the safety flag being true. It keeps firing the transport exit event and will prevent an idle transport from exiting the map should the player have no droids on map... leaving the mission unbeatable. Is that whole if block necessary anymore?

Re: Problem with video sequence

Posted: 30 Jul 2017, 13:51
by Per
Berserk Cyborg wrote:By defined does that mean only the ones that have played so far?
Yes. I just pushed another tab to the debug menu, that shows the loaded 'viewdata', which is what you typically use to create new messages.

I'll have a look at the transport code.

Re: Problem with video sequence

Posted: 30 Jul 2017, 16:13
by Per
Berserk Cyborg wrote:Regarding Beta-end: In transport.cpp line 1129 there is a possibility to break any mission with the safety flag being true. It keeps firing the transport exit event and will prevent an idle transport from exiting the map should the player have no droids on map... leaving the mission unbeatable. Is that whole if block necessary anymore?
I've no idea how that code works, but it has been like that since forever. I think much of this logic should just be moved into scripts.

If the campaign works fine without this code, then feel free to remove it.

Re: Problem with video sequence

Posted: 01 Aug 2017, 17:57
by Per
Berserk Cyborg wrote:Try hackAddMessage("MB2_DII_MSG", MISS_MSG, CAM_HUMAN_PLAYER, true). That is the general form I have seen and been using. I prefer to put all of them in an array and use an index var in conjunction with eventVideoDone() until it reaches the last one.
This is what works for me:

I add
file SMSG "brief2-dii.txt"
to the bottom of data/base/wrf/cam1.wrf, then start CAM1A. In the debug menu, tab Contexts, subtab cam1a:0 tab, I type in
hackAddMessage("MB2_DII_MSG", MISS_MSG, 0, true)
then hit 'Run'. It runs fine.

Re: Problem with video sequence

Posted: 01 Aug 2017, 19:54
by Berserk Cyborg
Does not work as it should... at least for me. It still skips the video showing Alpha base destroyed without the diff I uploaded a few posts above. There must be some initial delay that this sequence has that is longer than most other sequences when reading in data.

Re: Problem with video sequence

Posted: 11 Feb 2018, 16:38
by Per
Is this still a problem?

Re: Problem with video sequence

Posted: 11 Feb 2018, 16:42
by Berserk Cyborg
It appears to only affect the low res video sequences (only two sequences). #4726.

Re: Problem with video sequence

Posted: 11 Feb 2018, 17:19
by Per
Berserk Cyborg wrote:It appears to only affect the low res video sequences (only two sequences). #4726.
Oh, broken sequences? That's not good. I wonder if we can get away with having only high-res these days?