Cheatsheet
UPROPERTY
| UPROPERTY | UPROPERTY(VisibleAnywhere, Category='Player') |
|---|---|
| BlueprintAssignable | Multicast Delegates only. Exposes property for assigning in Blueprints |
| BlueprintCallable | Multicast Delegates only. Property exposed for calling in Blueprints |
| BlueprintReadOnly | Readable from blueprints, but not writeable |
| BlueprintReadWrite | Read or writeable from blueprints |
| Category | Category of the property. |
| EditAnywhere | Can be edited by property windows, on archetypes & instances |
| EditDefaultsOnly | Edited by property windows, but only on archetypes |
| EditFixedSize | Prevent changing the length of an array (useful for dynamic arrays) |
| EditInstanceOnly | Edited by property windows, but only on instances, not on archetypes |
| Transient | Should not be saved, zero-filled at load time |
| VisibleAnywhere | Visible in property windows, but can't beedited at all |
| VisibleDefaultsOnly | Visible in property windows for archetypes, & can't be edited |
| VisibleInstanceOnly | Visible in property windows for instances, not archetypes, & can't be edited |
UFUNCTION
| UFUNCTION | UFUNCTION(BlueprintCallable, Category = Power) |
|---|---|
| BlueprintAuthorityOnly | Will not execute from Blueprint code if running on something without network authority |
| BlueprintCallable | Can be executed in a Blueprint or Level Blueprint graph |
| BlueprintCosmetic | Is cosmetic and will not run on dedicated servers |
| BlueprintImplementableEvent | Can be overridden in a Blueprint or Level Blueprint graph |
| BlueprintNativeEvent | Designed to be overridden by a Blueprint but also has a native implementation |
| BlueprintPure | Does not affect the owning object in any way and can be executed in a Blueprint or Level Blueprint graph |
| Client | Only executed on the client that owns the Object the function belongs to |
| Exec | Can be executed from the in-game console |
| NetMulticast | Executed locally on the server and replicatedto all clients, regardless of the Actor's NetOwner |
| Reliable | Replicated over the network, and is guaranteed to arrive regardless of bandwidth or network errors |
| Server | Only executed on the server |
| Unreliable | Replicated over the network but can fail due to bandwidth limitations or network errors |
Types
| Types | Prefix | Example |
|---|---|---|
| AActor | A | ACharacter |
| Boolean | b | bool bIsTeaDelicious; |
| Enums | E | enum EPlayerType; |
| Interfaces | I | INetworkConnection |
| Struct | F | FMyStruct; |
| SWidget | S | SMyWidget; |
| Template | T | TArray< int > MyIntArray; |
| UObject | U | UCameraComponent* ThirdPersonCamera; |
Naming & Coding Standards
| Naming & Coding Standards | |
|---|---|
| bool | bool bIsTeaDelicious; |
| float | float TeaWeight; |
| int32 | int32 TeaCount; |
| FName | FName TeaName; |
| FString | FString TeaFriendlyName; |
| UClass | UClass* TeaClass; |
| USoundCue | USoundCue* TeaSound; |
| UTexture | UTexture* TeaTexture;; |
Operator
| Operator | Usage | |
|---|---|---|
| && | AND | |
| II | OR | |
| ! | NOT | |
| <= | LESS THAN OR EQUAL | |
| >= | GREATER THAN OR EQUAL | |
| != | NOT EQUAL | |
| == | EQUAL | |
| ++ | INCREMENT | |
| -- | DECREMENT | |
| ? | IF | |
| : | COLON |
Role
| Role | Description |
|---|---|
| None | The Actor has no role in a network game and does not replicate |
| Authority | The Actor is authoritative and replicates its information to remote proxies of it on other machines |
| Simulated Proxy | The Actor is a remote proxy that is controlled entirely by an authoritative Actor on another machine. Most Actors in a network game, like pickups, projectiles, or interactive objects, will appear as Simulated Proxies on remote clients |
| Autonomous Proxy | The Actor is a remote proxy that is capable of performing some functions locally, but receives corrections from an authoritative Actor. Autonomous Proxy is usually reserved for Actors under the direct control of a player, like Pawns |
Servers
| Network Mode | Description |
|---|---|
| Standalone | The game is running as a server that does not accept connections from remote clients. Any players participating in the game are strictly local players. This mode is used for single-player and local multiplayer games. It will run both server-side logic and client-side logic as appropriate for the local players. |
| Client | The game is running as a client that is connected to a server in a network multiplayer session. It will not run any server-side logic. |
| Server (Listen) | The game is running as a server hosting a network multiplayer session. It accepts connections from remote clients and has local players directly on the server. This mode is often used for casual cooperative and competitive multiplayer. |
| Server (Dedicated) | The game is running as a server hosting a network multiplayer session. It accepts connections from remote clients, but has no local players, so it discards graphics, sound, input, and other other player-oriented features in order to run more efficiently. This mode is often used for games requiring more persistent, secure, or large-scale multiplayer |
Replication
| Replication Feature | Description |
|---|---|
| Creation and Destruction | When an authoritative version of a replicated Actor is spawned on a server, it automatically generates remote proxies of itself on all connected clients. It will then replicate information to those remote proxies. If you destroy an authoritative Actor, it will automatically destroy its remote proxies on all connected clients |
| Movement Replication | If an authoritative Actor has Replicate Movement enabled, or bReplicateMovement is set to true in C++, it will automatically replicate its Location, Rotation, and Velocity |
| Variable Replication | Any variables that are designated as being replicated will automatically replicate from the authoritative actor to its remote proxies whenever their values change |
| Component Replication | Actor Components replicate as part of the Actor that owns them. Any variables within the Component that are designated as being replicated will replicate, and any Remote Procedure Calls called within the component will behave consistently with Remote Procedure Calls called in the Actor class |
| Remote Procedure Calls | Remote Procedure Calls are special functions that are transmitted to specific machines in a network game. No matter what machine an Remote Procedure Call is initially called on, its implementation will run only on the machine it is intended for. These may be designated as Server (only runs on the server), Client (only runs on the Actor's owning client), or NetMulticast (runs on every machine connected to the session, including the server |