This document is about: FUSION 1
SWITCH TO

このページは編集中です。更新が保留になっている可能性があります。

概要

Level 4

概要

キネマティックキャラクターコントローラ(略してKCC)は、rigidbodyを使用せずに制約(コリジョンなど)に応じたキャラクター動作を可能にします。KCCは物理による影響を受けませんが、コリジョンに制約されながら動作を実行します。

FusionのアドバンストKCCアドオンは、ゲームタイプに縛られない、汎用的かつ比較的低いレベルのキャラクターコントローラソリューションです。Fusionの色々なプロジェクトに統合する際に、フリクションやブロートをできる限り生じさせないようにする目的で作成されました。

使用方法

KCCを使用するには以下のステップに従います。

  1. PrefabsやKCC.prefabのプレハブバリアントを作成する、または新しいオブジェクトとKCCコンポーネントを作成する
  2. 設定を行う(半径、高さなど)
  3. Settings/Processors(設定/プロセッサ)のKCCプロセッサをリンクする
  4. KCC public APIを使用してインプットプロパティを設定する

KCCへのインタラクションを提供するオブジェクトには必ずNetworkObjectコンポーネントが必要です。

重要: KCCの内部の詳細を見る前に、KCCサンプルプロジェクト(別途パッケージ)を参照してください。全コードがドキュメント化されており、テスト用プレイグランドもあります。

ダウンロード

バージョン リリース日 ダウンロード
1.1.13 Jan 24, 2024 Fusion KCC 1.1.13 Build 400

機能まとめ

  • Full control over position and look rotation (pitch + yaw).
  • Physics query and depenetration for capsule collider.
  • Interpolated render for networked proxies, extrapolated render with full simulation for objects with input or state authority.
  • Combined dynamic (physics-like) and kinematic (unrealistic) velocity based movement.
  • Support for unconstrained external forces - acceleration, velocity, force, impulse.
  • Base implementation for Ground and Air with configurable kinematic acceleration and friction models (both can be treated as advanced example).
  • Pipeline with "stages" and "processors". In each stage, KCC processors calculate different properties (tangent, speed, velocity, ...) which are then used in following stages / physics query / post-calculations.
  • Processors can be be used directly as prefabs (shareable, must be stateless) or scene objects (can be stateful with networked properties).
  • Embedded support for 2 types of interaction - manually registered ("KCC Modifier") and collision based ("KCC Collision"). Interactions are default way to inject processors into movement calculation pipeline.
  • Support for processors priority (execution order) and suppression - this allows absolute, additive, multiplicative or hybrid calculations of properties in processors chain.
  • Basic setup for synchronizing networked properties (radius, height, mass, ...), optional synchronization of other properties.
  • Custom Collider filtering callback, ignoring child colliders.
  • Custom Collider ignore list (networked).
  • Continuous collision detection.
  • Collision enter/exit callbacks for authority.
  • Separate game object for KCC collider - child object created at runtime.
  • Support for terrain collider.
  • Support for ground snapping and step height.
  • Automatic / Manual execution of update methods, support for local non-networked KCC.
  • Extensible data structures.
  • Pooling compatible.
  • Network & performance optimized.
  • Platform independent, mobile friendly.
  • Fully commented example with testing playground (separate package).
  • Basic support for frame by frame debug - editor drawings and logging.

外挿動作の主なメリットとデメリット

メリット:

  • インプットへの即時応答
  • ネットワーク条件へはほぼ変化なし

デメリット:

  • レンダリングフレームでのシミュレーションのCPUプレッシャーの増加
  • 変数デルタ時間による、レンダリングアップデートでのデルタ時間ベース累計と、固定アップデートとの不整合性
  • 外挿エラー訂正の必要性

アドオンのアップデート

新しいKCCパッケージをインポートする前に、KCCのルートフォルダ(Assets > Photon > FusionAddons > KCC)を削除してしまうことを推奨します。多くの場合、KCCはFusion SDKの新しいバージョンと前方互換性を持ちます。

新しいFusion SDKへのアップデート時に問題が生じる場合は、Photon事務局へお問い合わせください。

延長

KCC and its data structures are prepared for extensions through partial implementation. This allows you to write custom functionality, extend public API and have access to private data for further processing (be careful) without touching our files. It also makes the update process much easier and conflicts-free.

Partial implementation can be used on these classes:

  • KCC - extending API, networked properties setup through InitializeUserNetworkProperties()
  • KCCData - adding custom rollback-able properties for use in processors (and movement update in general)
  • KCCSettings - adding custom settings
  • KCCInteraction - adding custom getters for further filtering or extracting data from all interactions
  • KCCCollision - adding custom getters for further filtering or extracting data from collisions
  • KCCModifier - adding custom getters for further filtering or extracting data from modifiers
  • All KCC extensions and utility classes

For more details and extension examples, please see KCC Sample project (separate package).

Dynamic vs. Kinematic velocity

Dynamic velocity is designed to mimic physics-like behavior and is primarily driven by forces. The KCC provides a single stage to calculate it. Kinematic velocity on the other hand is designed to cover all other movement velocities and provides more stages (4) to mix any kind of unrealistic movement.

The resulting desired velocity is the sum of dynamic and kinematic velocity.

既知の問題

  • Depenetration algorithm sometimes fails when colliding with multiple colliders (especially concave mesh colliders), causing minor jitter.
  • 現在ステップ検知はレイキャストベースとなっており、品質があまりよくありません。シェイプオーバーラップで修正されます。
Back to top