Desynchronizes Games

I have spent 7 months working on a personal project, but lately I have had many problems in relation to the game and the players
My Game Called Shovel Knight The Other Side

I’ve been working on an update regarding progress, which I started in late January 2020

When I launched the update, I had a lot of problems regarding some players not being able to play the game and others that could, confusing errors, but there is one that is quite rare, which is a desynchronization of the game completely, that the actions were they delay and run 3 seconds before, it doesn’t make sense, I try to search why it happens and I don’t know, I plan to cancel the project since roblox dosent give me the necessary performance to progress in the project

Link Here: Shovel Knight The Other Side - Canceled - - Roblox

I put the link of the game so that you can try it, the desynchronization happens in Parkour Mode in an area where there are timer levers, if you die several times and return there, very strange things happen

Well, we can’t help you without any information of how you handle your game. But, when you said “desynchronization”, it seems like you are referring to:

  1. Server lag
  2. Delays (using wait and delay)

These can be fixed, but not entirely. This will all depend on how you handle the entire server.

all player actions are managed by local scripts

Correct me if i’m wrong, but if i remember, if the player is laggier, the LocalScript of a player will run slower. Maybe that could be causing the delay issue.

In playing your game for less than 5 minutes, this is the data I’m receiving from the Microprofiler. Your target should be to keep framerate at around 16 m/s, as you can see my framerate is upwards of 46 m/s. The microprofiler can help you identify key issues and client-sided functions that are causing the majority of lag. If you’re not sure on how to use the microprofiler or what it’s functions are, you can take a look here, but to break down my screenshot: It seems as if you have multiple Heartbeat loops attempting to process on the client, and that’s causing the performance to dwindle.

Client-sided lag with how you handle character controls/updating the character is something I would recommend looking into as it might be what is causing your game control delay. How many Heartbeat connections do you have? RenderStepped? Make sure your code for these is clean and efficient.

That’s my two cents.

2 Likes

all the platforms that move in the game, are inserted together with a renderstepped, now I change it using this syntax:

spawn(function()
while runservice.renderstepped:wait() do

there was a bug that makes unnecessary stepped renders still in use

Are you using this right now?
What’s the rationale behind yielding in a new thread and not using coroutines over spawn, given the uncertain behavior of wait()?

Use coroutine.create or coroutine.wrap instead of spawn.

spawn(function()

end)
--> coroutines don't have a wait() though, spawn does
coroutine.wrap(function()

end)()

-- or
coroutine.resume(coroutine.create(function() end))

These will eat stack traces, for debugging use some sort of fastSpawn function as the one made by @Quenty or use the second argument of pcalls.

2 Likes

for platform movement, but the loop breaks when the platform is removed
I don’t know how to use coroutines