1. Hey! Guest! The 35th GMC Jam will take place between November 28th, 12:00 UTC - December 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice

Sound and game get out of sync... How to prevent it?

Discussion in 'Programming' started by wingedadventurer, Jul 12, 2016.

  1. Hello, fella GameMakers!

    Best way to describe my problem is to imagine making a Guitar Hero clone, where a song plays in the background and notes arrive. The notes are "in sync" with the song in the original Guitar Hero game. This is something I find impossible to make in GameMaker.

    Why? Well, the song is one thing and the notes are the other thing. Nothing connects them. They begin at the same time and manage to perfectly sync with each other as long as they both travel at the same speed. But what if one of those two things gets a little lag? They get out of sync.

    In GameMaker I haven't found a way to sync the song with some game rhythmical element other than using the method above (to play them at the same time), but GameMaker certainly can cause a bunch of little lags, especially on weaker PC-s, and this is troubling me.

    I'm wondering is there a way to fix this? Consider that the lag is inevitable, especially on weaker PC-s. Is there some DLL that can help with this?
     
  2. TehCupcakes

    TehCupcakes Member

    Joined:
    Jun 21, 2016
    Posts:
    63
    This is one of those assumptions that is almost always wrong. While GM:S does have its limitations, there is pretty much always a solution if you're willing to get creative enough. This topic might help you come up with some general ideas on how you might combat this issue:
    https://forum.yoyogames.com/index.php?threads/programming-rhythm-games-how.1781/#post-14631
     
    Phil Strahl likes this.
  3. FrostyCat

    FrostyCat Member

    Joined:
    Jun 26, 2016
    Posts:
    4,602
    If you calculate the positioning of rhythmic elements using audio_sound_get_track_position(), it would stay in sync all the time.

    Not exactly what I'd characterize as impossible.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice