• 🏆 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!

Advice for Stuttering with music playing?

Status
Not open for further replies.
Level 9
Joined
Feb 17, 2009
Messages
291
Hey all, with the new patch I'm sure many of us are excited about adding a soundtrack to our maps since it's easy to have a 30-60 minute track and a boatload of map space left over.

I am wondering if any of you have experienced a random sort of *leak-lag* or *you-didn't-preload-something* lag after adding music. If so do you know any solutions for this issue? As soon as I took the music out, everything was perfectly fine. Aside from it being a 45 MB file I can't imagine what would cause that. If that is the issue, I'm not sure why a file size increase beyond 30-40 meg is even a good idea.

Here is my music trigger. Also if there's a better way to do this that can deal with single player pauses (music plays but wait timer stops counting) I'd love to hear it.

-Shy

  • Soundtrack
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Victory Equal to False
        • Then - Actions
          • Sound - Play TL2 <gen>
          • Sound - Set Music to 75.00%
        • Else - Actions
      • Wait 1726.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Victory Equal to False
        • Then - Actions
          • Sound - Play TL2 <gen>
          • Sound - Set Music to 75.00%
        • Else - Actions
      • Wait 1726.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Victory Equal to False
        • Then - Actions
          • Sound - Play TL2 <gen>
          • Sound - Set Music to 75.00%
        • Else - Actions
      • Wait 1726.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Victory Equal to False
        • Then - Actions
          • Sound - Play TL2 <gen>
          • Sound - Set Music to 75.00%
        • Else - Actions
 
Stop the current Played Music before starting yours, this avoids the Frame drop.
  • Sound - Stop music Instantly
Edit:
A Timer is a good option for static Stuff like playing Music?
Well this will not count while paused.
  • Play Music
    • Events
      • Time - Music_Timer expires
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
      • Victory Equal False
    • Actions
      • Sound - Stop music Instantly
      • Sound - Play AmbientCeltic <gen>
      • Countdown-Timer - Start Music_Timer as an Once timer that will expire in (Length of (Last played music)) seconds
A Better Version of yours, If you want to avoid timers:
  • Loop Music
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
      • Victory Equal False
    • Actions
      • Sound - Stop music Sofort
      • Sound - Play Musik
      • Wait (Length of (Last played music)) seconds
      • Trigger - Run (This trigger) (ignoring conditions)
 
Last edited:

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,191
A Timer is a good option for static Stuff like playing Music?
No its not as timers are based on game time and not real time. Music is based on real time and not game time. By default, on fastest speed, the timer will run 1.4 times or so faster than the music. In replays one can raise it up to 32 times faster. Ironically using waits is probably the best way to do music as TriggerSleepAction is vaguely based on real time and is reasonably speed invariant and even goes through pauses like music.

Warcraft III does not really have a good music system. In StarCraft II you can specify your own music play lists and queue up situational music to get around variations between game time and real time.
 
Level 9
Joined
Feb 17, 2009
Messages
291
Haven't gotten around to doing more testing just yet. It seems I was wrong about the pauses being an issue in real time, I just anticipated there'd be some. Yay at least that works XD

So anyway, it sounds like all I need to do is shut off the wc3 music first? :D

Also, I casually observed the frame drops in early game (0-10 mins guessing) and eventually the stuttering stops. Will stopping the wc3 music first fix all that? It's not just an initial spike, it happens every 10-20 sec.
 
Level 9
Joined
Feb 17, 2009
Messages
291
Sorry for the late reply, I'm not sure how to check but I would guess the answer is no. Also, I checked today to see if the music caused lag. I don't think it happens as much, but I did notice it a couple times still. :\

Edit: nvm it's happening the same as before
 
Last edited:
Level 9
Joined
Feb 17, 2009
Messages
291
Don't think I am then after searching. This issue happens for 8-10 minutes and then just stops afterward. Can't think of anything in the game that would shut off at 10 minutes, things are generally either on or not on at the beginning and that's it. :\
 
Level 9
Joined
Feb 17, 2009
Messages
291
Nope nothing like that >.< it's an aos. Pretty straightforward. I'm still mystified in that it eventually stops. It's about 30 min, there's no lag at the start of any subsequent loops. Ugh. I'm not being much help here, kinda out of ideas
 
Status
Not open for further replies.
Top