Sites

Menu
These are the docs for 14.0, an old version of SpatialOS. The docs for this version are frozen: we do not correct, update or republish them. 14.2 is the newest →

The new Inspector (alpha)

The new Inspector (alpha) introduces multiple new features that enhance how you see the data that is relevant to your use case. In addition, it introduces new concepts including queries and constraints to help you get the best out of the Inspector.

The alpha version of the new Inspector doesn’t enforce limits on the breadth, complexity and result sizes of queries, and as such can adversely impact the performance of the Runtime if used without caution. For more information on the general performance impact of the Inspector, see Performance impact.

What’s new

We’ve built the new Inspector with a focus on customization. This has allowed us to provide several significant improvements:

  • See more of the data that’s relevant to you

    The entire application is query-based, so you can restrict the data that you get back from your deployment. As a result, you can see more of the data that’s relevant to your current use case. For example, to show you only the players in a world, you can restrict your query by constraining it to return only entities with a PlayerController component.

  • Customize how you see your data

    The entire application is modular, so you can customize and link together the modules based on your current use case. As a result, depending on what you require, you can tailor your workspace, which is made up of a group of modules. For example, to analyze a playtest in real time, you can set up the workspace in a way that allows you to see and select all your players in one viewport, and then automatically follow them around in another, more detailed viewport.

    In the future, you’ll be able to save the workspaces you create. Watch the video below to learn more about customization.

  • New ways to see your data

    You can not only see your data in a viewport or in an entity details panel, but also in tabular format. You can visualize component data in a table, and select which components you want to see in the columns. All the values update in real time.

Getting started with the new Inspector

In this video, we dig into accessing and using the new Inspector:

Advanced uses of the new Inspector

This second video shows you how to get the most out of the new Inspector by walking you through an example of how to build a custom workspace:

Accessing the new Inspector

You can access the new Inspector for local and cloud deployments.

  • For a local deployment, access the new Inspector at http://localhost:21000/inspector-v2/. When you run a local deployment, the Inspector automatically downloads and caches the latest Inspector Client from the internet. If the Inspector fails to download the latest version from the internet, the latest cached version is used. The failure reasons might be poor internet connection or firewall configuration.

Note: The SpatialOS CLI also prints out the preceding URL to access the Inspector when you launch a local deployment.

  • For a cloud deployment, access the new Inspector in either of the following ways:

    • Opting in from the old Inspector:

    Switch to new Inspector button

    • Directly from the deployment overview page in the Console:

    Click the new Inspector button

Queries and constraints

Queries and constraints are a new concept in the new Inspector. You can find them in the query editor module, and you use them to define and restrict which entity data is streamed from your deployment.

Query editor module

You define queries using one or many constraints that you can combine with each other. This is essentially the same querying mechanism as query-based interest, just with a visual interface.

Different constraint types

Compositional constraints

You can use these constraints as building blocks to link other constraints together and build complex queries.

Constraint type How it works
AndConstraint For an entity to appear in the query result, all of the sub-constraints need to be true.
OrConstraint For an entity to appear in the query result, one or many of the sub-constraints need to be true.
NotConstraint This constraint negates anything that is attached to it as a sub-constraint. For example, you could attach an EntityIDConstraint to show all entities but a specific one.

Spatial constraints

Spatial constraints only return entities whose positions are in the area defined.

Constraint type How it works
BoxConstraint This constraint defines a box in your game world. You can define it by defining two (opposite) corners of the box.
SphereConstraint This constraint defines a sphere in your game world. You can define it by selecting a center point as well as a radius.
CylinderConstraint This constraint defines a cylinder in your game world. You can define it by selecting a center point as well as a radius - its top and bottom bounds are infinite.

Entity and component constraints

You can use these types of constraints to filter for specific entity characteristics. This can help you narrow down a query to only specific kinds of entities.

Constraint type How it works
ComponentConstraint This constraint only returns the entities that have the specifiec component attached to them. If you have an entity that has a unique component attached to it (for example, if only player entities have the PlayerController component) you can use this constraint to filter for only this kind of entity.
EntityIDConstraint This constraint only returns the entity with that specific entity ID. You could use it to find a specific entity in your game world.

Non-conditional constraints

Non-conditional constraints act as a catch-all for situations where you do not want your query (or sub-query) to depend on a condition.

Constraint type How it works
TrueConstraint This constraint always returns all entities.
FalseConstraint This constraint always returns no data.

Using constraints

You can find constraints in the query editor module. You can create only one query per query editor module. You can add, modify, remove, or move constraints to create the query.

Adding a constraint

To add a constraint, click the plus (+) button in the query editor module. From there you can choose the type of constraint that you want to add.

Modifying a constraint

To modify a constraint, type into the text boxes that define it.

Removing a constraint

To remove a constraint, click its drop-down menu and select Delete.

You can’t remove dynamic constraints. Instead, you must delete the connection that links the dynamic constraint with the query editor module. To do that, turn on Edit mode and click the icon in the centre of the connection.

Moving a constraint

You can move constraints around by dragging them. This is useful when you want to change the nesting structure of your query.

Dynamic constraints

You can dynamically pass a constraint to a query editor module, and it will be added to the query. For example, when you want your query to be constrained by the bounds of a viewport, you can pass in these bounds as a constraint by outputting the constraint from the viewport into the query editor. To do that, turn on Edit mode.

Note that constraints that are passed in dynamically are marked with a locked icon. This means that modification is limited (the constraint is set dynamically by the module that is passing it in). You can, however, still nest and re-order these constraints.

Streaming components

You can choose the components that you have interest in and only these components and their values are returned in your query. This helps you manage the amount of entity data that is being processed and streamed.

To add components for streaming, in the Components streamed section of the query editor, complete the following steps:

  1. Select Custom and click the plus (+) sign to show all the available components.
  2. For any component that you have interest in, click the plus (+) sign after the component name.
  3. Close the Add Components window.
  4. Click Run query to start your query with the selected components streamed.

Known limitations

  • The alpha version of the new Inspector is solely focused on entity data, and does not include any worker data. This was a conscious decision from our side in order to let you experiment with it earlier and give us feedback. We’re planning on exposing worker data in a later release.

  • Currently, you can’t save workspaces (configurations of modules). Again, we’re planning on providing this in a later release.

Search results

Was this page helpful?

Thanks for letting us know!

Thanks for your feedback

Need more help? Ask on the forums