CRIWARE Unity Plugin Manual  Last Updated: 2024-07-12
Procedure for in-game preview

Creating data for in-game preview

To use the in-game preview function, you must create ACB and ACF files specifically built for in-game preview.

(1) Building binary files for in-game preview

In the project tree of CRI Atom Craft, right-click on a Cue sheet, and select Build Atom CueSheet Binary.
In the Build Atom CueSheet Binary dialog box, select the With in-game preview binary option to build Atom CueSheet binary files (ACF, ACB, AWB) for in-game preview.

adx2u_keys_ingame_process_build.png
Atom Cue Sheet Binary dialog box

[Note]
An in-game preview binary file is different from an ordinary binary file as shown below.
  • It contains parameters with default values.
  • It contains unique IDs for data search.
  • Maximum sizes are set to support data and waveform replacement (which can potentially change the ACB and the ACF files sizes).

(2) Copying binary files for in-game preview

Binary files for in-game previews are created in the inGamePreview folder under the project folder.
Copy all the files in the inGamePreview/Assets folder to the Assets folder of the Unity project.

Structure of the CRI Atom Craft project folder
  * CriAtomCraft

  \ * Tutorial

    o * Material

    \ * PC

      o * Assets

      \ * inGamePreview

        \ * Assets

 

Project root path

Material root path

 

Normal asset data

 

Asset data for in-game preview

 



Configuring the in-game preview

To use the in-game preview, you first must configure the Unity project.
In the CRIWARE Library Initializer properties, select the Uses In Game Preview option.
adx2le_unity_ingame_initialize.png
The " [CriAtom] In-game preview (pinball demo) " sample supports in-game preview. You can use it as a reference.

Running the in-game preview

(1) Configuring the target application

In CRI Atom Craft, specify the IP address of the target application for in-game preview.
  1. From the Tools -> Properties menu, open the Properties dialog box.
  2. In the Target section of the Properties dialog box, select the platform you are using.
  3. In the IP Address box of the Preview Settings section, specify the IP address of the target application.

    adx2u_keys_ingame_process_ip.png
    Properties dialog box
A WiFi connection is required to connect to a smartphone.

Network environment for in-game preview
The Windows OS that started CRI Atom Craft and the target application must be on the same network.
For a smartphone, a WiFi network is required for connection.
When using WiFi, inter-device access must be allowed. (The private separator must be OFF.)
If the connection cannot be established in your company environment, please contact your network administrator.
Security warning from Windows
When you run an application that supports in-game preview, a Windows warning may appear.
This is because the applications are trying to communicate.
If the Windows warning appears, select Allow Access or Unblock to allow the communication.
windows_seculity_warning.png

(2) Starting in-game preview

When the in-game preview is started, the application (server) communicates with CRI Atom Craft (client).
  1. First, start the application that uses binary files for in-game preview.
  2. Then, start CRI Atom Craft and open the project file that created the binary files for this in-game preview.
  3. Select the Preview -> Start In-Game Preview menu (or press the F10 key).
    Once the communication is established, a preview window appears.

    adx2u_keys_ingame_process_previewing.png
    Preview window

Error callback during data update
When the connection to the in-game preview is established or when large changes are made to the project, data is updated and all sounds are stopped.
In that case, many of the following notifications will appear in both the tool and the Unity plugin.
W2013022700:Cannot access the content of the Cue Sheet during data transmission by the authoring tool.
You can ignore these warnings. They are normal as the system tries to load data while it is being updated.
When the data update is complete, these warnings will no longer occur.

(3) Changing parameters during in-game preview

Once the connection is established, the parameters changes in CRI Atom Craft are reflected in the application in real-time.
Changing parameters such as volume
If the volume of the Music 1 Cue is modified in CRI Atom Craft while it is being played by the application, the volume will change accordingly in the application.
Similarly, if the send level of DSP bus 1 is raised, more reverb will be applied in the application.
In both cases, the sound will not stop because these changes do not require updating the data.
Replacing a waveform or changing its timing
Larger changes - such as moving a waveform on the timeline or adding an AISAC - will trigger an update of the data and stop the playback in the program.
Playback in the program will resume once the data update is complete. In these cases, please wait for the communication to finish.
When using memory playback, you can replace the waveform directly for preview.
This can be done easily by selecting the waveform on the timeline and then using the Change Referenced Material Waveform command of the context menu.

lepc_sample_prog_ingame_replace.png

What is not possible in in-game preview
In the in-game preview mode, you cannot replace waveforms using streaming playback.
In the sample data, music and voice waveforms are set for streaming playback. You cannot replace them during in-game preview.
However, you can change parameters such as the playback volume.

(4) Finishing in-game preview

You can use one of the methods below to finish the in-game preview:
  • (a) Stop the in-game preview function in the application.
  • (b) Stop in-game preview in CRI Atom Craft.
    • Select the Preview -> Stop In-Game Preview menu (or press the Ctrl+F10 key).
[Note]
If the Uses In-Game Preview option of the CRIWARE Library Initializer is selected in Unity Editor, the in-game preview function will be automatically initialized and finished.

[Warning]
Currently, in-game preview does not work on some PCs.
We are currently investigating this issue and will offer a solution as soon as possible.

Troubleshooting in-game preview

If multiple applications support in-game preview
If several applications supporting in-game preview are running simultaneously on a single device, the in-game preview connection cannot be established successfully.
In particular, for a smartphone, check that an ADX sample program or an application under development that was previously started is not running.
If the connection does not work, close other application processes and try again.
If the in-game preview connection fails
le_tool_ingame_failed_no_target.png
If the in-game preview connection from the tool fails, a connection failure message will be displayed in CRI Atom Craft's log window.
Please check the following:
  • Is the correct IP address (for the target) specified in the CRI Atom Craft' tool properties?
  • In the case of a WiFi connection, are the Windows OS that runs CRI Atom Craft and the application on the same network?
  • Has the IP address not been changed on the smartphone due to an unexpected connection to another WiFi network?
  • Has the application initialized the library for in-game preview?
If the connection is established successfully but no files are displayed in the in-game preview window
le_tool_ingame_failed_no_data.png
If the in-game preview window indicates "Connected" but nothing is displayed in the CueSheet list, please check the following:
  • Does the application load the binary data specific to in-game previews (ACF, ACB, AWB)?
The CueSheet list only shows the binary files built for in-game preview.
If multiple ACB/AWB files are loaded, the in-game preview window does not show binary files that do not support in-game preview.