![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
Unreal Engine Multiplayer Online Deep Dive #UE4DD まとめ
![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
DedicatedServer。Clientに掛かるコストが低かったり、チート対策がし易いというメリットがある。その一方、Serverの設置・運営・通信コストの問題や、セッションごとにServerを割り当てプロセスを起動する仕組みがいるというデメリットがある #ue4dd
2017-07-02 16:08:05![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
ListenServer。クライアントの一つがサーバーになるので、別途サーバを用意する必要がない。通信的に近いUserをマッチングさせることでDedicated Serverよりもレスポンスが良くなる可能性がある #ue4dd
2017-07-02 16:08:58![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
DedicatedとListenのそれぞれ利点と欠点。Dedicatedサーバーは専属的に処理させることができるけど、専用サーバーとしてのリソースが必要。Listenサーバーは専用サーバーを用意しなくてもいいが、Listenになったユーザーに処理が集中する。 #UE4DD
2017-07-02 16:09:41![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
しかし、Serverになったclientに処理と通信が集中する。そのClientの通信状態がそのセッション全体に影響する。そのClientが切断されるとそのセッションが終了してしまう。回避方法はあるがUE4に組み込むのは難しい #ue4dd
2017-07-02 16:10:05![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
Listen Serverの方が有利になる例。サーバーとクライアントの距離関係jによっては、Listen Serverの方がレスポンスがよくなることがある。なるべく近いユーザー同士でマッチングさせることが重要。 #UE4DD
2017-07-02 16:11:26![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
Listen Serverは事例が少ない。しかしサーバーの運用コストが下がるので利用したい。 #UE4DD
2017-07-02 16:12:53![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
Listen ServerはServerとClient両方の処理が必要になる。 DedicatedServer, Listen Server両対応の複製処理を書いておくと変更に強い。( World::GetNetModeで分岐、BlueprintCosmetic ) #ue4dd
2017-07-02 16:14:05![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
GetNetMode関数は最近UE4.16でDedicated Serverに対応したShooter Gameサンプルでも実際に分岐に使われていました。 #UE4DD
2017-07-02 16:15:35![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
Listen Serverに割り当たったClientが切断したらセッションは終了するという欠点がある限り、採用はかなり難しい気がする。#UE4DD
2017-07-02 16:16:29![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
独自サーバは各プラットフォームが色々厳しい制限を設けてて、技術面じゃなくてポリシー面で運用を苦労しているところが多い印象。 #ue4dd
2017-07-02 16:16:30![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
Application Server。プラットフォームのサーバーとは別に用意したタイトル独自のServer。プラットフォームのサーバーでは実現できない機能用。ログインボーナス、独自性の高いイベント、別アカウントとのヒモ付。プラットフォーム間の機能差異の吸収 #ue4dd
2017-07-02 16:16:43![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
Dedicated Serverのサンプルがみたい人はUE4.16のShooter Gameサンプルを読んでみることをおすすめします。#UE4DD
2017-07-02 16:16:51![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
REST APIのプラグイン。Json QueryとVaRest、WebApiプラグイン。VaRestはマケプレで無料配信されているので、導入もしやすいです。#UE4DD
2017-07-02 16:20:39![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
VaRestのマーケットプレースのリンク。#UE4DD unrealengine.com/marketplace/va…
2017-07-02 16:22:52![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
REST APIはあまりUE4に関係する話がないからあとはググってねという感じだ。 #UE4DD
2017-07-02 16:24:06![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
POSIXやWinsockの話だ…このあたりは昔ネットワークシステムを作った時に散々やったことがある。 #UE4DD
2017-07-02 16:25:59![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
WebApiプラグインはプロジェクトに合わせた拡張ができるようにAPI単位でフィルター処理ができるようになってますん。 #ue4dd hogetatu.hatenablog.com/entry/2016/12/…
2017-07-02 16:27:11