[Workshop] Game server encounters an unexpected error after enough Event Player effects are created and destroyed


#1

While working on a new gamemode I was looking to create ring effects around every player which have their color constantly updated to represent whether the player can move or not; you can only move once per second in this gamemode! Unfortunately, I’ve found that the servers will consistently crash after around one minute of gameplay with the effect loop activated.

After many more complex iterations, I’ve stripped down the code as much as possible to isolate the issue. Here is the most simple loop that causes the crash:

  • Create Effect (Position of Event Player)
  • Wait 0.25
  • Destroy All Effects
  • Wait 0.25
  • Loop

It works as expected… until the server crashes a minute in. I’ve done a lot of experimentation with this: The visual effect chosen is irrelevant, the reevaluation criteria are irrelevant, the color is irrelevant, the visibility doesn’t matter and the size is irrelevant. No matter what, it’ll still crash after enough effects are created and subsequently destroyed.

Reproduction
Import the following code, completely fill the server with bots (the more players, the faster the crash) and start the game. After around one to two minutes, it’ll crash. D6DAE


[Workshop] Too many "fast loops" make the server crash
#2

I have experienced this as well.
I’m creating and destroying two ring effects for each player when certain conditions become true.
In a test with players yesterday the server crashed regularly and more often with more players but I could not pin it down.

Have you tried storing the effect in a variable and destroying it with DESTROY EFFECT?


#3

I believe it has to do with the number of effects as I get the same when I create a lot of text objects.


#4

Confirmed here.

I also tried with ‘Destroy Effect(Last created entity)’ instead of the destroy all, and had the same result.

Tried it with icons instead of effects, and no issues.


#5

The bug is unfortunately still present. My custom game started crashing after I added some effect-intensive rules.

I also just tested the OP’s script and it crashes the server after a brief time just as they wrote. Reducing the wait times to 0.01s causes the server to crash almost instantly after loading the map.

Looks like this bug could potentially crash any script that creates effects in reaction to player inputs given enough time.


#6

Did some more testing today and I’m growing more certain that there is a server-side memory leak caused by the Destroy Effect function.

I wrote my own test script similar to that of the OP. It simply creates an effect, assigns it to a global variable, waits, and destroys the object. There is also a counter of total number of created objects and a timer.

You can access the script here: QB90G

Testing results show that this is most likely a memory issue.

Starting a game solo and with no additional variables set, causes the server to “close due to an unexpected error” after around 42 seconds with around 2500 effectes created and destroyed.

Adding 11 bots reduces the time till server error to ~40 sec (~2350 effects).

Assigning an array of 5000 floats to each of the 12 players further speeds up the error to ~35 sec (~1800 effects).

I believe that the last test case indicates that the problem is memory related, as it demonstrates that filling the (server?) memory with additional non-related data, causes the error to occur after creating-and-destroying a smaller number of effects.

EDIT
Made another test, in which I increased the wait time between creating and destroying an effect from 0.001 sec (used in previous cases) to 0.250 sec. Player count was 12, with additional 5000 floats assigned for each.

This increased the error time to ~225 sec as expected but surprisingly also resulted in fewer total effects created: ~870. Perhaps additional regular game objects were created during the extended play time, such as sound effects?


#7

I’m also experiencing this issue, I have a loop that dynamically creates and destroys a HUD icon based on a players proximity to one or more points, and after about a minute the server shuts down and restarts. Notably, the same loop updates and resets player variables at exactly the same rate, and worked perfectly until the icons were added to the loop.


#8

Same.

Although we got the idea it was related to load, not the number of effects.

I was destroying by id (not “destroy all”)

I added lots of on-the-fly (created then removed) effects to one character (mercy). Never add trouble during dev with one mercy, even in long sessions within one game. Systematically crashed within a minute once someone joined in and we tested with two mercies.

I wouldn’t mind debugging this further.


#9

Have the same issue. I have been playing around with the overwatch workshop and created a custom ability where several effects are created and destroyed. The server crashes a couple of minutes into a normal game with this ability. I have not debugged this extensively, so I am uncertain if it is directly related but the FPS of the players also steadily declines before this happens.


#10

Blizz please fix this.


#11

I spent over 100 hours working on a pretty complex gamemode, and it greatly suffers from this, often failing to get even a minute into the match with 8 or more players. Hopefully this can be fixed soon, as it currently feels like all my work has gone to waste…