Skip to main content

Project Diagnostics

As of Playable Plugin 2.0.0, Project Diagnostics has been given a huge update with a brand new look and plenty of new features!

Project Diagnostics can be found within the Develop tab of the Playable Plugin (whilst using Playable Plugin 2.0.0 and on).

This is where you can find all project errors, warnings and suggestions displayed in an easy-to-navigate, categorised and filterable way.

See the bottom of this page for legacy information, though we would recommend you to always update to the latest version of Luna Playable to make the most of all the new features and fixes!

When to use it#

Project Diagnostics aims to streamline the debugging experience with Luna Playable: After building the diagnostics window will display any pertinent warning/error messages based on that build's outcome.

It's also a useful way to view the compilation status without having to compile your project or switch over to your IDE.

These messages can be double-clicked to take you to where in your scripts we believe the problem is originating. You can also click on the error-code at the beginning of diagnostic messages to be taken to the relevant documentation page here, that will in turn direct you to possible fixes.

How it works#

To analyse the solution, Diagnostics will construct the solution file in the same way as the build process but rather than compiling it to JavaScript, we instead analyse the project with Roslyn to quickly obtain all compilation information.

Diagnostic logs are grouped by severity. You can filter logs using either the search bar, or one of 3 predefined filters at the top of the diagnostic section.

Any errors you see in this panel regarding the UnityEngine namespace, actually refer to our version of UnityEngine and therefore highlight compatibility issues between your project and Luna.

Diagnostics UI guide#

1. Build button options & Previewing#

At the top left of the Diagnostics window is the 'Build project' button.

This button also provides a drop down of different compilation options:

  • Build project: This will begin the process of a creating a develop build.
    (You can preview a develop build in your browser via the post build prompt options, or the 'Start server' button near the top right of the window)
  • Assets diagnostics: This will recompile only your playable's assets, and filter the logs to only pertain to said assets.
  • Code diagnostics: This will recompile only your playable's custom scripts, and filter the logs to only pertain to said scripts.

By default the button will be set to 'Build project'.

images-medium

2. Last Build & Success Indicator#

Project Diagnostics also displays at what date and time you last built (this includes builds that fail). This handy for keeping track of if you've applied your recent project changes to your Luna build.

(If you don't see a last build indicator it likely means you have yet to build)

images-medium

A build success indicator is also present to the left of the 'Last Build' information, in the form of a colored circle that will change color based on the outcome of the build:

  • Green: build was successful
  • Red: build failed

For more information on what happens at each step of the build process click here.

3. Log types#

Project Diagnostics sections out logs in a similar way to Unity's console.

Logs fall under:

  1. Errors: Anything preventing a bundle from being built (e.g. compilation and build errors).
  2. Warnings: Issues that will significantly impact the performance and integrity of the resulting build (e.g. misconfigured settings in Luna, high-impact performance dark patterns, lack of end-card/click/etc.).
  3. Suggestions: Any suggestions we have to improve the performance of the playable, or minor issues with low-impact (e.g. Power-of-two texture sizes, low-impact performance dark patterns, compression, number of PG fields).

images-medium

In order to see any logs that fall under one of these sections, you will need to click on the section header of choice (seen above), this will expand the section showing each individual log.

4. Double-click to Open#

To open the file a diagnostic's error is pointing to, simply double-click on the error log. This will open the Unity script at the line where the error is stemming from. (Example of this process below)

images-medium

5. Error Codes#

Diagnostic logs also come with unique error codes attached to them. These codes link to pages here in the documentation, that will provide an explanation of the error type as well as steps to fix.

You can easily find the corresponding docs page by selecting a log in the plugin (e.g. box 1 in the image below), and then clicking on the code in the log details section (e.g. in the image below: box 2, the underlined code).


images-medium

6. Log filters#

When using multiple different filters together, the result will be logs that meet all of the individual filter conditions selected

a) Filter by stage

This filters logs down to those that occurred at one of the 3 stages prior to build completion:

  • Stage 1 (This is when all resources from the Unity project are gathered and then prepared for Stage 2)
  • Stage 2 (This is when compression is applied to assets, as well as font bitmap generation, applied custom scripts, and any other asset processing needed)
  • Stage 3 (Conversion from C# to JavaScript)
images-medium

b) Filter by error type

This filters logs by their issue type:

  • All Error Types: This is the default option. This will show all errors regardless of type.
  • Uncategorized: Errors that do not fall into any of the other categories.
  • Compilation Error: Errors that occurred during compilation.
  • Export Error: Errors that occurred during exportation.
  • Performance: Issues that are negatively impacting your playable's FPS. E.g. excessive mesh colliders or large rigidbody counts.
  • Luna Settings: Issues that relate to what your settings are in the Playable Plugin window. E.g. code minification or missing a preloader.
  • Rendering: Errors that relate to rendering.
  • Build Size: This error will occur when your playable's build size has gone over the max size that most Ad Networks allow.
  • Engine Build: Errors that are to do with limitation that come from our use of Bridge.NET. We have a list of things to avoid in order to circumvent such errors here.
images-medium

c) Filter by error sub-type

This filters logs by their issue sub type:

  • All Error Sub Types: This is the default option. This will show all errors regardless of sub type.
  • Uncategorized: Errors that do not fall into any of the other categories.
  • Missing API: Errors that relate to use of unsupported APIs in your included custom scripts. E.g. Use of NavMesh.
  • Syntax Error: Syntax mistakes in included scripts.
  • Luna Internal Failure: Errors that are due to a problem in our engine. Please report these to us so we can work on a fix!
  • Dark Patterns: Issues that are caused by inadvisable coding practices. E.g. having 20 GetComponent calls in an Update loop.
  • Asset Size: These logs will point to included assets that are overly large for a playable.
  • UI Settings: Issues that relate to toggle-box settings in the Playable Plugin window. E.g. Resources folder not included.
  • Best Practices: These will be changes we suggest in order to improve your playable, but are not necessary in order to build.
  • Required Playable API: This error will occur if your playable is missing required API calls. E.g. InstallFullGame() or GameEnded().
  • Shaders: Issues relating to shaders in your playable.
  • Assets: Issues relating to assets in your playable.
  • Textures: Issues relating to textures in your playable.
  • Sounds: Issues relating to sounds in your playable.
  • Fonts: Issues relating to fonts in your playable.
  • Video: Issues relating to videos in your playable.
images-medium

Opening the Luna Solution#

Instead of opening your Unity solution file, you can instead use the "Open Luna Solution" button in the code tab to open the solution file, regardless of whether there are any errors occurring. This is useful to be made aware unrecognised APIs as you code, saving changes in the Luna solution also saves them to your original Unity Scripts.

NOTE: This is not the same as opening the script from within Unity, this will instead open the Luna Solution version.
The scripts will use Luna's version of the Unity Engine, while also linking changes made here to their original Unity counterparts.

How to analyse your project#

  1. Load the project you wish to build with Luna Playable in Unity.

  2. Ensure you have Luna Playable installed and included in the project. To learn more about setting up Luna Playable visit our Getting Started guide.

  3. Open the Luna Playable window and navigate to the Develop section, and hit 'Build'.

  4. Issues with your project identified by the plugin will now appear in the window after the build finishes. The top table will contain issues grouped depending on the severity level, or by one of the 3 predefined filters if selected.

  5. Selecting a log will display more specific information at the bottom of the panel, including the full error message and a code snippet of the issue.

  6. You can double click on a log to open the relevant script at the line the message pertains to in the Luna Solution. You can also click on the error-code at the beginning of diagnostic messages to be taken to the relevant documentation page here.

Where to find Legacy Project Diagnostics (1.13.0 and previous)#

CLICK HERE for legacy Project Diagnostics information

To access Project Diagnostics in Playable plugin versions 1.12.0 and previous, you need to navigate to the Code section and select the Diagnostics tab.

luna-ui-code

When to use it#

Diagnostics is a useful way to view the compilation status without having to compile your project or switch over to your IDE.

Often you may want to simply exclude any code that won't be needed in your playable, simply open the Diagnostics (and hit 'Refresh') to see how these changes impact the compilation. The same is true for the other code related Luna features;

With the 'Compile' button you can trigger a code compilation, this will recompile your code without executing a full build (exporting assets). This is useful when iterating on code changes since it will be faster than a 'Develop' build but means only code changes will be updated in the output.

Opening the Luna Solution#

To open the file a diagnostic's error is pointing to, simply double-click on the error message shown in the window. This will open the script at the line where the error is stemming from:

medium

This is not the same as opening the script from within Unity, this will instead open the Luna Solution version.
The scripts will use Luna's version of the Unity Engine, while also linking changes made here to their original Unity counterparts.

Alternatively you can use the "Open Luna Solution" button at the bottom of the same window to open the solution file, regardless of whether there are any errors occurring.

How it works#

To analyse the solution, Diagnostics will construct the solution file in the same way as the build process but rather than compiling it to JavaScript, we instead analyse the project with Roslyn to quickly obtain all compilation information.

Diagnostic logs are grouped either by the CS error code, or by the file in which they occur, you can change this with the 'Group By' option.

Any errors you see in this panel regarding the UnityEngine namespace, actually refer to our version of UnityEngine and therefore highlight compatibility issues between your project and Luna.

How to analyse your project#

  1. Load the project you wish to build with Luna Playable in Unity.

  2. Ensure you have Luna Playable installed and included in the project. To learn more about setting up Luna Playable visit our Getting Started guide.

  3. Open the Luna Playable window and navigate to the Code section, and the Diagnostics tab.

  4. Issues with your project identified by the plugin will now appear in the window. The top table will contain issues grouped depending on the 'Group By' option, selecting an entry here will populate the table below with the logs for that particular group.

  5. Selecting a log will display more specific information at the bottom of the panel, including the full error message and a code snippet of the issue.