adventuregamestudio / ags

AGS editor and engine source code
Other
695 stars 158 forks source link

Feat. req. Add Opus format support #1224

Open necros2k7 opened 3 years ago

necros2k7 commented 3 years ago

subj

ivan-mogilko commented 3 years ago

If addressed, this has to be split into two separate tasks because first refers to format support in the engine and second, apparently, to a Editor's function.

Personally, I doubt if adding resource conversion to AGS Editor is a good idea, as there must be existing tools dedicated for such task.

rofl0r commented 3 years ago

i don't see much point in this tbh, as opus compression is only like 15% better than ogg vorbis, but it would add a new dependency. game authors would still default to stuffing their audio files in the setting they recorded it into the game, because they either don't understand what's making their games so big or they just don't care ("i got a 3 TB hdd, so my users probably do too").

necros2k7 commented 3 years ago

If addressed, this has to be split into two separate tasks because first refers to format support in the engine and second, apparently, to a Editor's function.

Personally, I doubt if adding resource conversion to AGS Editor is a good idea, as there must be existing tools dedicated for such task.

There must be , but not in front of authors` nose to make it optimize game or recommend at least)

rofl0r commented 3 years ago

in front of authors` nose

thinking about that in context of #877, maybe it would be a good idea to show a statistics screen after a compile finished with a cake diagram listing the complete size of all the game resources and how much of that is used by sprites, audio, speech etc, and a hint that size could be reduced substantially by re-encoding the assets with ffmpeg as proposed in the agsutils README.

AlanDrake commented 3 years ago

I would shoot down this feature request, the only case where it makes sense to convert the audio format automatically would be for WAV -> FLAC. Converting what may already be lossy to lossy is just bad form. Also there may be side-effects from changing formats when it comes to audio positioning, looping, etc.

ivan-mogilko commented 3 years ago

@AlanDrake this feature request consists of two parts, only second is about converting. I'd propose to view these as two separate requests, second depending on the first.

EDIT: actually I'd propose to edit this ticket and keep only first request (format support), then if still wanted make a separate ticket for the second. Or close this and open two new ones. As there are already comments regarding optimizing game size, not directly related to format support. And to elaborate on my position here, there are various ways to reduce sizes of resources, audio in particular, if we add just an option to convert everything to OPUS that would be very random and inconsistent. Why not then add an option to convert WAV to OGG? Or convert reducing audio bitrate? Maybe then we should talk about whole menu for configuring output sound format.

ericoporto commented 3 years ago

For the particular case of decoding and playing sound in the Engine, there could be some places in the plug-in system you could hook up and do bits through it, in this way additional sound formats could be plugins, while leveraging the packaging and handling of sound files already provided by the engine.

There's a somewhat "similar" approach now for drawing text where there are things you should plug to in the plug-in system.

rofl0r commented 3 years ago

plug-in system

didn't we decide a long time ago that plugins are bad? it will throw us back 20 years when people wrote WinAPI specific plugins that had to be reverse-engineered for this very engine so people on other platforms can play the game too.

ivan-mogilko commented 3 years ago

didn't we decide a long time ago that plugins are bad

No, I would not say that we decided that. (depends on who "we" is, of course)

E: It's true that system-specific plugins are inconvenient. Also existing plugin API is not well suited for all wanted purposes. But I would not agree that having a plugin system is bad on its own.