MaKiPL / OpenVIII-monogame

Open source Final Fantasy VIII engine implementation in C# working on Windows and Linux (Android and iOS planned too!) [Monogame]
MIT License
637 stars 58 forks source link

CD 2000 movies aren't installed automatically #96

Open Sebanisu opened 5 years ago

Sebanisu commented 5 years ago

Movies are on 4 cds in PAK files So 3 options

  1. Need to extract files to movies folder and name them similar to how steam does it.
  2. Copy the PAK files to movies folder and read them into ram and play the movies from ram.
  3. Detect CD in drive and read the PAK files from drive into ram, and prompt user to change disc when needed.

I think option 1 is the easiest. Our code can already playback the extracted videos. It's just an issue of time. Toolset can only extract one movie at a time and you need to manually name them correctly. I suggest if we go with option 1 we need to write a script to do this for the user. I was thinking of providing one to the python toolkit project.

Sebanisu commented 5 years ago

I'm just gonna give them a small program to unpack to pak files if someone else wants to write a change cd screen they are welcome to it.

Sebanisu commented 5 years ago

Using the toolset's class as a blueprint. I made a PAK class and put it in a PAK extractor project. The PAK class could be moved into the Core project. The default behaviour is to use the Core to detect where FF8 is installed and extract all the videos and cam files into the ff8/data/movies folder. They will use the same name scheme as the steam version of the game. disc00_00h.bik So they will should be detected the same way as they are for the steam version. The only thing missing is the video version of the square logo. There is a static square logo that could be drawn instead. It's in the same place as the overture images.
If we still want to read the video files directly from the PAK or even the CD disc it's possible. The code in the program.cs of the PAK extractor, detects the CD drive and scans for a PAK file. The PAK class detects the offsets and sizes for each video. The only thing missing is the reading of the video into ram and the code for ffmpeg to read a video from ram. Though part of the code exists in reading the audio data from ram. Video and audio just work a little differently.
I'm gonna close this. If someone wants to expand on it feel free to reopen.

Sebanisu commented 5 years ago

From Discord: "i'm kind of brainstorming. since the movies are in the ZZZ file much like the PAK file... I'm probably better off figuring out a way to playback the nested video files." I'm going to reopen this.

So it's an issue that exists in 2000 and remaster. Where the videos aren't their own files. So to fight this. I'll need to take the code that is used to play sounds from ram and make it work with streams. This way I don't have to dump the video into ram just to play it back. The idea is the code that reads bytes from ram could be pointed to read the same way from a generic stream. Then I can send any stream type I want to it.

I'll also have to have code that scans the zzz files and pak files to know what videos we have access too. I could even read the video directly from the cd. Though that could be problematic depending on which discs are detected you'd have different videos.