Worst-case scenario: the UEd Goblin wipes the map and burns down your house.

Difference between revisions of "Legacy:Relevance"

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
(Remove two wrong rules. Add comment.)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
'''Relevance''' is a concept in [[Legacy:Unreal Engine|Unreal Engine]] [[Legacy:Replication|replication]]. Often there are [[Legacy:Actor|Actor]]s in the level (~~~ [[:Category:Legacy To Do]] example please!) that cannot be seen by, and will not influence, a particular client.  Any bandwidth used to update these [[Legacy:Actor|Actor]]s is wasted, so replication uses the concept of relevance to avoid this waste.
+
'''Relevance''' is a concept in [[Legacy:Unreal Engine|Unreal Engine]] [[Legacy:Replication|replication]]. Often there are [[Legacy:Actor|Actor]]s in the level (like server actors, pathnodes, some keypoints) that cannot be seen by, and will not influence, a particular client.  Any bandwidth used to update these [[Legacy:Actor|Actor]]s is wasted, so replication uses the concept of relevance to avoid this waste.
  
 
The Unreal engine uses a set of conditions to determine whether an [[Legacy:Actor|Actor]] is relevant or not:
 
The Unreal engine uses a set of conditions to determine whether an [[Legacy:Actor|Actor]] is relevant or not:
 
* If the [[Legacy:Actor|Actor]] has bAlwaysRelevant set to true, then this [[Legacy:Actor|Actor]] is relevant.
 
* If the [[Legacy:Actor|Actor]] has bAlwaysRelevant set to true, then this [[Legacy:Actor|Actor]] is relevant.
* [[Legacy:ZoneInfo|ZoneInfo]] and its subclasses are always relevant. ~~~ [[:Category:Legacy To Do]] is this because it has bAlwaysRelevant?  If so, indicate bAlwaysRelevant should not be set to false for instances of ZoneInfo or its subclasses.
 
* Actors with bStatic or bNoDelete set to true are always relevant.
 
 
* If an actor's [[Legacy:Owner|owner]] is set to the local player, then that actor is relevant.
 
* If an actor's [[Legacy:Owner|owner]] is set to the local player, then that actor is relevant.
 
* If an actor has bOnlyRelevantToOwner set to true, it will not be replicated to any other clients.  It exists only on the server and the actor's owner. (But note that bAlwaysRelevant overrides bOnlyRelevantToOwner, which is.... weird)
 
* If an actor has bOnlyRelevantToOwner set to true, it will not be replicated to any other clients.  It exists only on the server and the actor's owner. (But note that bAlwaysRelevant overrides bOnlyRelevantToOwner, which is.... weird)
Line 30: Line 28:
 
'''Kohan:''' What's the thing about [[Legacy:ZoneInfo|ZoneInfo]] always being relevant?  <tt>bAlwaysRelevant</tt> isn't set in it, though it is set in [[Legacy:LevelInfo|LevelInfo]].
 
'''Kohan:''' What's the thing about [[Legacy:ZoneInfo|ZoneInfo]] always being relevant?  <tt>bAlwaysRelevant</tt> isn't set in it, though it is set in [[Legacy:LevelInfo|LevelInfo]].
  
'''Dimension4:''' [[Legacy:ZoneInfo|ZoneInfo]]s are bNoDelete, so they are always relevant
+
'''Dimension4:''' [[Legacy:ZoneInfo|ZoneInfo]]s are <tt>bNoDelete</tt>, so they are always relevant
 +
 
 +
'''Buggie:''' Not really. this rule not work at all. Proved by source code and by real tests. So I remove it. [[Legacy:ZoneInfo|ZoneInfo]] always being relevant because bAlwaysRelevant set by default to true. If you override it to false, then no any replication occur. You can check it with make simple map, which change ZoneLight and run it on dedic server.
  
 
----
 
----
  
 
[[:Category:Legacy To Do]] &ndash; Work in with [[Legacy:Replication|Replication]] family of pages, as per [[Legacy:Replication/Discussion|Replication/Discussion]].
 
[[:Category:Legacy To Do]] &ndash; Work in with [[Legacy:Replication|Replication]] family of pages, as per [[Legacy:Replication/Discussion|Replication/Discussion]].
[[Category:Legacy To Do|{{PAGENAME}}]]
 
 
[[Category:Legacy To Do|{{PAGENAME}}]]
 
[[Category:Legacy To Do|{{PAGENAME}}]]
 
[[Category:Legacy To Do|{{PAGENAME}}]]
 
[[Category:Legacy To Do|{{PAGENAME}}]]

Latest revision as of 15:29, 21 November 2021

Relevance is a concept in Unreal Engine replication. Often there are Actors in the level (like server actors, pathnodes, some keypoints) that cannot be seen by, and will not influence, a particular client. Any bandwidth used to update these Actors is wasted, so replication uses the concept of relevance to avoid this waste.

The Unreal engine uses a set of conditions to determine whether an Actor is relevant or not:

  • If the Actor has bAlwaysRelevant set to true, then this Actor is relevant.
  • If an actor's owner is set to the local player, then that actor is relevant.
  • If an actor has bOnlyRelevantToOwner set to true, it will not be replicated to any other clients. It exists only on the server and the actor's owner. (But note that bAlwaysRelevant overrides bOnlyRelevantToOwner, which is.... weird)
  • If an actor is a subclass of Weapon and it is owned by an actor who is visible, then it is relevant.
  • If the actor has bHidden set to false, bBlockPlayers set to true, or an AmbientSound set, then the actor is relevant.
  • If the actor is visible on the client's screen, then it is relevant. Note that this goes by the center of the mesh so actors with very large meshes can sometimes become irrelevant while some part of them is still visible.
  • If the actor is not visible on the client's screen but was recently visible, then it is still considered relevant. The amount of time it remains relevant varies based on bandwidth availible, and will vary from 2 to 10 seconds.
  • The linked lists Level.ControllerList (UT2003) and Level.PawnList (UT) do not exist on network clients. If you attempt to reference them the list will appear empty. Level.Game is also never replicated and does not exist on the client at all. If you need to access the game's GameReplicationInfo, it can still be referenced by the locally controlled player's PlayerController (PlayerController.GameReplicationInfo) or PlayerPawn. See Netcode Idioms for an explanation of how to do this.

Notes[edit]

A warning for the programmer: Actors deemed irrelevant may be destroyed on the client side while continuing to exist and be updated on the server. You must keep this in mind when checking a reference to another object in client-side script: the object and the reference still persist on the server and will be linked back up automatically once the server decides it is relevant again.

Related Topics[edit]

Comments[edit]

Tarquin: Where is bAlwaysRelevant defined?

SuperApe: bAlwaysRelevant is defined in Actor, but only used in subclasses.

Tarquin: I think it's missing on Actor

Kohan: What's the thing about ZoneInfo always being relevant? bAlwaysRelevant isn't set in it, though it is set in LevelInfo.

Dimension4: ZoneInfos are bNoDelete, so they are always relevant

Buggie: Not really. this rule not work at all. Proved by source code and by real tests. So I remove it. ZoneInfo always being relevant because bAlwaysRelevant set by default to true. If you override it to false, then no any replication occur. You can check it with make simple map, which change ZoneLight and run it on dedic server.


Category:Legacy To Do – Work in with Replication family of pages, as per Replication/Discussion.