Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Sound going out of sync
Sound going out of sync
Feb 18 2011, 8:41 am
By: Oh_Man  

Feb 18 2011, 8:41 am Oh_Man Post #1

Find Me On Discord (Brood War UMS Community & Staredit Network)

I have noticed that my sound has gone slightly out of sync for my map. I haven't touched the sound triggers at all so I am curious as to what is causing this.
My hypothesis so far:
>as I add more triggers to the map it eventually makes death counts take a little bit longer. The more and more triggers I add the more noticeable the desync becomes.
>I have added a couple of 0 second waits for some triggers, that causes the sound to go out of sync?

Are any of these hypotheses sound, or is it a completely different issue?

ANOTHER QUERY
I have another query as well. I am adding ambience sound into my map. Naturally, I want longer sound files so the ambience isn't repetive, which kind of defeats the purpose of it. However, there is different ambience for different areas, and I don't want someone walking out into the wilderness and having to listen to the city-ambience for 50 seconds until it runs down. I am thinking of splitting one sound file into five 10 second files, to combat this problem. Would this be an effective solution? Or is there better solutions?

Thanks,
OhMan.




Feb 18 2011, 8:49 am Ahli Post #2

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

wait 0 should be the problem, yes.

@2nd problem,
splitting the music into smaller parts and control them is already the best solution since we can't cancel currently played sounds...




Feb 18 2011, 9:25 am Gigins Post #3



Quote
>I have added a couple of 0 second waits for some triggers
Don't do that, it's bad for you. :omfg:



None.

Feb 18 2011, 9:47 am Oh_Man Post #4

Find Me On Discord (Brood War UMS Community & Staredit Network)

So I should never, ever use 0 second waits? I was told in a previous thread that they were allowable with hyper triggers. If I just modify the DCs for the music everytime I add 0 second waits there shouldn't be a problem, right?




Feb 18 2011, 9:51 am payne Post #5

:payne:

Quote from name:private_parts
So I should never, ever use 0 second waits? I was told in a previous thread that they were allowable with hyper triggers. If I just modify the DCs for the music everytime I add 0 second waits there shouldn't be a problem, right?
You misunderstood I guess. As far as I remember, having hyper triggers implies that you should do your best to try to avoid Waits. :/



None.

Feb 18 2011, 10:02 am Ahli Post #6

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

Do you have waits in the music system?

Remember, each player can only work on ONE wait at a time.
Having the waits in other systems should be ok.

And having wait 0 at all isn't a problem with hypertriggers as long as they wait the same time. Just make sure that the hypertrigger is at the end of the trigger list because else you would have huge wait blocks.




Feb 18 2011, 11:35 am NudeRaider Post #7

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Just to make sure, with sound out of sync you mean the music not looping perfectly anymore (overlapping, or slight gap), right?

Uhm I can see 2 causes for this. One has already been discussed: The wait(0). You can use wait(0)'s as long as you know what you're doing. That is the trigger with the wait is above the hyper triggers (if that player owns any). And you have to keep in mind that the wait(0) delays only(!) the actions below the wait in the same trigger by 1 trigger loop. So if the trigger with the wait isn't music related you must not add to your music dc.

The other thing that comes to mind is that the trigger loop is taking slightly longer real-time to be computed. But this is very miniscule and would only be noticeable if your music/sound loop is very long or you've added a lot of actions known to be able to cause lag (usually something involving units: modify HP, create, kill, etc.) -- or just thousands of triggers of any kind.




Feb 18 2011, 12:07 pm Oh_Man Post #8

Find Me On Discord (Brood War UMS Community & Staredit Network)

Quote from NudeRaider
Just to make sure, with sound out of sync you mean the music not looping perfectly anymore (overlapping, or slight gap), right?
Correct.

Quote from NudeRaider
Uhm I can see 2 causes for this. One has already been discussed: The wait(0). You can use wait(0)'s as long as you know what you're doing. That is the trigger with the wait is above the hyper triggers (if that player owns any). And you have to keep in mind that the wait(0) delays only(!) the actions below the wait in the same trigger by 1 trigger loop. So if the trigger with the wait isn't music related you must not add to your music dc.
My hyper triggers are with Player 8, the last on the list. Player 8 is a computer player with no other waits in its trigger lists.
The waits with 0 seconds are in P1, 2, & 3. The music triggers are in there as well.

Quote from NudeRaider
The other thing that comes to mind is that the trigger loop is taking slightly longer real-time to be computed. But this is very miniscule and would only be noticeable if your music/sound loop is very long or you've added a lot of actions known to be able to cause lag (usually something involving units: modify HP, create, kill, etc.) -- or just thousands of triggers of any kind.
And to solve this problem I would add DCs to my music trigger, right?




Feb 18 2011, 1:30 pm Roy Post #9

An artist's depiction of an Extended Unit Death

Quote from name:private_parts
Quote from NudeRaider
The other thing that comes to mind is that the trigger loop is taking slightly longer real-time to be computed. But this is very minuscule and would only be noticeable if your music/sound loop is very long or you've added a lot of actions known to be able to cause lag (usually something involving units: modify HP, create, kill, etc.) -- or just thousands of triggers of any kind.
And to solve this problem I would add DCs to my music trigger, right?
If this was the problem, it wouldn't matter if you used DCs or Waits, you'd still need to adjust the music due to the lag.

I've had death count timers be varying in length when using them for lengthy music files and using wait actions in other triggers.

If you're going to split the sound into multiple files, this problem will likely be less noticeable. For my Super Mario SC map, I ended up splitting the level music into roughly-one-second clips (making about 50 wav files for it) and it worked really well. If there's a persistent lag, the music will be choppy, like if you were jogging with a CD-Player. If there's a lag spike, however, the pause happens immediately and then the music continues.

Your problem is most likely caused by the Wait(0) actions, as mentioned above, so converting the music to use death counters may be all you need to do to fix the issue. If you're planning on splitting the wav files, you'll have a good number of triggers dedicated to music.




Feb 18 2011, 3:42 pm NudeRaider Post #10

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Quote from name:private_parts
My hyper triggers are with Player 8, the last on the list. Player 8 is a computer player with no other waits in its trigger lists.
The waits with 0 seconds are in P1, 2, & 3. The music triggers are in there as well.
This is a bit tricky because it depends on whether you reset the dc before or after the wait.
Suppose you have a 100 dc long music and you count from 0 to 100, I'd recommend you check for 99 in the condition and reset the dc to 0 after the wait. Because then it'll be reset and played right at the 100th dc count. This saves you the trouble to bother with modifying your dc counter.


Quote from name:private_parts
Quote from NudeRaider
The other thing that comes to mind is that the trigger loop is taking slightly longer real-time to be computed. But this is very miniscule and would only be noticeable if your music/sound loop is very long or you've added a lot of actions known to be able to cause lag (usually something involving units: modify HP, create, kill, etc.) -- or just thousands of triggers of any kind.
And to solve this problem I would add DCs to my music trigger, right?
No. Think about it. The music is playing while the game is halted, computing the next trigger loop. So the music will be finished relatively sooner, which means you need to subtract from your dc. This is also obviously dependent on your CPU, or rather the weakest CPU of all players. So this will differ from game to game. But again, this should really only be noticeable in extreme cases.




Feb 19 2011, 7:10 am The_UrChai Post #11



Quick question. Wait(0)'s are bad for hyper triggers you say. Is it okay if they are wait (1000)'s and such? I also thought that complex hyper triggers (with the switch and 2 players) avoided wait blocks somewhat. Well at any rate the only wait triggers I ever use are for cut scenes.



None.

Feb 19 2011, 7:57 am rockz Post #12

ᴄʜᴇᴇsᴇ ɪᴛ!

Any wait is bad for hyper triggers. In fact waits are bad in general, since they do not scale with game speed, and they are notorious for causing nearly every error of "my trigger stopped working at the right time".

you might as well never use waits ever except in hyper triggers. It's simple to run a DC timer and play a song. The only problem is the game speed, but who plays on anything other than fastest in multiplayer?

I used waits in this map, and I probably shouldn't have:
http://www.staredit.net/files/1987/



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Feb 19 2011, 9:59 am NudeRaider Post #13

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Quote from name:shadow649
Quick question. Wait(0)'s are bad for hyper triggers you say. Is it okay if they are wait (1000)'s and such? I also thought that complex hyper triggers (with the switch and 2 players) avoided wait blocks somewhat. Well at any rate the only wait triggers I ever use are for cut scenes.
Well it's just as important where your wait relatively to your hyper triggers are. If you create a new trigger they will be below hyper triggers by default, which results in the new trigger being blocked. How long is governed by the wait value. Wait(0)'s usually don't block a trigger too long, while a wait(1000) will probably be minutes due to the exponential nature of hyper triggers.

However if you move your new trigger up, above the hyper triggers, it's the hyper trigger that will get blocked and as long as there is at least 1 player whose hyper triggers are still running the hyper effect will still be in effect for all players. That means if you use the wait(1000) (trigger above hypers) for 1 player you won't experience any problem. But if every other player is playing that wait(1000) within this "minutes" time frame (in which the first player's hypers are blocked) the hypers will cease to function until the first block wore off.

If I'm not mistaken complex hypers don't cause wait blocks at all. Keep in mind, however, that 2 (non hyper) waits at the same time for the same player still result in a wait block.




Feb 20 2011, 3:28 pm Gigins Post #14



Quote from rockz
Any wait is bad for hyper triggers. In fact waits are bad in general, since they do not scale with game speed, and they are notorious for causing nearly every error of "my trigger stopped working at the right time".

you might as well never use waits ever except in hyper triggers. It's simple to run a DC timer and play a song. The only problem is the game speed, but who plays on anything other than fastest in multiplayer?

I used waits in this map, and I probably shouldn't have:
http://www.staredit.net/files/1987/
This.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[11:17 am]
Zycorax -- :wob:
[2024-4-27. : 9:38 pm]
NudeRaider -- Ultraviolet
Ultraviolet shouted: NudeRaider sing it brother
trust me, you don't wanna hear that. I defer that to the pros.
[2024-4-27. : 7:56 pm]
Ultraviolet -- NudeRaider
NudeRaider shouted: "War nie wirklich weg" 🎵
sing it brother
[2024-4-27. : 6:24 pm]
NudeRaider -- "War nie wirklich weg" 🎵
[2024-4-27. : 3:33 pm]
O)FaRTy1billion[MM] -- o sen is back
[2024-4-27. : 1:53 am]
Ultraviolet -- :lol:
[2024-4-26. : 6:51 pm]
Vrael -- It is, and I could definitely use a company with a commitment to flexibility, quality, and customer satisfaction to provide effective solutions to dampness and humidity in my urban environment.
[2024-4-26. : 6:50 pm]
NudeRaider -- Vrael
Vrael shouted: Idk, I was looking more for a dehumidifer company which maybe stands out as a beacon of relief amidst damp and unpredictable climates of bustling metropolises. Not sure Amazon qualifies
sounds like moisture control is often a pressing concern in your city
[2024-4-26. : 6:50 pm]
Vrael -- Maybe here on the StarEdit Network I could look through the Forums for some Introductions to people who care about the Topics of Dehumidifiers and Carpet Cleaning?
[2024-4-26. : 6:49 pm]
Vrael -- Perhaps even here I on the StarEdit Network I could look for some Introductions.
Please log in to shout.


Members Online: Vrael, C(a)HeK