• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM Game Lagging Randomly

D

Drago Supremo

Guest
Hi guys,
i'm trying to make a music-synced boss fight but i get random lag. That wouldn't be a seriuos problem in other rooms but as i said the sinchronization between music and game is very important and whenever this happens the synchronization gets messed up.

I have already tried many things for example disabling v-sync, reducing the porting, raising the sleep margin...
I also tried to look at the debug profiler but it shows that 96% of the work is made by Room Speed Sync and the Real Fps never drops below 60.

The room is actually very simple and it hasn't many instances so i really can't figure out what the problem is:bash:

P.S:. This doesn't happen in my home PC because it's a gaming PC, but the game is supposed to run also on low-spec computer. What i am actually using is a middle-spec laptop
 
Last edited by a moderator:

TsukaYuriko

☄️
Forum Staff
Moderator
Monitor the activity of other processes running on your target device. Sudden bursts of activity, such as antivirus software kicking in and scanning files, updating components, Microsoft's ever-popular ngen.exe compiling your .NET assemblies because it thinks your computer is idle... can negatively affect your game's performance. Try to test your game in an as isolated environment as possible to rule out external influence.

That aside, I suggest locking the music to the game's frame rate if synchronization is that important. Keeping track of how many frames passed and, if needed, adjusting the music's playback position, resolves the issue with it getting out of sync (but players may notice the position shifts - pick your poison).
 

Smiechu

Member
You need to sync your game events using delta time... you don't need to implement delta time as a system, but the event triggering timer based on delta time would solve the problem.
Other way it's impossible, as random hiccups can occure even by best optimised game.
 
D

Drago Supremo

Guest
Monitor the activity of other processes running on your target device. Sudden bursts of activity, such as antivirus software kicking in and scanning files, updating components, Microsoft's ever-popular ngen.exe compiling your .NET assemblies because it thinks your computer is idle... can negatively affect your game's performance. Try to test your game in an as isolated environment as possible to rule out external influence.

That aside, I suggest locking the music to the game's frame rate if synchronization is that important. Keeping track of how many frames passed and, if needed, adjusting the music's playback position, resolves the issue with it getting out of sync (but players may notice the position shifts - pick your poison).
Ok sorry for the late reply but i wasn't at home. Yea in effect this laptop has many antivirus working at the same time so it isn't a really good enviroment to test the game, i'm gonna try disabling them.
 
D

Drago Supremo

Guest
You need to sync your game events using delta time... you don't need to implement delta time as a system, but the event triggering timer based on delta time would solve the problem.
Other way it's impossible, as random hiccups can occure even by best optimised game.
Oh i didn't know bout delta_time it looks perfect for this situation! Actually i'm using timelines to manage the events, but that shouldn't a big problem since between every step only a few parameters change, so i could just store the step in an array with the parameter that changes. Thank you very much.
 
Top