Fixing Readme images
|
@ -116,7 +116,7 @@ r.SupportMaterialLayers=False
|
|||
r.LightPropagationVolume=False
|
||||
|
||||
[/Script/EngineSettings.GameMapsSettings]
|
||||
EditorStartupMap=/Game/MainMap.MainMap
|
||||
EditorStartupMap=/Game/MainMenuMap.MainMenuMap
|
||||
LocalMapOptions=
|
||||
TransitionMap=None
|
||||
bUseSplitscreen=False
|
||||
|
|
|
@ -16,28 +16,28 @@
|
|||
There are two Maps: *MainMenuMap* and *MainMap*
|
||||
|
||||
- **MainMenuMap:** Takes care of creating sessions. It has the host and client logic, and creates a Menu that displays some information when connecting. The menu doesnt do much. Its meant as a starting point for you to extend. Important variables in the level blueprint:
|
||||
![Level Blueprint Variables](..images/HL2/LevelBPVariables.png)
|
||||
![Level Blueprint Variables](images/LevelBPVariables.PNG)
|
||||
* **TargetMap**: A string that contains the name of the map the host will load, and clients will connect to.
|
||||
* **IP_TextField**: The IP Address of the host. Its hard-coded for simplicity, but ideally you will want to provide a way for changing this, or discovering it, at runtime.
|
||||
|
||||
There are two important functions that the *MainMenuMap* performs:
|
||||
- **Host:** The Host creates a session, and then immediately opens the map/level that it wants all clients to connect to. Since the host is also a player (rather than a dedicated server), we set it to be a *listen* server under the "Open Level" options. Note that the LevelName is passed as a variable string defined in the Level Blueprint .
|
||||
![Hosting](..images/HL2/BP_Host.png)
|
||||
![Hosting](images/BP_Host.png)
|
||||
- **Join:** Joining is very similar to hosting. The primary difference is that once a session is created, instead of opening a Map/Level by name, we pass the "Open" command an IP address. We used a simple "Execute Console Command" node to do this.
|
||||
![Joining](..images/HL2/BP_Join.png)
|
||||
![Joining](images/BP_Join.png)
|
||||
|
||||
- **MainMap:** This is the Map that clients will connect to. Its main function (other than dsiplaying the level geometry) is to spawn the XRGameMode. This map will make use of the important Blueprint Assets in the Blueprints folder:
|
||||
![Blueprint Assets](..images/HL2/BlueprintAssets.png)
|
||||
![Blueprint Assets](images/BlueprintAssets.png)
|
||||
- **XRGameMode:** Spawns a XRPlayerController and a HUD.Note that it does *not* spawn a Pawn. This is because there will be multiple pawns, one for each client, and we want to ensure that there is logic so that each controller is able to control only its own Pawn.
|
||||
![Game Mode](..images/HL2/XRGameMode.png)
|
||||
![Game Mode](images/XRGameMode.png)
|
||||
- **XRPlayerController:** Every player will have a single player controller. The XRPlayerController takes care of spawning the avatar for its own client. Since multiple controllers may be replicated to a machine from the server, we need to make sure we are using the "local" player controller, i.e, the one that owns this client.
|
||||
![Spawn Player Avatar](..images/HL2/SpawnPlayerAvatar1.png)
|
||||
![Spawn Player Avatar](images/SpawnPlayerAvatar1.png)
|
||||
Once we have the correct controller, we can proceed to call the spawning code on the server. The server then replicates this to every client.
|
||||
![Spawn Player Avatar Continued](..images/HL2Collab/SpawnPlayerAvatar2.png)
|
||||
![Spawn Player Avatar Continued](images/SpawnPlayerAvatar2.png)
|
||||
Note that SpawnAvatar is a custom event, and it is set to "RunOnServer".
|
||||
![Custom Event Spawn Avatar](..images/HL2Collab/CustomeEventSpawnAvatar.png)
|
||||
![Custom Event Spawn Avatar](images/CustomeEventSpawnAvatar.png)
|
||||
- **XRPawn:** The Pawn/Avatar updates and stores its position and rotation in HeadPos and HeadRot variables every tick.
|
||||
![Pawn Variables](..images/HL2Collab/XRPawnVariables.png)
|
||||
![Pawn Variables](images/XRPawnVariables.png)
|
||||
They are set to "replicate" so that when XRPawn sends this data to the server (again, via a custom event), the server replicates it to all the clients.
|
||||
![Spawn Player Tick](..images/HL2Collab/XRPawnTick.png)
|
||||
![Spawn Player Tick Continued](..images/HL2Collab/XRPawnTick2.png)
|
||||
![Spawn Player Tick](images/XRPawnTick.png)
|
||||
![Spawn Player Tick Continued](images/XRPawnTick2.png)
|
||||
|
|
До Ширина: | Высота: | Размер: 85 KiB После Ширина: | Высота: | Размер: 85 KiB |
До Ширина: | Высота: | Размер: 110 KiB После Ширина: | Высота: | Размер: 110 KiB |
До Ширина: | Высота: | Размер: 56 KiB После Ширина: | Высота: | Размер: 56 KiB |
До Ширина: | Высота: | Размер: 42 KiB После Ширина: | Высота: | Размер: 42 KiB |
До Ширина: | Высота: | Размер: 32 KiB После Ширина: | Высота: | Размер: 32 KiB |
До Ширина: | Высота: | Размер: 9.6 KiB После Ширина: | Высота: | Размер: 9.6 KiB |
До Ширина: | Высота: | Размер: 136 KiB После Ширина: | Высота: | Размер: 136 KiB |
До Ширина: | Высота: | Размер: 122 KiB После Ширина: | Высота: | Размер: 122 KiB |
До Ширина: | Высота: | Размер: 27 KiB После Ширина: | Высота: | Размер: 27 KiB |
До Ширина: | Высота: | Размер: 316 KiB После Ширина: | Высота: | Размер: 316 KiB |
До Ширина: | Высота: | Размер: 50 KiB После Ширина: | Высота: | Размер: 50 KiB |
До Ширина: | Высота: | Размер: 7.0 KiB После Ширина: | Высота: | Размер: 7.0 KiB |
До Ширина: | Высота: | Размер: 8.5 KiB После Ширина: | Высота: | Размер: 8.5 KiB |