Major lag issues

Hello.

A game I am working on has a major lag issue. I want to start by mentioning that:
No, this is not a problem with my connection.
Yes, scripts are optimized, I’ve been monitoring script performance and it is fine.

The lag seems to come and go at random intervals.

I do, however, have 2 separate microprofiles, one during the lagging period, and one during proper server performance.

I do have issues navigating these microprofiles and making use of them, so if possible, I would like to request some sort of guidance as to what I can do with the given info.

image

This image over here is recorded during the proper server activity, no lag.

image

This, on the other hand, is recorded during the major lag spike, which can last a good while.

I can provide more info if needed, but so far I just want to know what I can gather from these stats alone, if anything.

I need to know more, is your game part heavy, are there unneeded unions, or lots of imported models? How are you optimizing your scripts? Does it happen completely randomly, does it seem to happen at an interval time? Does a lag spike happen when you walk into a certain area?

Hello.

Yes, the game is part heavy, it has a massive map, that, as far as I know, doesn’t overuse unions or imported models. The scripts are optimized in a way that prevents memory leaks for the most part, so they’re working efficiently.
Yes, it seems to happen at completely random intervals, and I am not aware of whether this happens when you walk in a certain area.

I do want to reinforce the fact that this lag is server lag, not fps. As soon as it begins all attacks (the game is combat oriented) slow down significantly, becoming borderline unplayable.

I’ve been using ScriptProfiler to monitor the performance of the scripts and everything seems to be at a relatively stable position, other than a few minor memory leaks that are yet to be fixed. This lag is difficult for me to trace because ScriptProfiler isn’t spiking whatsoever whenever this happens, so my safest assumption was that it isnt caused by scripts… Although maybe I’m wrong?

What I would try with first is trying to optimize the amount of parts you have, or you can use StreamingEnabled with a StreamingMinRadius and StreamingTargetRadius. The issue with this is if you have teleports from different parts of the maps, you are going to have to rework the code. Also that annoying ‘Game needs to load’ or a message will pop up if it gets too laggy. If this is something you don’t really want to try to do, that’s fine, but I would recommend at least trying. Second thing, can you show me a video or example of what happens when you try to use an attack?

I would like to get some sleep if possible as it is 5 in the morning right know, mind continuing this thread tomorrow? I’ll be sure to respond as soon as I am awake.

Yea, no worries, I got to get to bed myself!

1 Like

Hello. I am awake now.

So I’ve been playing the game for about 3 hours now and trying to get lucky for the lag to appear… but it just hasn’t. I am starting to believe it is caused by a player doing something malicious, like abusing a game system of some kind that I am not aware of.

Ok, if you have any more questions just let me know

Well, got the lag.
Medal_xBqhYju4fM
Medal_yFatq3HlOO

Just look at the difference, and yet again, script profiler is just not spiking…
I don’t really know where to start in order to trace the source of this.

image

Maybe this would useful to someone.