I have found an issue where a Gameplay Tag can become permanently stuck on the owning client in a multiplayer environment with network latency. Notably, only the Gameplay Tag gets stuck; the Gameplay Effect that granted it is correctly removed.
This occurs with an ability configured as follows:
- The ability activates when a player presses a key.
- Upon activation, the ability applies a Gameplay Effect (GE) that grants a specific tag to the owner.
- When the player releases the key, the ability removes this GE and then ends itself after a short delay.
If the player rapidly spams the key under network latency, the GE removal replicates correctly, but the tag is left orphaned on the client.
reproducing tag stuck.mp4(6.63 MB)
TagStuck.zip(58.3 KB)
Steps to Reproduce
Steps to Reproduce (using the attached project):
- Enable Network Emulation. Set the Emulation Target to “Everyone” and the Profile to “Average”.
- Set the Net Mode to “Play As Client”.
- Play in Editor (PIE) and quickly spam the Right Mouse Button (RMB).
- Result: Each click has a small chance to cause the tag to get stuck on the client.
This issue came up shortly after the 5.7 hotfixes went out. The cause behind it, the short duration GE getting stuck on clients due to replication windows, has been fixed in upcoming 5.8. As a temporary workaround you could increase the duration of your GE to ensure that it survives for at least 1 net tick on the server.
Thank you for your reply.
But in my case, only the Gameplay Tag gets stuck; the Gameplay Effect that granted it is correctly removed on both client and server.
Do you mean that because server process the ability activation and input release in the same net tick, so the application and removal of the Gameplay Effect is not replicated to the client, so is the tag?
And client predicts the application of GE on ability activation, so client has a predicted GE and Gameplay Tag. After that, when server tells the client the prediction key is accepted, client will remove the predicted GE, but FActiveGameplayEffectsContainer::RemoveActiveGameplayEffectGrantedTagsAndModifiers doesn’t remove the Gameplay Tag granted by the the predicted GE because the prediction is not rejected. So the Gameplay tag is stuck on client. Am I correct?
> Do you mean that because server process the ability activation and input release in the same net tick, so the application and removal of the Gameplay Effect is not replicated to the client, so is the tag?
This is it exactly. With the changes to the tag count container we attempted to clean up the lifecycle of GE added tags, so when the predicted GE is removed it doesn’t remove/reapply the tags unless it’s heard a response from the server. In the case that an event is added and removed on the server within the span of a single net tick there’s no delta to report, so the tag gets stuck.