General "Play Audio" command sound delay

Makorie

Villager
Member
Joined
Dec 9, 2020
Messages
6
Reaction score
0
First Language
English
Primarily Uses
RMMZ
Hello,
After a bit of testing, I noticed a delay when using "Play [BGM or BGS]" commands, and the audio starting. The amount of time varies a little per track; while it is never over one second, the delay is noticeable, and can interfere with general timing when it comes to programming cutscenes.

Is this currently a known issue for RPG Maker MZ, with any solutions or alternatives? I believe a similar issue existed for MV, though it might have been more severe. (Please let me know if footage of the audio delay would be helpful.)
Thank you.
 

WilsonE7

Veteran
Veteran
Joined
Oct 12, 2019
Messages
109
Reaction score
42
First Language
English
Primarily Uses
RMMZ
This is a common issue and gets worse the longer the BGM track is. The tracks are loaded when called by the event, so there is naturally a delay. I don't know of anything that solves the problem completely, but if timing's all you're concerned about, I use a free plugin called Ignis Sound Synchronizer. You use a Loop command, inside of which is a conditional branch with this script as its condition:
Ignis.SoundSynchronizer.SoundLoaded
If true, break loop. This will cause all event processing to wait until the sound is loaded before continuing. Sure, there will be some delay, but everything will be timed right. I find it's very effective.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
33,723
Reaction score
8,508
First Language
German
Primarily Uses
RMMV
as said above, this problem is based on the fact that any file needs to be loaded completely before it can be used. That is why the streaming formats were developed for the internet, but unfortunately MV and MZ can't use streaming like that.

There are exactly two things you can do to reduce loading lag:
either make the audio shorter (and smaller), or use a preload plugin.

Preload plugin allow you to tell the computer "I need that file in ten second, please load it so that it is ready when I need it". Unfortunately that comes with a cost: a higher RAM usage and a partially blocked garbage collector (that is the name of the function that usually clears unused RAM for use by new files).

So you'll need some experimenting to learn how to use a preloader correctly and to prevent memory leaks and getting processing lag in place of loading lag.
 

Latest Threads

Latest Profile Posts

It's a shame that Selection Control will not be ported to MZ. I found a neat way of using it to enable ways for tanks to protect squishies. lol
Lately I have been taking a break from game and resource making so I won't get burnt out. But I am also interested in the Game Jams this site periodically holds. It'd be great if I knew when the next one, if any, is planned.
elexy 1.2.pngSome bust art to be cropped and cleaned. May use in special decision moments. Depending on how it looks in game I may cut it.
Tiamat-86 wrote on ATT_Turan's profile.
apparently since its turning 15 years old this year the ps3 is considered "retro". now how old do you feel?
guess that means im an "antique" gamer since ill still play games as old as i am.
"you know your getting old when your childhood console changes ethnicity" lol it turned yellow
I'm making Toilet in Wonderland 2. and tell vinny about it lol

Forum statistics

Threads
115,350
Messages
1,089,188
Members
150,026
Latest member
Ven_0
Top