text
stringlengths 0
17.2k
|
---|
a.Sharing.ScalibilityPlatform |
Controls which platform should be used when retrieving per-platform scalability settings. |
a.Sharing.Enabled |
Toggles whether or not the Animation Sharing system is activated. 0 will disable the system, 1 will enable the system. |
a.Sharing.DebugStates |
Toggle the number of Animation States visible in the debug render. Value added to the command will set that number of debug states to render. |
Remarks |
Here you can reference a list of console commands you can use to debug your Animation Sharing system in Unreal Engine: |
Actor Owner and Owning Connection |
There are many different types of parent-child relationships for objects in Unreal Engine. Two important relationships for network replication in Unreal Engine are an actor’s owner and the owner’s associated owning connection. |
Multiplayer in Unreal Engine uses a server-authoritative, client-server model. In this model, clients connect to a centralized server. When a client connects to the server, a player controller is created on the server associated with the connected client (a connected client is referred to as a connection). When the client begins play on the server, this player controller possesses a pawn that the client controls in the game. The player controller is the owner of the pawn. The owning connection of an actor is the connection associated with the actor’s owning player controller. The owner and owning connection determine which connected client has the authority to make changes and call remote functions. |
Every AActor-derived object stores a pointer to its owner. Not every AActor-derived object has an owner. The actor's owner may be null, in which case the actor has no owner. |
Connection ownership is important for: |
An actor’s owning connection is used during actor replication to determine which connections get updates for an actor, known as actor relevancy. For actors that have bOnlyRelevantToOwner set to true, only the connection that owns the actor receives property updates for the actor. By default, all player controllers are only relevant to their owner. This is why each client only receives updates for their own player controllers. |
An actor’s owning connection is used during property replication involving conditions that use the owner. For more information about how an actor’s owner can affect property replication, see Conditional Replication. |
An actor’s owning connection is also important for RPCs. When the server calls a client RPC function on an actor, unless the RPC is marked as NetMulticast, the RPC needs to know which connections to execute the RPC on. The actor’s owning connection determines the connections to send and execute the RPC. |
Figure 1. Clients connected to a central server showing pawns, owning player controllers, and owning connections. |
Suppose you are playing a multiplayer game as a client connected to the server. Your player controller on your machine is the abstraction of you as a player. In the context of Figure 1, if you are playing on Client 1, your input is processed in Player Controller 1 and communicated to Pawn 1. As previously mentioned, when your client machine connects to the server, Net Connection 1 is established, and Player Controller S1 is created on the server associated with your connection. The server pawn actor, Pawn S1, is possessed by Player Controller S1. This means that Player Controller S1 owns Pawn S1. The owning connection of Pawn S1 is Net Connection 1, which is the owning connection for Player Controller S1. Pawn S1 is only owned by this connection during the time it is also owned/possessed by Player Controller S1. As soon as Player Controller S1 no longer possesses Pawn S1, Net Connection 1 is no longer the owning connection for Pawn S1. |
The same logic applies to inventory items that may belong to your in-game character pawn. Inventory items are owned by the same connection that might own the pawn. |
Actor components operate in a similar fashion to determine ownership but with some additional steps. For actor components, you must first determine the component’s owner by walking the actor component’s outer chain until the owning actor is found. You can follow the process outlined above to determine the owning connection for the actor component’s owning actor. |
To determine the owner of an actor, you query for an actor’s outermost owner. If the outermost owner is a player controller, then the original actor’s owning connection is the same as the player controller’s owning connection. |
To obtain an actor’s owner, call AActor::GetOwner. |
To obtain an actor component’s owning actor, call UActorComponent::GetOwner. |
Overview |
Determine Owner and Owning Connection |
Uses of Owning Connection |
Owner |
Owning Connection |
Remarks |
To obtain an actor’s owning connection, callAActor::GetNetConnection. |
Audio Stream Caching Overview |
Audio stream caching significantly changes the way audio is loaded and released from memory. |
At cook time, almost all compressed audio data is separated from the USoundWave asset and placed at the end of the .pak file. This makes it possible for audio to be loaded into memory at any point, and released again when it has not been recently used. |
This method of memory management is popular for open world games, where the actual audio needed for a specific use case is difficult to determine ahead of time. The primary disadvantage of this method is that just because USoundWave is loaded, this does not guarantee that the audio will be immediately playable. However, the benefit is a system that lets designers reference as many audio assets as they want without overstepping memory boundaries. The system also provides a way for engineers to load and reference chunks of compressed audio without relying on the state managed by the audio engine. Also, mitigating latency when playing back audio with the stream cache is easier than mitigating memory issues without the stream cache. |
The Max Cache Size is a hard limit for memory used by the compressed audio data, with the exception of headers and sounds explicitly marked to stay in memory. When a cache is too small, sounds will be unloaded too quickly, causing latency when loading sounds. |
If your cache limit is set to 8 MB, chunks are a maximum of 256 KB each, so you could have 32 chunks in your cache at any time. This means that if you are playing 32 sounds at once, no more chunks can be loaded. |
Now assume your cache limit is set to 16 MB. This would allow for 64 256-KB chunks in the cache. If you are playing 32 sounds at once, you have room to prime 32 more sounds. However, if all 32 sounds you are playing are long enough to be in multiple chunks, The next chunk in sequence will stay loaded into the cache automatically. This means that any sounds you try to prime during this time will be stomped by the 32 chunks that are loaded in advance for your 32 playing sounds. |
If your cache limit is set to 32 MB, it can contain 128 elements, each at a max of 256 KB. If you are playing 32 sounds at the same time, you still have 96 additional chunks of audio you can keep in the cache to avoid latency. If your limit is 48 MB, you have room for 192 elements, so even if you play 32 sounds concurrently, you can keep 160 chunks primed. |
With the project open, from the main menu, select Edit > Project Settings. |
From the Project menu, go to Platforms > Windows > Audio > Compression Overrides > CookOverrides > Stream Caching. |
Set Max Cache Size (KB) to determine how many elements are in the cache. |
When the value is set to 0, the value defaults to 32 KB. The max cache size is 2,147,483,647 MB, but you should be cautious of using a cache size so large that it would cause the machine you are running on to run out of memory. |
Ideally, sounds are always in memory by the time they play. This can be achieved the following ways. |
If you anticipate that a sound is going to play in the near future, you can call Prime Sound For Playback in Blueprints (or UAudioMixerBlueprintLibrary::PrimeSoundForPlayback from C++): |
For example, in an open world game, vehicle sounds and radio stations are loaded into the cache when the player comes within a few feet of a car. If the player does not enter the car, the sounds remain in the cache until they are eventually released. |
Sound Cues can also be primed, but no delegate fires when loading is complete. (A delegate is a Class that wraps a pointer or reference to an object instance—a member method of that object's Class to be called on that object instance, and that provides a method to trigger that call.) |
If you expect sounds to play shortly after they are loaded, you can set the Loading Behavior of a Sound Wave to Prime on Load: |
You can also set the Sound Class Loading Behavior for a Sound Wave to Prime on Load: |
Additionally, you can set all Sound Waves to prime on load by setting au.streamcache.DefaultSoundWaveLoadingBehavior to 2. |
If a sound must play with zero latency under any circumstance, it can be useful to keep it in memory for the full duration of the USoundWave life span. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.