My game is crashing after 9 minutes of gameplay.
It’s weird how just 9 minutes all the time.
My game is crashing after 9 minutes of gameplay.
It’s weird how just 9 minutes all the time.
make sure that you don’t have memory leaks in your game you should check the scripts activity rate
probably a memory leak or too many npcs lagging by using path finding
You might have a memory leak, which is where your code endlessly uses more memory until the computer runs out and crashes. This can be either on the client or the server (from your screenshot below it doesn’t look like it’s happening on the client).
It’s also possible that your code could be causing a fatal error like a stack overflow, which is where your code doesn’t stop running (e.g. a while loop without an end condition or wait/yield).
Some questions:
It doesn’t print an error.
I reviewed all my loops and they all have safety checks in place to exit.
Sometimes randomly the server will freeze completely and after 20 seconds i get a “Kicked” message
There is no pathfinding in my game. The NPCs also sort the troops by nearest and they cache the results. So every 30 seconds the list of enemies is sorted again. This is more efficient and provides a better effect. After 30 seconds the cache is cleared.
Does it happen in studio?
You can see how to view server memory here: