Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I reduce server lag in a fighting game?

I need some pointers toward reducing lag in fighting games. An example of what I would like to reduce is a player hitting another player even when they're far away. Another example is some players have strange hitboxes due to lag. Any tips to reducing lag in fighting or any type of game where you have to be in contact with someone else would be good.

2 comments

0

Sorry to tell ya, but that's waaaaay too broad. There's hundreds of ways to fight lag. Best way to do this is typically making mathematics more efficient or finding short cuts. There's almost always a more efficient way to do something.

0

I really wish you gave us some more in-sight, rather than just saying "it's laggy".

1 answer

See http://wiki.roblox.com/index.php?title=Fighting_Lag for some basics.

Essentially, you have to think about how you want the game to work in different scenarios. Do you let the client's attack hit, even if the other player has moved? Do you only let the client's attack hit if it turns out that the other player is still in range by the time they see the attack? The easiest thing is to have the server do the comparison without time consideration at all, but don't forget that if a player is aiming at another player, they're usually aiming at the version of that player that is on their client (which is a significant fraction of a second away from where the player might be on the server, which is another significant fraction of a second away from where the player might be on their own client).

Now, if by "server lag" you mean "the server is doing so much processing that it is slowing down the game", you have to work towards minimizing the impact of the scripts involved, or maybe by reducing the number of objects in the place (especially non-Anchored ones).

This discussion is preserved as it was. New answers, comments, and votes are closed.