178 Commits

Author SHA1 Message Date
mattias hornlund
93d29af692 Iris/Networking
- Enabled use of NetTokens/NetTokenStore and NetTokenDataStores outside of Iris to facilitate exporting data from shared serialization paths
- NetTokenStore and NetTokenDataStores are now owned by NetDriver.
- Added support for CustomExport bunches to carry data assoiciated with NetTokenExports

GameplayTags
- GameplayTagNetSerializer now respects settings from GameplayTags.ini
- Implemented placeholder GameplayTagNetTokenDataStore.

GameplayTags are now using NetTokens to export data if running in the new dynamic mode.

#rb jodon.karlik, Ryan.Gerleve

[CL 36380672 by mattias hornlund in 5.5 branch]
2024-09-18 04:10:29 -04:00
ben woodhouse
2ea61ce0c6 Switch to CSV_PROFILER_STATS instead of CSV_PROFILER for various profiling subsystems. This allows them to be compiled out when CSV_PROFILER_MINIMAL is defined.
As part of this change we also promote dynamic resolution and IO/PackageQueueDepth stats to Minimal since they're important for high level performance reporting.
Also fix up a few places that were redundantly using #if CSV_PROFILER around CSV macros.

#rb mickael.gilabert

[CL 34386798 by ben woodhouse in ue5-main branch]
2024-06-14 18:16:47 -04:00
ryan gerleve
e5fc7229a0 Add a new gracefully-closing state to NetConnection that waits for reliable data to be acknowledged before actually closing communication, and support this in Iris.
This helps make sure reliable client RPCs sent right before the server gracefully disconnects a client by destroying their PlayerController are received, especially under packet loss.
Can be disabled by setting the cvar net.GracefulCloseEnabled.

#rb LouisPhilippe.Seguin, Peter.Engstrom

[CL 34379986 by ryan gerleve in ue5-main branch]
2024-06-14 14:58:36 -04:00
ted percival
ba970596c8 Remove actors from Replication Graph when world is unloaded
[FYI] Ryan.Gerleve

[CL 34083211 by ted percival in ue5-main branch]
2024-06-03 20:54:18 -04:00
ted percival
1f9113777c Prevent GC destroying actors that ReplicationGraph still points to.
Log (warn) when an actor is removed from networking when it is already marked garbage.

Report actors that are not removed from ReplicationGraph when the world is cleaned up.

#tests Lego Fortnite flying around for several minutes, entering & exiting caves, with PktEmulation average.
#rb Ryan.Gerleve

[CL 34023091 by ted percival in ue5-main branch]
2024-05-30 20:19:57 -04:00
ted percival
0113bde277 RepGraph: Remove actors from global list after callbacks
Avoid callbacks reinserting a removed actor into the global list by looking it up (via FGlobalActorReplicationInfoMap::Get()).

[FYI] ryan.gerleve

[CL 33844398 by ted percival in ue5-main branch]
2024-05-22 17:02:16 -04:00
ted percival
ada7369675 Speed up Net.RepGraph.UseWeakPointers
Reduce the number of times weak pointers are resolved to objects within a single function; look up the raw pointer once and reuse it.

#rb Ryan.Gerleve
#rnx

[CL 33579307 by ted percival in ue5-main branch]
2024-05-10 12:57:31 -04:00
ted percival
2b5678bf0e Add an option to use weak pointers in RepGraph to catch dangling pointers without crashing.
Adds resilience to RepGraph if there are actor lifetime bugs.

Off by default. Enabled by cvar `Net.RepGraph.UseWeakPointers true`. Can be changed at runtime.

#rb Ryan.Gerleve

[CL 33313595 by ted percival in ue5-main branch]
2024-04-29 16:44:58 -04:00
ryan gerleve
f8740fecc8 Fix for invalid actors remaining in the replication graph if:
-Net.RepGraph.HandleDynamicActorRename is enabled, and
-A replicated actor is added before it's initialized and is routed as a dormant, spatialized actor (which is put on the ReplicationGraphNode_GridSpatialization2D::PendingStaticSpatializedActors list), and
-That actor is then destroyed.

Added automation test "Net.RenameReplicatedActor.EarlyRenameAndDestroy" to EngineTest to test this case and some supporting changes:
-Enable ReplicationGraph plugin for the EngineTest project
-Reset the timer for replication graph logging invalid actor info when a graph is initialized. This ensures the logs appear if multiple tests are run in quick succession.

#rb bradley.heath

[CL 32707299 by ryan gerleve in ue5-main branch]
2024-04-03 15:17:42 -04:00
ryan gerleve
6cca5e7346 Replication graph properly handles renaming statically-spatialized actors.
Also, put more of the invalid actor logging behind the Net.RepGraph.LogDebugInfoPeriod to prevent log spam every frame an invalid actor is detected in the graph.

#jira UE-211081
#rb bradley.heath

[CL 32672002 by ryan gerleve in ue5-main branch]
2024-04-02 13:12:34 -04:00
ted percival
b21c6fb914 RepGraph: Hold gathered actors in owned TArray rather than views of unowned actor lists
#rb Ryan.Gerleve
#tests 2 clients on windows

[CL 32624063 by ted percival in ue5-main branch]
2024-03-29 17:04:12 -04:00
ted percival
f7a2902705 RepGraph: Fix skipping subsequent connections if one connection had nothing to replicate
#rb Ryan.Gerleve

[CL 32525282 by ted percival in ue5-main branch]
2024-03-26 18:04:46 -04:00
joe bestrotheray
a34ce7b777 Make dsf log less spammy about uncapping the DSF node
#rb richard.smith

[CL 32441978 by joe bestrotheray in ue5-main branch]
2024-03-22 14:13:39 -04:00
jodon karlik
601b38fd99 Changed UNetDriver::ERemoteFunctionSendPolicy from an enum to an enum class so that other instances of "Default" won't conflict with it.
This class isn't at fault, but it's the easiest change.

#rb Ryan.Gerleve

[CL 32313158 by jodon karlik in ue5-main branch]
2024-03-18 17:35:26 -04:00
ryan gerleve
eb8021c86d Add some optional handling of replicated actor outer changes on servers.
-Only supports dynamically spawned actors, not placed actors
-UNetDriver::NotifyActorRenamed now has a PreviousOuter parameter
-Net driver notifies any ReplicationDriver (replication graph) of actor renames
-ReplicationGraph APIs added to update internal actor level tracking (this can be toggled with the cvar Net.RepGraph.HandleDynamicActorRename)
-Added cvar net.CleanUpRenamedDynamicActors that will tell clients to destroy an actor if the server moves it to a level that's not currently visible on the client (disabled by default to preserve current behavior)

#jira UE-201875
#rb LouisPhilippe.Seguin
[FYI] Todd.Eckert, Jon.Sourbeer

[CL 31915797 by ryan gerleve in ue5-main branch]
2024-02-29 13:26:08 -05:00
steve robb
f8d47335a4 Replaced RemoveAt(N, 1, EAllowShrinking::*) with RemoveAt(N, EAllowShrinking::*).
[CL 31626444 by steve robb in ue5-main branch]
2024-02-19 16:51:58 -05:00
arciel rekman
cc5aa750a3 Add facility to safety-check raw AActor pointers used by ReplicationGraph.
- Attempting to avoid a rare crash and log more info about the circumstances.

#rb Matt.Harris, Ryan.Gerleve

[CL 31600892 by arciel rekman in ue5-main branch]
2024-02-17 10:18:46 -05:00
steve robb
fde2961f55 Fixed up a lot of bool-taking container resize functions to take EAllowShrinking instead.
[CL 30803608 by steve robb in ue5-main branch]
2024-01-23 09:51:10 -05:00
ryan gerleve
07178a0492 Add cvar to flag net dormant actors that were destroyed by Net.RepGraph.DormantDynamicActorsDestruction as not dormant anymore. This ensures the server initializes the flushed actor's FObjectReplicator correctly with the default state of the object, instead of the current state, since the client no longer has a current state.
[REVIEW] [at]louisphilippe.seguin
#rb LouisPhilippe.Seguin, Mattias.Hornlund
#tests Bug repro with chests, and general gameplay

[CL 30256705 by ryan gerleve in ue5-main branch]
2023-12-11 22:33:25 -05:00
louisphilippe seguin
784658deef NetDriver:
* Added tracking stats to NetConnection that track number of rpcs delayed by unmapped guids and how many frames they were delayed by.
* Added tracking stats to NetDriver that track number of reliable bunches.
* Added console cheats to force only unreliable RPCs to be dropped. This can be used to better simulate a scenario where specific unreliable RPCs get dropped and not resent but not the adjacent property data sampled the same frame. Useful to test gameplay code using unreliable RPCs.
   * NetEmulation.DropAnyUnreliable : drops a % of all unreliables sent
   * NetEmulation.DropUnreliableOfActorClass: drops a % of all unreliables sent by a specific class
   * NetEmulation.DropUnreliableOfSubObjectClass: drops a % of all unreliables sent by a specific class
   * NetEmulation.DropUnreliableRPC: drops a % of all unreliables of the passed function name.
   * NetEmulation.DropNothing: stops dropping unreliable rpcs

#rb Peter.Engstrom, Ryan.Gerleve

[CL 29721788 by louisphilippe seguin in ue5-main branch]
2023-11-14 14:48:44 -05:00
peter engstrom
a9b36a97f1 Iris - Force very high priority on controllers and view targets if cvar Net.ForceConnectionViewerPriority > 0. Deprecated cvar Net.RepGraph.ForceConnectionViewerPriority as the functionality is implemented by Iris as well. Moved said cvar to NetCore module.
#rb louisphilippe.seguin, mattias.hornlund

[CL 29645482 by peter engstrom in ue5-main branch]
2023-11-10 12:54:02 -05:00
louisphilippe seguin
f7abf06158 ReplicationGraph:
* Ensure when an actor is replicated with bNetTemporary set

#rb Ryan.Gerleve

[CL 29411433 by louisphilippe seguin in ue5-main branch]
2023-11-03 13:14:53 -04:00
ryan gerleve
c380c4650d Replication graph: reset bForceCullDistanceToZero when an actor is set to not dormant. Otherwise, if an actor is set to not dormant before it was handled in UReplicationGraphNode_ConnectionDormancyNode::ConditionalGatherDormantActorsForConnection, bForceCullDistanceToZero would remain true, effectively treating the actor as always relevant even if that wasn't the desired behavior.
#rb LouisPhilippe.Seguin

[CL 29069730 by ryan gerleve in ue5-main branch]
2023-10-25 01:24:04 -04:00
dylan fansler
f4f510c925 Null checking for Net Channel to prevent server crashes when we run out of Replication Channels
[CL 28598764 by dylan fansler in ue5-main branch]
2023-10-09 16:58:09 -04:00
louisphilippe seguin
36c722f3c4 Fix wrong printf parameters in checkf & ensuremsgf found in engine code
#rb Fabian.Giesen, Kirill.Zorin
#rnx

[CL 27519547 by louisphilippe seguin in ue5-main branch]
2023-08-31 08:56:30 -04:00