Overview of the basics of modules, plug-ins and projects in UE4, and a deep dive into integrating third-party dependencies. Presented at MIGS 2016 in Montreal.
Overview of the basics of modules, plug-ins and projects in UE4, and a deep dive into integrating third-party dependencies. Presented at MIGS 2016 in Montreal.
今年3月に発売されたFINAL FANTASY XV WINDOWS EDITIONでは、マルチプレイ実装にPhoton Serverを採用しています。コンソールのバージョンとも親和性が高く、なんと約1週間で動作するところまで到達しました!
本セッションでは、FF15内でのパケット送信のカスタマイズやマルチプレイ特有の実装、バックエンドサーバーの構成などのご紹介に加え、Photonのイントロダクションと最新情報も合わせてご案内いたします。内容の濃い45分間、ご期待ください!
17. Photon Network Engineの概要
Exit Gamesが開発した
高速でスケーラブルなネットワークエンジン
Photon Server is the fastest and easiest to use on-premise
Network Engine to build scalable MMOGs, FPS or any other
multiplayer game and application for PC, Mac, Browser,
Mobile, Console and Cross-Platform. (公式Webより)
要するにすごいらしい
•
•
•
18. .NET CLR (C#)
Photon Network Engineの概要
Photon Core (C/C++)
Reliable UDP Websockets Binary TCP
Server
Application
Server
Application
Server
Application
サーバー クライアント
Photon SDK
(for each platforms)
Client
Application
52. Photon Server
(Master Server)
Photon Server
(Game Server)
Photon Server
(Game Server)
Photon Server
(Game Server)
ダンゴル Client
ダンゴル Client
ダンゴルのPhotonサーバー構成
ダンゴルクライアントからはまずはMaster Serverに接続される
マスターサーバーが負荷状況によりどのGame Serverを使うか判断する
53. Photon Server
(Master Server)
Photon Server
(Game Server)
Photon Server
(Game Server)
Photon Server
(Game Server)
ダンゴル Client
ダンゴル Client
ダンゴルのPhotonサーバー構成
Game Serverが決まったら、クライアント同士の通信は
Game Serverを介して行われる
54. Photon Server
(Master Server)
Photon Server
(Game Server)
Photon Server
(Game Server)
Photon Server
(Game Server)
ダンゴルClient
ダンゴルAPIサーバー
ダンゴルのPhotonサーバー構成
ダンゴルではユーザーマッチング時に外部サーバーと連携する
必要があり、一部SDKに手が入っています
69. 入室処理
function InstantiateLocalPlayer()
{
var prefabName : String = “Birdie”; //prefab name in Resource Folder.
var position : Vector3 = Vector3.zero;
var rotation : Quaternion = Quaternion.identity;
PhotonNetwork.Instantiate(prefabName, position, rotation, 0);
}
74. namespace Photon
{
public class MonoBehaviour : UnityEngine.MonoBehaviour
{
public PhotonView photonView
{
get
{
return PhotonView.Get(this);
}
}
new public PhotonView networkView
{
get
{
return PhotonView.Get(this);
}
}
}
}
RPCの実装
75. public function OnShot(status : ShotStatus)
{
var json : String = JsonMapper.ToJson(status);
photonView.RPC("RpcPlayerShot", PhotonTargets.Others, json);
}
@RPC
function RpcPlayerShot(json : String)
{
var shotStatus : ShotStatus = JsonMapper.ToObject.<ShotStatus>(json);
var player : PlayerController = GetComponent.<PlayerController>();
player.Shot(shotStatus);
}
RPCの実装