Enviar pesquisa
Carregar
【Photon勉強会】完全同期を実現するTrueSync詳解(2017/5/30講演)
•
Transferir como PPTX, PDF
•
0 gostou
•
1,708 visualizações
Photon運営事務局
Seguir
【Photon勉強会】完全同期を実現するTrueSync詳解(2017/5/30講演)
Leia menos
Leia mais
Engenharia
Denunciar
Compartilhar
Denunciar
Compartilhar
1 de 46
Baixar agora
Recomendados
200人での対戦も可能!?Photon 新SDKについて
200人での対戦も可能!?Photon 新SDKについて
Photon運営事務局
【Photon勉強会】1時間でわかるプラグイン開発とその実際(2017/3/23講演)
【Photon勉強会】1時間でわかるプラグイン開発とその実際(2017/3/23講演)
Photon運営事務局
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
Recomendados
200人での対戦も可能!?Photon 新SDKについて
200人での対戦も可能!?Photon 新SDKについて
Photon運営事務局
【Photon勉強会】1時間でわかるプラグイン開発とその実際(2017/3/23講演)
【Photon勉強会】1時間でわかるプラグイン開発とその実際(2017/3/23講演)
Photon運営事務局
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
GetSmarter
ChatGPT webinar slides
ChatGPT webinar slides
Alireza Esmikhani
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
Project for Public Spaces & National Center for Biking and Walking
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
DevGAMM Conference
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
Erica Santiago
Mais conteúdo relacionado
Destaque
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
GetSmarter
ChatGPT webinar slides
ChatGPT webinar slides
Alireza Esmikhani
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
Project for Public Spaces & National Center for Biking and Walking
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
DevGAMM Conference
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
Erica Santiago
Destaque
(20)
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
How to have difficult conversations
How to have difficult conversations
Introduction to Data Science
Introduction to Data Science
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
The six step guide to practical project management
The six step guide to practical project management
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
ChatGPT webinar slides
ChatGPT webinar slides
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
【Photon勉強会】完全同期を実現するTrueSync詳解(2017/5/30講演)
1.
完全同期を実現する TrueSync詳解 & UNET 互換Thunderなどご紹介 Photon運営事務局
2.
TrueSync詳解 Photon運営事務局 並木 健太郎
3.
アジェンダ • TrueSync概要 • 機能紹介 •
使い方説明
4.
TrueSync概要
5.
New Service! Photonの進化系!
6.
何ができるの? • 同期対象すべてのオブジェクトを ラグを最小限に 完全同期 を実現
7.
従来の物理の同期手法 • 従来の物理オブジェクトの同期手法 1. 座標で同期 •
イベント時に座標を同期 – 齟齬は生じない – メッセージ数が大きくなる 2. ベクトルを同期 • 自分自身の座標と移動量、方向を同期 – メッセージ数は少ない – 物理エンジンに決定性がないため齟齬が生じる
8.
決定性 -Deterministic- • 同じ位置、大きさ、重さ、強さで演算すると 全て同じ結果になる –
物理エンジンに決定性がある • Unityの標準物理エンジンには決定性はない – 環境、マシンスペック、タイミングなど – 浮動小数点演算の誤差 – 人為的にキャップするのが一般的
9.
決定性のなさ #1 • 簡単なデモを作りました –
半径0.75、質量5の球が 100の速さで毎秒発射 – 半径1.5 高さ3、重さ50の円柱に衝突 – 床の大きさは32x32 摩擦係数は0.5 – 弾の跳ね返る方向、円柱が落ちる までの時間等少しずつ齟齬が生じる r = 1.5 h = 3 m = 50 r = 0.75 m = 5 v = 100 w = 32 h = 32 μ = 0.5
10.
決定性のなさ #2 • よりわかりやすいデモ –
半径0.75, 質量5の球が 100の速さで毎秒発射 – 一辺が1重さ1の立方体を 4x4x4個積み上げたものに衝突 – 床の大きさは32x32 摩擦係数は0.5 • 絶対に同じ結果にならない =決定性はない r = 0.75 m = 5 v = 100 w = 32 h = 32 μ = 0.5 h,w = 1 m = 1 4x4x4
11.
完全同期を目指すと • 極端な例 (座標) –
4x4x4 = 64個のboxを同期 – 64(個) x 60(fps) x 4(ccu) = 15360(msg/sec) – ほぼ実現不可能 – ベクトルでやっても 齟齬が生じる r = 0.75 m = 5 v = 100 w = 32 h = 32 μ = 0.5 h,w = 1 m = 1 4x4x4
12.
TrueSyncの完全同期とは…? • すべてのクライアントに おいて、同期対象の全イ ンスタンスが同一タイミ ングで同様に動き、かつ 同一タイミングでイベン トが発生する どう実現…?
13.
実現方法の考え方 基本 物理演算の結果を全クライアントで一致させる! そのために 物理エンジンそのものが同期 そして インスタンスへの入力をPhotonで通信
14.
中身は? • PUN • 予測物理エンジン •
ロックステップシステム
15.
PUN • Unity向けに最適化されたPhotonのSDK • TrueSyncでもベース部分はPUNを利用 •
ゲーム内でも併用が可能
16.
予測物理エンジン・キューシステム • 予測物理エンジン • ロックステップシステム –
は、この後の機能紹介で説明します
17.
機能紹介
18.
予測物理エンジン • 決定性をもった物理エンジン • 使用条件を満たせばあらゆるプラットフォーム で同一の結果を導き出す •
浮動小数点の代わりに固定小数点(FP)を利用 • 2D/3Dそれぞれを搭載 • Unityの標準物理エンジン互換で、リプレースが 容易
19.
決定性・クロスプラットフォーム • エンジンそのものはプラットフォーム依存なし • 同一入力があればどのような環境下でも同一の 結果を出す –
条件 • 浮動小数点を使わない • ロックステップシステムを使う
20.
浮動小数点・固定小数点 • 諸悪の根源である浮動小数点を排除 – タイミングやアーキテクチャで演算結果が異なる可 能性があるもの •
TrueSyncでは固定小数点を扱うFP型をすべての 物理演算にて導入
21.
Unity標準エンジン互換 • Unity標準の物理エンジンからの移行が簡単にで きるよう、コンポーネントを置き換えるだけで 利用可能 • シーンエディタでTrueSync対応のオブジェクト を直接生成することも可能
22.
Unity標準エンジン互換
23.
クラス対照表 Unity TrueSync Unity
TrueSync BoxCollider TSBoxCollider PolygonCollider2D TSPolygonCollider2D CapsuleCollider TSCapsuleCollider RidigBody TSRigidBody CapsuleCollider TSCapsuleCollider SphereCollider TSSphereCollider CircleCollider TSCircleCollider TerrainCollider TSTerrainCollider Collistion TSCollision Transform TSTransform ContactPoint TSContactPoint Vector TSVector MeshCollider TSMeshCollider
24.
ロックステップシステム • ゲーム内の入力をキューイングするシステム • Photonサーバーとの最大RTTをバッファリング することにより、クライアント間でズレをなく して同期が可能 •
シンプルなので非常に簡単 • キューの内容を保存することにより、リプレイ が簡単に実現可能
25.
ロックステップシステム 入力 キューイング アップデート
26.
RTT連携バッファリング Client A Client
B Server Client C 50 ms 40 ms 80 ms 全体のバッファを80msに決定
27.
ロックステップシステム全体 • 入力を一旦キューイングし、入力時刻と入力値 をキューイング • キューイングされたデータを全クライアントに 共有 •
バッファリング時間経過後、キューから取り出 しアップデートを実施
28.
シーケンス図 Client A Client
B Client C 入力 共有 共有 Update Update Update
29.
遅延が大きくない…? • 同期の完全性を担保するなら、遅延は仕方ない • 完全性と低遅延を両立することはできないか? –
入力を予測することによりバッファリング時間を小 さくすることが可能に – 予測値が実際の入力と一致しなかった場合は、ロー ルバックして再計算を実施
30.
実際の利用方法
31.
アセットダウンロード • UnityのAsset Storeよ り Photon
TrueSync で検索 • できるだけ新規プロ ジェクトから利用し てください
32.
ルーム参加まで • ルームに入るまではPUNそのものです! • 接続・マッチングは従来通り実装してください •
次ページで説明するTrueSyncManagerを含む シーンをロードすることにより、ロックステッ プシステムが動作を開始 • Demoもご覧になってください
33.
TrueSyncManager • ロックステップシステムの要は TrueSyncManager です! • TrueSyncを使うシーンには必ずこのプレハブを 置いておいてください •
Game Object/TrueSync/TrueSyncManagerで簡 単に導入できます
34.
同期オブジェクト作成 • TrueSyncで基本的なプレハブを用意しています – Cube –
Sphere – Capsule • 既存のプレハブを利用する場合は、Unityの物理 エンジンの代わりにTrueSyncの物理エンジンを 利用してください
35.
入力受取 • 同期するプレハブにはTrueSyncBehaviourを基 底とするクラスを作成してコードを追加 • OnSyncedInput()メソッドで入力から値を受け取 る •
値は必ずFP型(固定小数点)に変換 • キューに値を追加
36.
入力受取例 public class PlayerInput
: TrueSyncBehaviour { public override void OnSyncedInput() { FP accell = Input.GetAxis("Vertical"); FP steer = Input.GetAxis("Horizontal"); TrueSyncInput.SetFP(0, accell); TrueSyncInput.SetFP(1, steer); } }
37.
入力反映 • キューに有効な値があるタイミングで、 OnSyncedUpdate()メソッドが呼ばれる • キューから値を取り出し、オブジェクトに適用 •
時間差もTrueSyncManager.DeltaTimeを利用
38.
入力反映例 public override void
OnSyncedUpdate() { FP accell = TrueSyncInput.GetFP(0); FP steer = TueSyncInput.GetFP(1); accell *= 10 * TrueSyncManager.DeltaTime; steer *= 250 * TrueSyncManager.DeltaTime; tsTransform.Translate(0, 0, accell, Space.Self); tsTransform.Rotate(0, steer, 0); }
39.
インスタンス化 • TrueSyncManager.SyncedInstance()を利用 • 生成するタイミングはOnSyncedUpdate()で
40.
物理のコールバック • Unity標準のと同様にあります – OnSyncedCollision{Enter|Stay|Exit} –
OnSyncedTrigger{Enter|Stay|Exit}
41.
ドキュメント • チュートリアルをぜひご覧ください • https://doc.photonengine.com/ja- jp/truesync/current/tutorial/tstutorial-part1- download-install
42.
使いどころ • プレイヤー(クライアント)数が多いところには 今の所向きません – 遅いクライアントがいると、全員がそこに引っ張ら れるため –
予測機能で補正可能だが、ロールバックの処理が多 く発生すると処理に時間がかかる可能性も • まずは1v1などで検証を
43.
まずはお試しを! • Unity Asset
Storeで無料ダウンロード可能で す! • クラウドサービスも20CCUまで無料! • ぜひお試しください!
44.
最後に
45.
まとめ • Photonは日々進化しています! • 進化系であるTrueSyncをぜひお試しください! •
新サービスにもご期待ください!
46.
Thank you! developer@photonengine.jp
Baixar agora