My game is quite lagging, I need help on how to fix it!

I currently don’t know why this game is lagging so I really have no idea how to fix the lag, if you know what’s making it laggy, please tell me and I’ll fix it right away.

  1. What do you want to achieve?
    I just want my game to be non-laggy game that every player can enjoy because it’s not laggy.
  2. What is the issue?
    My game is still lagging even tho I tried all things I know that can prevent it lagging.
  3. What solutions have you tried so far?
    I have tried to Debris all temporary effects already but it’s still lagging.
    I also made it so it shutdowns every 8 hours so laggy servers will be shutdowned.
2 Likes

The only thing I can reccomend is, don’t use scripts that would lag in any sort of way. Obvious, also model your buildings and, it usually prevents lag a little bit. Also stuff like lower graphics would be recommended for bigger games.

3 Likes

It’s not the graphics that I worry about, I think it is their ping that goes high when the server is being played by many and is up for atleast more than an hour, even someone with a 100 mbps internet speed will still receive high ping since it’s the game which is lagging.

If it’s network lag, you might be sending too many RemoteEvent/RemoteFunctions or sending too much data over them. Go through your game and see if you can do anything to send less data over Remotes.

1 Like

Punching system is the only thing that sends too much Remote Event which is 2 per second.

That might be the problem, right?

2 Per second, per player? If it’s only 2 per second remotes across your entire game, you should be fine. If it’s 2 per player per second you might have some problems.

Are you doing anything else that could cause this? It might not be just remotes, you could also run into network problems when doing things on the server that would replicate to the client. Using a lot of bandwidth for replication could also cause lag.

If you’re doing something like creating effects on the server, consider using remotes to have clients make the effects instead. Replicating too much from the server to clients will cause network lag.

1 Like

It’s 2 per seconds PER player, yes.

I think it’s only the Punching system that is frequently being fired, no other Remotes could be firing more.

Ok, the only suggestion I could give for you on the remote side of things is to make sure you’re not sending too much data over the punching remotes.

Other than that I think your problem might be coming from what I said earlier, with the server-client replication of effects and things.

1 Like

I will try doing that, any other solution for any experienced scripter of an anime game there?

try using nil, usually works for me!

Do you use any free models maybe in one of them there is alot of scripts that is viruses that causing the lag

I would suggest the following.

  1. Determine whether network lag is being caused by remotes, or replication. Two remotes per player per second is not that bad if you are not sending a lot of data, so my guess is that you are experiencing replication lag
  2. Identify the source of lag. I give some information on this below.

Sources of lag

Remote lag

If you think lag is related to remotes, ensure you are not hitting the 50kbps soft cap. Going over this limit artificially inflates “perceived ping” as each extra remote request is queued after hitting about 1707mb in a network frame (30 tps). My guess is that you are not hitting this limit unless you are sending large tables or strings very frequently.

Replication lag

Ensure that you are not making too many property changes in replicable locations. This means than any new instances you create should have their properties set before parenting. Avoid using the second argument for Instance.new. It’s actually now deprecated for this very reason. If you make a lot of property changes to an instance which is already parented somewhere replicable, it may actually make sense to parent the object somewhere where it won’t replicate first.

The reason for doing this is essentially that it allows lots of property changes to be grouped up into one big piece of info. When individual changes occur, they queue up and get sent with their own header data, which is slow to process when in large quantities, and increases the size of data sent by a lot.

Finally, ensure that you are not creating, reparenting, or deleting a lot of instances too quickly. Grouping a lot of related instances into a single instance before you parent them somewhere will save a lot of data for the same reasons to above. This goes for any ancestry changes. If you create particles within parts, ensure those particles are created before the part is parented. Likewise, if you create a lot of parts at once, ensure those parts share a parent. That parent is what you should destroy.

9 Likes

I’d like to add on some stuffs why this game is absolutely lagging when I gained experiences. This game is full of effects that had been runned in server script instead of a local script. So for game developers out there making a game full of effects. Please let it be known.

ALWAYS SCRIPT YOUR EFFECTS LOCALLY

3 Likes