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

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

Also, how much memory in megabyte, in server can cause lag?

Issue has been resolved, issue was too many constraints where created. It was not memory leak.
Thanks for contributing in helping

I have tried the game out and it ran smoothly. Great to hear that you fixed it!

Also at the spawn, there are some duplicated parts that are colliding.

1 Like

Ah. I know, I suck at building lobby’s, so some community members decided to create the lobby, I know about the Z-fighting there, I am trying to make good looking lobby. Thanks for your feedback!

No problem man! I’m sure you could improve!