ArborFsmの負荷について

Here is a forum for reporting failure to Arbor developer.
Please read the forum rules carefully and enter the information necessary to confirm the problem.

Note:
  • Please read the "Update Guide" carefully when updating Arbor.
  • The bugs that we already know are summarized in "Known Issues", so please check once.
  • Please check ReleaseNote and use the latest version if possible before reporting a bug.
  • Unity beta and alpha versions are not supported. Please use the official release version.
  • In principle, defects caused by the introduction of other assets are not supported. If you find a defect, please report it after isolating which asset is the problem.

ここは、Arbor開発者へ不具合を報告するためのフォーラムです。
フォーラムルールをよく読み、不具合確認に必要な情報を記載するようお願いします。

注意点:
  • Arborを更新する際は「アップデートガイド」をよく読み行ってください。
  • 既に把握している不具合は「既知の問題」にまとめてありますので一度確認してみてください。
  • 不具合報告をする前にReleaseNoteを確認し、なるべく最新バージョンを使用して下さい。
  • Unityのベータ版およびアルファ版はサポート対象外です。正式リリース版をご利用ください。
  • 他アセット導入による不具合は原則サポート対象外です。不具合を見つけた場合はどのアセットの問題であるか切り分けた上でのご報告をお願いいたします。

Forum rules
The items necessary for reporting are as follows.
  • OS(Required)
  • Unity version(Required)
  • Arbor version(Required)
  • How to reproduce(Required)
    The reproduction method should be described accurately so that anyone can read the same procedure.
    If you do not know the exact reproduction procedure, as long as you can remember it, so please tell us what you were doing immediately before and the last time you edited it.
  • Build platform
  • Reproduction project (Minimum configuration not including Arbor and other assets) or video

Note:
  • Please read the "Update Guide" carefully when updating Arbor.
  • The bugs that we already know are summarized in "Known Issues", so please check once.
  • Please check ReleaseNote and use the latest version if possible before reporting a bug.
  • Unity beta and alpha versions are not supported. Please use the official release version.
  • In principle, defects caused by the introduction of other assets are not supported. If you find a defect, please report it after isolating which asset is the problem.

報告に必要な項目は以下の通りです。
  • OS(必須)
  • Unityバージョン(必須)
  • Arborバージョン(必須)
  • 再現方法(必須)
    再現方法については、誰が読んでも同様の手順を行えるよう正確に記述するようにお願いいたします。
    もし正確な再現手順が不明な場合、覚えている限りで構いませんので直前に行っていたことや最後に編集した時のことを教えてください。
  • ビルドプラットフォーム
  • 再現プロジェクト(Arborや他アセットなどを含まない最小構成)もしくは動画

注意点:
  • Arborを更新する際は「アップデートガイド」をよく読み行ってください。
  • 既に把握している不具合は「既知の問題」にまとめてありますので一度確認してみてください。
  • 不具合報告をする前にReleaseNoteを確認し、なるべく最新バージョンを使用して下さい。
  • Unityのベータ版およびアルファ版はサポート対象外です。正式リリース版をご利用ください。
  • 他アセット導入による不具合は原則サポート対象外です。不具合を見つけた場合はどのアセットの問題であるか切り分けた上でのご報告をお願いいたします。
kkk
Posts: 22
Joined: 2018/07/20 07:22

ArborFsmの負荷について

Post by kkk »

お世話になっております。
バグというわけではありませんが、ArborFsmで、FsmをSubStateMachineReferenceを利用して、AIのメイン処理を分けていましたが、負荷が高く感じます。SubStateMachineReferenceは、ステートを移行するたびに再ロードするのでしょうか? 負荷を検証するために Profilerを確認しましたが、FindFieldBase.FindFieldでかなりの時間を要しているようです。Profilerのスナップを載せておきます。一度ご確認お願いします。
Attachments
スクリーンショット 2018-09-03 21.46.54.png
スクリーンショット 2018-09-03 21.46.54.png (203.38 KiB) Viewed 5118 times
User avatar
caitsithware
管理人
Posts: 493
Joined: 2015/08/17 12:41

Re: ArborFsmの負荷について

Post by caitsithware »

ご報告ありがとうございます。

まず、こちらの不具合報告にはフォーラムルールがありますが、その必須項目がなかったため警告させていただきました。
フォーラムルールを確認の上、必須項目も記入するようにお願いいたします。

負荷に関しましては、SubStateMachineReferenceを追加しているステートを初めて実行する際(OnStateAwake)にプレハブをInstantiateしております。
なので、最初の実行時にはInstantiateの負荷及びデシリアライズなどの処理が行われるため高負荷となっています。

また、既に実行したステートに戻ってきた場合はインスタンスを使いまわすようになっていますので、繰り返し実行した場合は問題ないかと思います。

処理負荷の改善は順次行っていきますが、動作上問題ないと思いまずので不具合対応ではなく今後の改善対応とさせていただきます。
kkk
Posts: 22
Joined: 2018/07/20 07:22

Re: ArborFsmの負荷について

Post by kkk »

返信有難うございます。Instantiate時の高負荷については了解しました。
ただ、2回目以降のステート切替時も同様に負荷が高い気がします。資料をご確認ください。
できれば、SubStateMachineReferenceを利用したいので、こちらでも負荷軽減策が無いか模索してみます。

以上よろしくおねがいします。

環境
Unityバージョン: 2018.1.16f1
Arborバージョン: 3.2.0
OS: maxOS High Sierra 10.13.6
再現方法: SubStateMachineReferenceを利用したステート管理。SubStateMachineReferenceからSubStateMachineReferenceを呼ぶこともしています。
Attachments
スクリーンショット 2018-09-04 9.17.54.png
スクリーンショット 2018-09-04 9.17.54.png (114.7 KiB) Viewed 5101 times
User avatar
caitsithware
管理人
Posts: 493
Joined: 2015/08/17 12:41

Re: ArborFsmの負荷について

Post by caitsithware »

詳細ありがとうございます。

その画像にある負荷については、SubStateMachineReferenceから抜ける際に遷移回数の初期化のためにStateLinkを全検索している関係ですね。
こちらも改善できないか検討いたします。
kkk
Posts: 22
Joined: 2018/07/20 07:22

Re: ArborFsmの負荷について

Post by kkk »

見た感じ、ArborFSMInternal.ClearTransitionCountでリセットしているtransitionCountは、Editorでしか使われていない感じなので、とりあえずUNITY_EDITORで囲って対応できそうです。ありがとうございました。
Locked