| ... | ... | @@ -55,6 +55,38 @@ The main toolkit module [`RWTHVRToolkit`](https://git-ce.rwth-aachen.de/vr-vis/V |
|
|
|
|
|
|
|
### GamePlay Framework
|
|
|
|
|
|
|
|
The gameplay framework currently consists of the following extensions:
|
|
|
|
|
|
|
|
1. `RWTHVRGameMode`
|
|
|
|
2. `RWTHVRPlayerState`
|
|
|
|
3. `BP_VirtualRealityPawn`
|
|
|
|
|
|
|
|
**1. `RWTHVRGameMode`**
|
|
|
|
|
|
|
|
The `RWTHVRGameMode` blueprint is based on the `RWTHVRGameModeBase` C++ class, which in turn inherits from [`AGameModeBase`](https://docs.unrealengine.com/5.3/en-US/API/Runtime/Engine/GameFramework/AGameModeBase/).
|
|
|
|
|
|
|
|
It controls the flow of the application and handles new players and the corresponding default classes. **It is important to notice that it only exists on the server, not on any clients!**
|
|
|
|
The `RWTHVRGameMode` blueprint sets the following defaults:
|
|
|
|
|
|
|
|
- Default Pawn: `BP_VirtualRealityPawn`
|
|
|
|
- Default Player State: `RWTHVRPlayerState`
|
|
|
|
|
|
|
|
Additionally, it overrides the `InitNewPlayer` function to check for specific join options in the Join-Session string that new clients send to the server on initial connection. This happens when nDisplay nodes join a server. We need to identify those here to spawn a dummy spectator pawn for all the secondary nodes, and only a regular default pawn for the primary nDisplay node.
|
|
|
|
|
|
|
|
In case a primary/secondary node is identified by the connection string, the Game Mode sets the corresponding player type on the new player's `RWTHVRPlayerState`.
|
|
|
|
|
|
|
|
In the `PostLogin` override, the player type is then queried and the correct pawn spawned and possessed.
|
|
|
|
|
|
|
|
**2. `RWTHVRPlayerState`**
|
|
|
|
|
|
|
|
The `RWTHVRPlayerState` is a simple extension of [`APlayerState`](https://docs.unrealengine.com/5.3/en-US/API/Runtime/Engine/GameFramework/APlayerState/). It extends the basic class by adding support for a replicated PlayerType variable, which stores the corresponding player's (hardware) type, and can be one of the following: `nDisplayPrimary`, `nDisplaySecondary`, `Desktop`, `HMD`.
|
|
|
|
|
|
|
|
For now, it is set to the first two in case the GameMode notices a corresponding connection string for the connecting client, or in the Pawn in case of standalone mode or the latter two types.
|
|
|
|
|
|
|
|
**3. `BP_VirtualRealityPawn`**
|
|
|
|
|
|
|
|
As the Pawn is more involved, it gets its own [Pawn](#Pawn) section below.
|
|
|
|
|
|
|
|
### Pawn
|
|
|
|
|
|
|
|
### Replication
|
| ... | ... | |
| ... | ... | |