dkfans / keeperfx

Open source remake and Fan Expansion of Dungeon Keeper.
https://keeperfx.net/
GNU General Public License v2.0
778 stars 78 forks source link

Allow images as campaign intro/outro in place of videos (or support better video formats). #2490

Open Spatulade opened 1 year ago

Spatulade commented 1 year ago

(Just putting this here as this was discussed earlier today)

Campaigns currently support .smk files for the intro and outro, but these files are very difficult to make. One thing that may work as a compromise could be to support static images as well.

Hopefully it is possible to either bypass this or use the code for the splash screens. Currently splash screens use their own separate palettes, but it is probably enough to allow the standard ingame palette for these images.

Alternatively, maybe it will be possible to use a newer, easily and freely available video file format (assuming there is an easy way to ensure such a video file has the right settings and restrictions to work inside the game, as it presumably has a limit to the number of simultaneous colours per frame).

xtremeqg commented 1 month ago

A major limiting factor to supporting other video formats is that the draw surface is 8-bits. Meaning that each individual frame has to be converted down to 8-bits. With a fixed palette this is somewhat doable but if you want (somewhat) accurate colors, a palette has to be generated for each frame. It is very likely the CPU will not be able to keep up.

I've just created #3573 which adds ffmpeg support though currently it is limited to smacker videos. Making it play other formats however is not difficult but you'd run into the same 8-bit surface issue.