Summary
A small note before we get to the problem:
This applies to all island settings but I did most of my testing with “Teams” set to “Custom” and “Team Size” to “Dynamic” since these are the most useful for any game. I havent tested other settings since the beginning of summer. At that time, the results were the same, and I assume nothing has changed, since the root cause of the problem is a function, not the island settings.
The Problem:
Switching player’s team has too high performance cost.
Server has 30 TPS. Which means ideally we (creators) should aim for budget of 33ms.
Right now switching Team with Verse or “Class and Team Selector” Device costs around 8ms with one player and goes up to 10ms in game with 40 players.
So it scales with player count.
Video Demostration:
With this one action 1/3 of our computing budget is gone.
Moreover, before v36.30 when we got the Dynamic Teaming Emote, changing teams was about 2.5 times faster, so performance has significantly degraded over time.
The reason I know these numbers is that at the beginning of spring this year, I painfully discovered why my map was lagging like crazy when a lot of people joined the island, even though there was nothing ‘heavy’ in it. To this day changing team on that map has a massive performance cost - and, probably because its one year old map, its 100 times slower then on a newly created map.
Video Demostration:
I already dropped team changing code there but if any Epic devs wanna check what is going with it, here is Private Code with ready to use test volumes (just before changing team, spawn test players and enter first volume so their collisions wont cause lags):
1953-9676-0405
I was lucky this map was a simple platformer and not my pirate themed game with dynamic team invite system which I started working on even before this platformer. This problem would have completely killed it. And since it has only gotten worse over time, there would be no hope of reviving thousands hours of work.
Obviously, no one will make a game where players are constantly changing teams.
It wont be noticeable if game has very low max players limit. But with more players there is a higher chance that a couple of them will trigger Team Change function causing a lag spike for everyone. And thats just the impact of this one factor, not even counting the performance cost of other mechanics.
This performance problem simply creates an unnecessary limitation on what we can create in UEFN.
Please select what you are reporting on:
Unreal Editor for Fortnite
What Type of Bug are you experiencing?
Stability
Steps to Reproduce
- In Island settings set “Teams” to “Custom”, “Team Size” to “Dynamic” and Max Players to 40
- Write a Verse device that will call and profile .ChangeTeam() from class_and_team_selector_device
- Place devices and launch the game
- Spawn 39 test players with debug command
- Trigger .ChangeTeam()
Expected Result
Would be good to have it run at least as fast as before the v36.30 update - which is around 3ms
Observed Result
It runs at 10ms
Platform(s)
PC