スクリプターズカフェ/ログ/ShowUpdatesに関するアレコレを調査
出典: Second Life in Japan
目次 |
[編集] 08/09/06
アバターが座っているプリムからShowUpdates表示が大量に出るの件から、そもそもShow Updatesはどういう場合に出るのかをいろいろ調べてみました。
まずはsupport.secondlife.comのナレッジベースの情報から。
- Knowledge Base I see blue, green, or red triangles coming from objects inworld that I think shouldn't be there.
このナレッジベースによると
- 赤:フルアップデート
- 青:部分アップデート
- 緑:消滅
というのが大雑把な分類のようです。
次に、Show Updates が表示される条件となる更新情報ですが、サーバー(SIM)から送られた以下の仕様のUDPパケットをビューアで受信して処理した時に1つ生成されるようです。
// ObjectUpdate - Sent by objects from the simulator to the viewer
//
// If only one ImageID is sent for an object type that has more than
// one face, the same image is repeated on each subsequent face.
//
// NameValue is a list of name-value strings, separated by \n characters,
// terminated by \0
//
// Data is type-specific opaque data for this object
{
ObjectUpdate High 12 Trusted Zerocoded
{
RegionData Single
{ RegionHandle U64 }
{ TimeDilation U16 }
}
{
ObjectData Variable
{ ID U32 }
{ State U8 }
{ FullID LLUUID }
{ CRC U32 } // TEMPORARY HACK FOR JAMES
{ PCode U8 }
{ Material U8 }
{ ClickAction U8 }
{ Scale LLVector3 }
{ ObjectData Variable 1 }
{ ParentID U32 }
{ UpdateFlags U32 } // U32, see object_flags.h
{ PathCurve U8 }
{ ProfileCurve U8 }
{ PathBegin U16 } // 0 to 1, quanta = 0.01
{ PathEnd U16 } // 0 to 1, quanta = 0.01
{ PathScaleX U8 } // 0 to 1, quanta = 0.01
{ PathScaleY U8 } // 0 to 1, quanta = 0.01
{ PathShearX U8 } // -.5 to .5, quanta = 0.01
{ PathShearY U8 } // -.5 to .5, quanta = 0.01
{ PathTwist S8 } // -1 to 1, quanta = 0.01
{ PathTwistBegin S8 } // -1 to 1, quanta = 0.01
{ PathRadiusOffset S8 } // -1 to 1, quanta = 0.01
{ PathTaperX S8 } // -1 to 1, quanta = 0.01
{ PathTaperY S8 } // -1 to 1, quanta = 0.01
{ PathRevolutions U8 } // 0 to 3, quanta = 0.015
{ PathSkew S8 } // -1 to 1, quanta = 0.01
{ ProfileBegin U16 } // 0 to 1, quanta = 0.01
{ ProfileEnd U16 } // 0 to 1, quanta = 0.01
{ ProfileHollow U16 } // 0 to 1, quanta = 0.01
{ TextureEntry Variable 2 }
{ TextureAnim Variable 1 }
{ NameValue Variable 2 }
{ Data Variable 2 }
{ Text Variable 1 } // llSetText() hovering text
{ TextColor Fixed 4 } // actually, a LLColor4U
{ MediaURL Variable 1 } // URL for web page, movie, etc.
// Info for particle systems
{ PSBlock Variable 1 }
// Extra parameters
{ ExtraParams Variable 1 }
// info for looped attached sounds
// because these are almost always all zero
// the hit after zero-coding is only 2 bytes
// not the 42 you see here
{ Sound LLUUID }
{ OwnerID LLUUID } // HACK object's owner id, only set if non-null sound, for muting
{ Gain F32 }
{ Flags U8 }
{ Radius F32 } // cutoff radius
// joint info -- is sent in the update of each joint-child-root
{ JointType U8 }
{ JointPivot LLVector3 }
{ JointAxisOrAnchor LLVector3 }
}
}
[編集] 統計バーのNet Time
まず気になるのが、この更新パケットが大量になったときのサーバー(SIM)側の負荷です。 統計バーに「Net Time」という項目があるので、ここが参考になりそうです。
更新を大量に発生させる例として、Fakeさんがタイマーを回してプリムの色とSetTextを変更するスクリプトを実験用に作成しました。 このスクリプトを入れたプリムを複数配置すると、ビューアの画面上はShow Updatesの表示だらけになります。
ただしそれでも、Net Time には大きな上昇は見られませんでした。
[編集] 統計バーのPakets In/Packets Out
Net Time とは別に、送受信されているパケット数も統計バーに表示されています。 パケット数は、ビューア側のもの(統計バーのAdvanced→Network→Packets In/Out)と、サーバ(SIM)側のもの(統計バーのSimulator→Packets In/Out)の2種類あります。
また、ビューア側の統計では Objects/Texture/Asset など、項目別の仕様帯域(kbps)も表示されます。
これらの数字を総合的に比較することで、何がどの程度ネットワーク帯域を消費しているのかをある程度把握することができます。
※あくまでネットワーク帯域の話であって、SIMの処理負荷やビューア側の描画負荷などはまた別の話になります。
[編集] Show Updates の目視だけでは分かりづらい
Show Updates表示は見た目で更新量をアバウトに把握するのに役立ちますが、スクリプトアイテムの負荷を判断するには、少なくとも統計バーに表示される帯域の増分なども考慮する必要があるでしょう。 また、合わせてネットワーク帯域以外の負荷項目も十分に加味する必要があるでしょう。
【参考】
- ビューア1.21での統計バー
