- FusionStats Component
- Redraw Interval
- Layout Section
- Fusion Graphs Layout Section
- Network Object Stats Section
- Data Section
- Life-Cycle Section
Fusion Stats consists of a set of UI components for monitoring networking telemetry. The
FusionStats component is the primary component for generating, initializing and controlling a hierachy of telemetry UI elements.
Fusion Stats uses the basic
UnityEngine.UI components, which allows stats to be viewed in builds as either a screen overlay or attached to an object in 3d space.
To add Fusion Stats to a scene:
- run the Unity Editor menu:
Fusion > GameObject > Add Fusion Stats; or,
- right click on Hierarchy, or a
GameObjectin the Hierarchy, and select:
Fusion > Add Fusion Stats.
- If a GameObject is selected:
FusionStatswill default to
StatsCanvasType.GameObject, and the stats will render in 3d space attached to that object.
- If no GameObject is selected:
FusionStatswill default to
StatsCanvasType.Overlay, and stats will render in screen space.
This menu option will also automatically add the
FusionStatsBillboard component to the object. The
FusionStatsBillboard component will automatically rotate the
GameObject toward a camera when
FusionStats.CanvasType is set to
Several additional features are available while the simulation is running. This section presents the various "hidden" features one can find in the
FusionGraph at runtime.
Clicking on the title of a
FusionGraph will bring up a drop list of the view options for that graph (if more than one are available).
Clicking on a the value field of a
FusionGraph at runtime, will cycle through any available averaging options for the current data source.
- Average per Second;
- Average per Tick;
- Average per Sample.
Clicking the very top of the stats panel on the
NetworkRunner name will ping the
FusionStats component in the hierarchy. If no
GameObject is currently selected, this action will also select the
FusionStats component in the inspector.
FusionStats is the primary root component for all Fusion Stats. It generates child Canvas and UI components, and manages connecting these telemetry components to
NetworkObject data sources at runtime.
Limits the UI updates to never happen more than once per this value. Increasing this value will improve performance.
Layout controls, which generally affect the layout of the FusionStats canvas.
There are two canvas modes:
GameObjectwill render the canvases in 3d space.
Overlaywill render the canvas in screen space.
GameObject Rect / Overlay Rect
These two editable rects define where on the
UI.Canvas the stats elements will render, allowing the graphs to be rendered on a specific side or corner of the canvas.
CanvasType is set to
GameObjectRect is used, and allows the stats to be offset from the center of the object they are attached to.
CanvasType is set to
OverlayRect is used, and specifies where on the screen the stats will render.
FusionGraph components will scale as needed to fill the Rect region.
The Rect can be drawn in the inspector by clicking and dragging over the simulated canvas area, or be modified by grabbing the yellow handles and dragging the corners.
Be sure to expand the Rect drawer if you wish to drag the corners.
Fusion Graphs Layout Section
Layout controls which specifically affect the layout of
FusionGraph components (the bottom section of the Fusion Stats canvas).
FusionGraph components will use this Layout setting if their individual setting is set to auto. When set to
Auto, a layout is chosen based on the current width/height of each graph.
No Text Overlap
This setting ensures no Fusion Graph layout options are used where a graphs UI. Text will overlap its graph shader (the vertical telemetry bars). Use this in any use cases where the text appears garbled. Typically this will be any case where the canvas is not perfectly billboarding to face the camera, such as with VR.
Graph Column Count
The graph column count can be set manually with the
FusionStats.GraphColumnCount setting. When setting the
FusionStats.GraphColumnCount to 0, the
FusionStats.GraphMaxWidth value will be used to automatically create new columns when the canvas width exceeds that value.
Graph Max Width
The maximum width to which a
FusionGraph element will expand. Once expanded beyond this width, new columns will be added as needed.
Network Object Stats Section
Options specific to a root
These are only valid when
FusionStats is added to a GameObject with a
Enable Object Stats
Enables usages UI elements and telemetry handling for a root
Object Title Height
Height of the label area for the GameObject name.
Object Ids Height
Height of the section which shows the NetworkObject ID and player authorities.
Object Meters Height
Height of the horizontal meter bar section.
Options for which data sources will be used, and which telemetry will be displayed.
All telemetry data requires a
NetworkRunner association. This will automatically be found when Network Runners start.
There may be more than one runner when in
Multi-Peer mode, so you may want to control which runner type is found (there may be more than one runner when in Multi-Peer mode). These
SimulationModes flags in conjunction with
FusionStats.EnforceSingle ensure that only one instance of this
FusionStats will exist, regardless of how many Peers are running.
Each telemetry item can be included or excluded from the rendered
FusionGraph set. Available telemetry data comes from three parts of the engine, and are grouped accordingly.
Net Stats: Network transport layer statistics, such as Round Trip Time (rtt) and incoming/outgoing data totals.
NetworkRunnerstatistics, such as Resimulation Count, Snapshot sizes, and interpolation/prediction specifics.
NetworkObjectspecific telemetry such as RPC counts, and bandwidth used by Networked state values.
Options which affect singleton and self-destruction of
FusionStats GameObject instances.
When true, the
FusionStats GameObject will be destroyed when its associated
NetworkRunner becomes disconnected.
When true, will destroy repeat
GameObject instances of
NetworkStats which have the same
FusionStats.GUID. This is useful in Multi-Peer mode, when only one instance of a
FusionStats object should exist, rather than one for each Peer. Use this in combination with
FusionStats.ConnectTo to control which peer type should be monitored.
FusionStats.EnforceSingle to identify multiple instances of the same Stats object in Multi-Peer mode.