BluePrint - Network Sample
Third Personテンプレートを用いてネットワークサーバ、クライアントの動作を実装します。 プロジェクト作成後のディレクトリ構成 Geometry Mannequin ThirdPerson ThirdPersonBP
以下のディレクトリを作成します。 Blueprints/AllLevels Blueprints/Characters Blueprints/Gameplay Blueprints/Lobby UI/Lobby UI/MainMenu Maps
Blueprints/AllLevels/MyGameInstance - #GameInstance BlueprintClass Blueprints/AllLevels/PlayerInfo - #Blueprint Structure Blueprints/AllLevels/MySaveGame - #SaveGame BlueprintClass Blueprints/Characters/BaseCharacter #Copy(Rename) From /ThirdPersonBP/Blueprints/ThirdPersonCharacter Blueprints/Characters/Chara01 # Create Child Blueprint Class from BaseCharacter Blueprints/Characters/Chara02 # Duplicate from Chara01 Blueprints/Characters/Chara03 # Duplicate from Chara01 Blueprints/Gameplay/GameplayGameMode # GameMode Blueprint Class Blueprints/Gameplay/GameplayPlayerController # PlayerController Blueprint Class Blueprints/Lobby/LobbyGameMode # Copy From GameplayGameMode Blueprint Class Blueprints/Lobby/LobbyPlayerController # Copy From GameplayPlayerController Blueprint Class
World Outliner Delete ThirdPersonCharacter Copy NetworkPlayerStart x4 or 8 and Adjust Scale (1.0, 1.0, 1.0) Save as /Maps/Level01 Copy /Maps/Level02 Create /Maps/Lobby (Default Level) Create /Maps/TravelMap (Empty Level) Create /Maps/MainMenu (Empty Level)
Widgets UI/AllLevels/ChatText UI/AllLevels/ChatWindow UI/AllLevels/GameplayChat UI/AllLevels/LoadingScreen UI/Lobby/CharacterSelect UI/Lobby/ConnectedPlayer UI/Lobby/GameSettings UI/Lobby/LobbyMenu UI/Lobby/PlayerButton UI/MainMenu/ErrorDialog UI/MainMenu/HostMenu UI/MainMenu/MainMenu UI/MainMenu/OptionsMenu UI/MainMenu/ServerMenu
Project Settings Maps & Modes Default Maps Editor Setup Map : MainMenu Game Default Map : MainMenu Transition Map : TravelMap Server Default Map : MainMenu Game Instance Game Instance Class : MyGameInstance
Widget Blueprints Show Main Menu Show Host Menu
Show Server Menu Show Options Menu
Macro - DisplayErrorMsg Varables - LaunchLobby Integer - MaxPlayers # Replication = Replicated Text - Server Name # Replication = Replicated Launch Lobby Input Launch Lobby
Input Join Server Blueprint Session Result - SessionToJoin Join Server
Show Loading Screen
Function - NetErrorToString Function - TravelErrorToString
Handle Network Errors Handle Travel Errors Destroy Session
Main Menu Event Graph *** このEventGraphは 後続のSave Checkができてから反映します。
Player Info - Structure Variables - ST_PlayerInfo
Map : Level01 World Settings Game Mode GameMode Override : GameplayGameMode Selected GameMode Default Pawn Class : BaseCharacter Player Controller Class : GameplayPlayerController Map : Lobby World Settings Game Mode GameMode Override : LobbyGameMode Selected GameMode Default Pawn Class : BaseCharacter Player Controller Class : LobbyPlayerController
Reference Blueprint Multiplayer Tutorial Series | Unreal Engine