• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Cinematics out of sync

Status
Not open for further replies.
Level 2
Joined
Oct 20, 2022
Messages
2
Hi!

First post here guys :), looked around the forums but couldn't find any good info on the matter.

I'm making a multiplayer game that involves cinematics, so far so good.

When I started making the map I used waits to sync dialouges and actions along with the audio files.
That worked okay for a while as the cinematics were short even if they sometimes became slightly out of sync when I used a lot of waits in the trigger.

I first ran into a problem when I started making longer cinematics (1-2 min long audio files), those got out of sync by 1-3 seconds which was just too much.
After doing some research I learned that waits aren't very accurate and that timers should do the trick.
So I remade the triggers and replaced waits with timers and it worked great, everything was timed PERFECTLY... until I tested it online.
For some reason it became out of sync again, more and more the longer the cinematic was.

Online, the game seems to run a bit slower than the audiofiles, and I guess that could be some latency related problem?

Is there any way to prevent this? Anyone that knows a good system to set this up so that audio files and dialouges stay in sync when playing online?

Thanks in advance for any help :)
//ProfessorBright
 
Level 25
Joined
Sep 26, 2009
Messages
2,378
Rather than having a single long file and try to sync the entire game to it, you should split the file into multiple smaller files and play them at appropriate times via triggers.
Also, the default 'Wait' action is inaccurate - even if you set wait for 2.0 seconds, the actual wait may range between ~1.7 and ~2.3 seconds. For multiplayer maps the actual wait is different per player and may also be prolonged by latency.
The standard approach for exact waits is to use Timers (but then again, you have to create a trigger with event Timer - Timer expires which will complicate the entire cinematic).

Anyway, I think your best bet is to really split the large file into smaller segments, try it with them and see if the inaccurate waits present an issue for your map.
 
Level 2
Joined
Oct 20, 2022
Messages
2
Thanks for reply!

I did redo the whole cinematic with timers and that worked great, but then again the problem came back as I tested it online. So I guess there's something going on with latency/ping issues?

Anyways if there is no workaround I was thinking the same thing that I may need to split the audio which is a headache.
The reason I put it all in one audio file is because there are so many sounds put into it like footsteps, punches, crashes and so on. It also has music written to it which makes it a lot harder to work with as everything needs to be in sync to that.
 
Thanks for reply!

I did redo the whole cinematic with timers and that worked great, but then again the problem came back as I tested it online. So I guess there's something going on with latency/ping issues?

Anyways if there is no workaround I was thinking the same thing that I may need to split the audio which is a headache.
The reason I put it all in one audio file is because there are so many sounds put into it like footsteps, punches, crashes and so on. It also has music written to it which makes it a lot harder to work with as everything needs to be in sync to that.
The thing is that the audio is played "locally" (without synchronization with other players in multiplayer). This means the only point you can be sure the audio is at the time-point you expect is exactly when you order it to start.

In multiplayer, there is a "synchronization" between all players basically all the time, adding some time for the "game triggers" to actually occur (depending on ping/lagg). Note that even when it isn't "lagging", you have a some milliseconds of ping anyways.
This "synchronization" adds a few milliseconds here and there and the timers will "drift" from the audio (as you've noticed).

The "correct way" is to split the music from the conversation and have each conversation-part as its own audio-file that you start after timers.
If the music should change at some point, you can cross-fade it (but you'll need to do it manually with triggers as far as I know, can you cannot use "music" for those sounds).

There is a "workaround" by using "Sound - Skip to Sound Offset" (I expect that you're not using 3d sounds for cinematics) where you can set where in the audio-track you should continue from. This will cause some audio "glitches" though and therefore a "bad solution", but could solve the problem of making the audio and cinematic sync:ed.
 
Status
Not open for further replies.
Top