aliens

Author Topic: TFTD cutscenes  (Read 15567 times)

Offline BBHood217

  • Commander
  • *****
  • Posts: 540
    • View Profile
TFTD cutscenes
« on: May 16, 2015, 11:54:26 am »
TFTD actually has two kinds of cutscenes: The FMV kind which is of course fully animated 3D CGI scenes (that's obviously outdated by today), and the text kind that's just a slideshow of the aforementioned 3D CGI scenes but with captions that actually give some context to said scenes.  My question is: How will OpenXcom determine which kind of cutscene to play when running TFTD?

Offline myk002

  • Colonel
  • ****
  • Posts: 227
    • View Profile
Re: TFTD cutscenes
« Reply #1 on: May 16, 2015, 10:56:22 pm »
Warboy and I discussed this at some length, and it's implemented already.   See: https://github.com/SupSuper/OpenXcom/pull/1007  The ruleset format is described at the top, and you can see examples in the cutscenes.rul file

Offline BBHood217

  • Commander
  • *****
  • Posts: 540
    • View Profile
Re: TFTD cutscenes
« Reply #2 on: May 17, 2015, 07:47:58 pm »
Neat.  Imagine all the possibilities.

Although did the original Xcom have research cutscenes?

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: TFTD cutscenes
« Reply #3 on: May 17, 2015, 08:19:23 pm »
completing the t'leth research triggers one.

Offline hellrazor

  • Commander
  • *****
  • Posts: 2027
  • Deep Ruleset Digger & Bughunter
    • View Profile
    • Github Account
Re: TFTD cutscenes
« Reply #4 on: May 19, 2015, 02:58:02 pm »
So we can now Mod our own "cutscenes" for Missions or Research stuff?

Offline clownagent

  • Colonel
  • ****
  • Posts: 380
    • View Profile
Re: TFTD cutscenes
« Reply #5 on: May 19, 2015, 11:24:28 pm »
I see this in the ruleset
Code: [Select]
  - type: intro
    useUfoAudioSequence: true
    videos:
      - UFOINTRO/UFOINT.FLI

Is .FLI the only file format one can use as intro or is there also support for .mpg or something similar. I just ask, because .FLI may be difficult to edit.

Or are there any special tools for this?

 

Offline Dioxine

  • Commander
  • *****
  • Posts: 5455
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: TFTD cutscenes
« Reply #6 on: May 20, 2015, 12:48:07 am »
RAD video tools, for example. Allows conversion .gif to .fli, that's for sure. I was using it to mod several old games.

Offline myk002

  • Colonel
  • ****
  • Posts: 227
    • View Profile
Re: TFTD cutscenes
« Reply #7 on: May 20, 2015, 12:51:33 am »
Regarding file format support, the video player used is https://www.libsdl.org/projects/flxplay/ which supports FLC and FLX files (and apparently FLI files).

Offline clownagent

  • Colonel
  • ****
  • Posts: 380
    • View Profile
Re: TFTD cutscenes
« Reply #8 on: May 23, 2015, 02:04:52 pm »
Regarding file format support, the video player used is https://www.libsdl.org/projects/flxplay/ which supports FLC and FLX files (and apparently FLI files).

It seems OXcom only excepts "ufoint.fli" as filename for the intro in UFOINTRO folder.
Changing the filename in the cutscenes ruleset has no effect.
Even if you have "ufoint.flc" as file in the UFOINTRO folder it is ignored. This is different from the way music is handled. There you can replace for example  "gmgeo1.mid" by "gmgeo1.ogg".

It would be good if one could replace "ufoint.fli" by "ufoint.flc", cause this is the format those RAD video tools produce.


EDIT:
If I change the filename of my generated file from "ufoint.flc" to "ufoint.fli" (I think the formats are nearly identical) it is loeded by openxcom. However only the the first frame is shown and after pressing a button there is a crash to desktop. :(
« Last Edit: May 23, 2015, 02:47:54 pm by clownagent »

Offline myk002

  • Colonel
  • ****
  • Posts: 227
    • View Profile
Re: TFTD cutscenes
« Reply #9 on: May 23, 2015, 10:01:46 pm »
It seems OXcom only excepts "ufoint.fli" as filename for the intro in UFOINTRO folder.
Changing the filename in the cutscenes ruleset has no effect.
hrm.. nowhere in the code is "ufoint.fli" hard-coded.  it gets the filename from the ruleset and nowhere else.  Check the openxcom.log file -- did the ruleset file where you overrode the cutscenes: definition get loaded properly?

Quote
If I change the filename of my generated file from "ufoint.flc" to "ufoint.fli" (I think the formats are nearly identical) it is loeded by openxcom. However only the the first frame is shown and after pressing a button there is a crash to desktop. :(
could you send me your ufoint.flc file to me via dropbox?  I can look into it a bit.

Offline clownagent

  • Colonel
  • ****
  • Posts: 380
    • View Profile
Re: TFTD cutscenes
« Reply #10 on: May 24, 2015, 02:36:29 pm »
hrm.. nowhere in the code is "ufoint.fli" hard-coded.  it gets the filename from the ruleset and nowhere else.  Check the openxcom.log file -- did the ruleset file where you overrode the cutscenes: definition get loaded properly?
could you send me your ufoint.flc file to me via dropbox?  I can look into it a bit.

I have done some more testing and this is what I found out:

The reason for most of my problems was that the UFOINT.FLI is always played first, no matter what you specify in a new ruleset. After that your file is played.
If you take a new file with name UFOINT.FLI it replaces the original otherwise you have to watch two intros.

Code: [Select]
cutscenes:
  - type: intro
    useUfoAudioSequence: false
    videos:
      - newintro.FLC

So if you use a new ruleset with the above code. First the normal UFOINT.FLI is played and then newintro.flc (no problem with .flc loading :) )

Other points
1. For the first Openxcom start with the mod enabled the new intro is playing. After I started Openxcom 1 or two times after that it starts crashing at the intro start. After rebooting the computer it works again for the first start, but for the second restart again crash. 

2. If openxcom cannot find newintro.FLC (because you named it newintro.FLI) then you get a crash to desktop.

3. My intro file is played very fast (when it plays), much faster then the animation should be (checked with MPC-HC). Is this changeable by ruleset, or do have to increase the framerate of my file?

file download:
https://www.mediafire.com/download/r3j3424r3045wgo/UFOINT.zip

Offline myk002

  • Colonel
  • ****
  • Posts: 227
    • View Profile
Re: TFTD cutscenes
« Reply #11 on: May 26, 2015, 08:19:38 am »
got it, so the video files are being appended when it should be replacing the list.  also the crash issue.  I'll look into them.  thanks!

Offline sylandro

  • Sergeant
  • **
  • Posts: 18
    • View Profile
Re: TFTD cutscenes
« Reply #12 on: August 27, 2015, 05:27:55 pm »
I've been experimenting with cutscenes for some time now. From looking at the code, I see that the speed the video is played depends on the audio length, at least for FLC files. Since we have no tools to create an FLC file with audio support (all the modern day tools only convert to video-only), videos are played at the same rate which is 1 frame per millisecond, regardless of the headers specified in the file.

Also, i've found out that the implementarion of the FLC player does not fully comply to the standard FLIC specification. For example, TFTD defines its audio chunks in a very different way than it should, it uses 0xAAAA to define an audio chunk and adds 10 bytes after it, while the specification dictates that it should be 0x0038.

https://www.ffmpeg.org/doxygen/0.6/flic_8c-source.html
https://github.com/SupSuper/OpenXcom/blob/master/src/Engine/FlcPlayer.cpp
https://www.compuphase.com/flic.htm

I downloaded an old FLC compiler called EGI that could produce FLC with audio, but the game still does not recognize it because of the custom audio chunk header.

What this means, I guess, is that there will be no way to add a cutscene with audio and a proper playback rate unless the devs tweak a lot with the player code, and it still would be really hard due to the difficulty of finding a compiler that can generate FLC files with audio. I had to install EGI on a Windows XP virtual machine because it is incompatible with modern operating systems.

It would be much easier for both the devs and modders to support mpeg or other format, and leave the FLC player as is for compatibility.
« Last Edit: August 28, 2015, 04:50:38 am by sylandro »

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: TFTD cutscenes
« Reply #13 on: August 27, 2015, 05:50:29 pm »
Why not just make a video-only FLC with a separate audio track backing it, like in UFO?

Offline sylandro

  • Sergeant
  • **
  • Posts: 18
    • View Profile
Re: TFTD cutscenes
« Reply #14 on: August 27, 2015, 06:06:18 pm »
Quote
Why not just make a video-only FLC with a separate audio track backing it, like in UFO?

How can I do this? As far as I know there is no way of adding separate audio playback in the cutscene rulesets....
« Last Edit: August 28, 2015, 04:42:48 am by sylandro »