View Issue Details

IDProjectCategoryLast Update
0023733AI War 2Gameplay IdeaNov 13, 2020 4:57 pm
ReporterChris_McElligottPark Assigned ToChris_McElligottPark  
Status resolvedResolutionfixed 
Product Version2.505 Multiplayer Alpha Starts, Take Two 
Fixed in Version2.631 Multiplayer Swaps And Performance 
Summary0023733: Multiplayer: Maybe: skip and stagger sync checks for ships on tier 3 planets if they are not new
DescriptionBasically if a ship is on a planet not involved with players, and it has existed for at least a few seconds, don't do a sync check on it quite so frequently. This increased turnover will make ships that need to be deleted happen faster, it will not affect anything players can see, and it will cut down on network usage a lot based on real world observations.
TagsNo tags attached.

Activities

Chris_McElligottPark

Nov 13, 2020 2:58 pm

administrator   ~0059592

I'm not actually seeing any cases where this is a significant source of lag. The lag source was something else, so this seems like it would be redundant unless I actually see a save where that's not the case.

Chris_McElligottPark

Nov 13, 2020 4:36 pm

administrator   ~0059593

Okay, nevermind, I'm doing this after all on the same release I was thinking it was not needed!

* Non-new ships on tier 3 planets now get synced FAR more slowly, and are counted as skip-syncs.
** These catch up at a rate of roughly "one full sync cycle multiplied by 1/10th the number of planets, rounded up). In practice in one large savegame with 12k stacked ships and 93k ships total on 120 planets, this winds up being about a delay of 68 seconds at most for any given ship. If players moved onto a planet that is slightly stale on the clients, that planet would be immediately updated.
** The main cases where we might have a problem here is with strength calculations being off on planets where there are large numbers of reinforcements suddenly dumped into new ships. The host would always be correct, but the client would have some slightly stale data in the galaxy map for up to 60 seconds, which would be annoying.
** There are some ways we can adjust for this for specific ships as they are updated, though, and the next step is to add that. This whole process at the moment does wind up saving a ton more bandwidth and CPU processing, though, which is excellent.

Chris_McElligottPark

Nov 13, 2020 4:57 pm

administrator   ~0059594

Part 2 of what I just mentioned is dealt with in the second item here:

 * Added two new methods to GameEntity_Squad for ships:
** FlagAsNeedingForcedFullSyncToClientsJustInCaseIfInMultiplayerAndWeAreHost() causes a ship to immediately be fully synced from the host to any clients. It is unused on the client side.
*** This is a great way for mods in particular to, after having updated some sort of special mod-only data (like resources they are carrying) to cause a full ship sync.
*** This should not be done too frequently! But if you have a mod that is gathering resources, and periodically updating information that would not normally be caught by the sim thread, then having this periodically called on the gatherers would keep the tooltips of clients up to date.
*** In the escape menu networking details on the host, you can see how many of these have happened via the "Ship Syncs Forced" item.
** FlagAsNeedingFullSyncCheckIfInMultiplayerAndWeAreHost() is specifically to say "ignore my tier3 delayed status," to work around the feature we just added today where background ships get ignored a certain amount.
*** This is mainly something to use when something unusual changes (other than a ship existing at all) that would be visible on the galaxy map for client player, without them clicking into the target planet.
*** So for now this is something that happens whenever a ship marks up, and it also happens whenever the AIReinforcementPointContents contents are changed (increasing, decreasing, transferring, deploying).
*** This should keep the galaxy map accurate for clients, while at the same time not having so darn much data transfer for ships on planets where players are not active.

Issue History

Date Modified Username Field Change
Sep 14, 2020 7:05 pm Chris_McElligottPark New Issue
Sep 14, 2020 7:05 pm Chris_McElligottPark Status new => assigned
Sep 14, 2020 7:05 pm Chris_McElligottPark Assigned To => Chris_McElligottPark
Nov 13, 2020 2:58 pm Chris_McElligottPark Summary Multiplayer: skip and stagger sync checks for ships on tier 3 planets if they are not new => Multiplayer: Maybe: skip and stagger sync checks for ships on tier 3 planets if they are not new
Nov 13, 2020 2:58 pm Chris_McElligottPark Note Added: 0059592
Nov 13, 2020 2:58 pm Chris_McElligottPark Status assigned => feedback
Nov 13, 2020 4:36 pm Chris_McElligottPark Note Added: 0059593
Nov 13, 2020 4:57 pm Chris_McElligottPark Status feedback => resolved
Nov 13, 2020 4:57 pm Chris_McElligottPark Resolution open => fixed
Nov 13, 2020 4:57 pm Chris_McElligottPark Fixed in Version => 2.631 Multiplayer Swaps And Performance
Nov 13, 2020 4:57 pm Chris_McElligottPark Note Added: 0059594