Opened 7 years ago
Closed 6 years ago
#4713 closed defect (fixed)
[PATCH] Footprint "Sunken ship" lag
Reported by: | elexis | Owned by: | |
---|---|---|---|
Priority: | Release Blocker | Milestone: | Alpha 23 |
Component: | UI & Simulation | Keywords: | |
Cc: | Patch: | Phab:D850 |
Description
The footprint component tries many places to ungarrison units if an entity was destroyed that garrisoned them.
Before r16636 and r16643, the freeze so long that players even reached a network timeout.
As of Alpha 22 this is still very noticeable.
The maps Danubius and Polar Sea spawn units and avoid the TriggerHelper spawn function because they also use the Footprint component which is very laggy if used (and not needed for these maps as on Danubius the entities garrison immediately after spawn and on Polar Sea, the wolves can spawn everywhere the trigger point was set, even in the same place).
Since "sunken ship freeze" still takes more than 2-3 seconds it is the foremost noticeable lag-experience in some games (Danubius only one example where many garrisoned ships sink), it must be optimized further.
Attachments (5)
Change History (19)
by , 7 years ago
Attachment: | sunken_ship_lagspikes.jpg added |
---|
by , 7 years ago
Attachment: | a22_danubius_replay_profile_data.7z added |
---|
comment:1 by , 7 years ago
To back it up with data, I've profiled this a22 danubius game where the "sunken ship" lagspikes occur frequently:
The dark green line at the top is the total simtime per turn.
Just below in light green there is PickSpawnPoint
and TestUnitShape
(called from PickSpawnPoint
).
See wiki:EngineProfiling#Creatinggraphs on how to do the profiling.
Notice we have to apply the patch in Phab:D778 to have that part profiled!
comment:4 by , 7 years ago
Danubius is pretty much unplayable with a large number of players.
Poking around a bit, there's this comment in CCmpObstructionManager.cpp:
// TODO: should use the subdivision stuff here, if performance is non-negligible
If it's testing against everything on the map rather than just the nearby stuff, that's obviously going to slow things down a lot. (My first time looking through the code, so I might be talking nonsense.)
Edit: Yeah, seems like that's it. I'll upload a patch tomorrow, maybe try the profiling stuff too.
comment:5 by , 7 years ago
Milestone: | Backlog → Alpha 23 |
---|---|
Patch: | → Phab:D850 |
Summary: | Footprint "Sunken ship" lag → [PATCH] Footprint "Sunken ship" lag |
comment:6 by , 7 years ago
Priority: | Must Have → Release Blocker |
---|
Performace improvement is gigantic when playing with sinking ships and the patch isn't complex.
by , 7 years ago
Attachment: | volcanic_lagspikes.jpg added |
---|
by , 7 years ago
Attachment: | volcanic lagspikes.7z added |
---|
comment:8 by , 7 years ago
1) The profiling of the alpha 22 volcanic_lagspikes replay above shows some serious lagspikes on the map volcanic lands (i.e. a land map), caused by more TestUnitShape called from PickSpawnPointBothPass.
2) A big freeze was noticed in the visual replay just before 13:48, turn 1656, i.e. at 82 in the graph. But the graph doesn't show any lagspike there and I didn't find any ungarrisoned or spawned unit in the visual replay at that time. However I had about 50 units near the map border there.
comment:9 by , 7 years ago
In case you didn't realize it, (2) is the lag described in Phab:D926. On turn 1651 and 1652 you move to z = 1536, the edge of the map.
comment:10 by , 7 years ago
Also, the graph is from the danubius replay! I was wondering why PickSpawnPointBothPass would show up since I thought it was only used with dying ships.
by , 7 years ago
Attachment: | volcanic lag.png added |
---|
comment:11 by , 7 years ago
There was another command to go to the edge of the map at turn 5625 = 281 on the graph. That's a little before the smaller spike at 286, but I'm guessing it's related.
comment:12 by , 7 years ago
Ah, that's why it didn't show up in the graphs. I suspected it's the other bug, but didn't investiage. Good that we now know that both patches have basically release blocker priority.
comment:13 by , 7 years ago
Oh, I missed the others: on turn 5720, 5721, 5722 = 286 (so that explains the smaller spike), and 5863 = 293.
comment:14 by , 6 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
In r20438:
Use the rangeManager's subdivisions in the obstruction manager shape tests. Completes an existing TODO. This is a large speedup in some cases for those test functions, particularly the "sunken ship lag" issue.
Reviewed By: elexis, mimo, bb, wraitii Accepted By: bb, wraitii
Differential Revision: https://code.wildfiregames.com/D850
An example a22 danubius replay with many "sunken ship" freeze including the profile data generated from running the non-visual replay.