My game is extremely laggy, How I can fix it?

My game has extreme lag in a maps, I don’t know what’s causing this issue, as this issue only occurs in the game not in studio. Can anybody help me find what script is causing this issue?

4 Likes

One possible reason is that you have a lot of parts in the game.

1 Like

Then why the game runs very smoothly in studio but in game, it runs very laggy?

3 Likes

There is a simple fix for lag, also it might not be the best way as you might have to get rid of objects and other things.

  1. Delete objects that you no longer need or want.
    2.Make the map smaller.
    3.Make sure that there are no viruses in the game.

And you can do other little changes to make it not lag as much.

Yeah, however the maps are the same, as before update and after update. After update the game runs very laggy in the Roblox Client.

1 Like

Hmm, that’s weird I think you should look into it and search if there are any other ways to stop lag.

I did use Script Performance, however game runs smoothly on Studio, however not in Roblox Client, which is weird.


Scripts dont use more than 0.400% in my game

2 Likes

I would look for some potential memory leaks inside the game.

1 Like

I used to have this issue close this scale but manage to reduce it.
It could be Network Lag. What are your network values under Core memory? What is you Maximum player per server?

From my investigation the memory lag starts after like a minute in a game with players. However it works perfectly on Studio.

100 Players in Lobby does great, in map I have 10 players.

Do you lag after a minute, or is it the other players? Because if it is the other players, then their PCs may be less superior or something along those lines.

It’s a server lag, something with memory. In Studio this is what I get:

That’s on the client by the way

It seems like you have a memory leak somewhere then; check all the places you destroy or “delete” values and ensure you’re not keeping a reference to something, preventing it from being collected by garbage collection.

If there are a lot of unions in your game that can contribute a lot to lag

And the Map is lagging?

  • Are you firing remotes in a small amount of time?
  • Are you sending too much data in those remotes.

It would be helpful to see what you CoreMemory/network/replicator and CoreMemory/network/raknet value is.

Also if that screenshot of server memory or client memeory.

It would be also helpful to see your network send & recv (ctrl + f7 or ctrl + shift + f3 for it to be broken down more)

Yup, I recently updated server scripts, it something with a memory leak for sure.

Ok, so I decided to join the game and play a round. I found there was no increase in memory usage between waves. However I did notice that when shots were fired at the enemies there was an increase in memory usage that did not come back down. Which leads me to believe that you may have a memory leak inside the tower AI controller.

1 Like

I did update it today, because I had to fix some bugs, I will try to look at it.


When I place tower, memory spikes up a lot, and stays there, similar to your situation.

Position system that was updated, has nothing to do with it, so this is not problem for sure

1 Like