Creating Cinematics

You can play cinematics in Legend of Grimrock 2 mods using IVF-format for video and Ogg Vorbis for audio, which are played back in sync. Both of the formats can be created with free tools and we use Audacity for exporting Ogg and FFmpeg for IVF (although if you want to, FFmpeg should also be able to handle Ogg as well).

Let’s start off with the video. Once you have rendered your cinematic into a format that FFmpeg can handle (don’t worry, it should be able to use pretty much all common formats), we can convert it to video. FFmpeg is a command line tool so you need to either use command prompt in Windows or console on a Mac. Here’s a command that you can use as a starting point for converting your own video:

ffmpeg -i c:\my_awesome_mod\cinematic.avi -vcodec libvpx -b 3000k -s 1280x720 c:\my_awesome_mod\cinematic.ivf

Modify the parameters to match the file names you want and feel free to modify the compression settings (“-b 3000k”) and resolution (“-s 1280×720″) as well if the cinematic ends up taking too much disk space.

For the audio, we just export a 44.1kHz stereo sound as Ogg Vorbis with a name that matches the name of the video. For example, if your video is named cinematic.ivf, name the Ogg-file cinematic.ogg.

After we have created the .ivf and .ogg files, place them into your “mod_assets\cinematics” -folder and then open the mod in Dungeon Editor. You can start the playback of a video with script so if we want a cinematic that automatically plays when the mod starts, all you need to do is to add a new script_entity into the level that the player starts in and add the following script there:

GameMode.playVideo("mod_assets/cinematics/cine.ivf")

Note that you cannot play videos while in editor so you need to export and play the mod to see how the video works in practice.

Note for Legend of Grimrock 2 Version 2.1.18: When exporting, the editor does not currently package .ivf-files. To work around this limitation, rename your video file to .dds and update your script to match the new filename. This will be fixed in the next version.