Step 5: View your simulation
The SimSpace Weaver app SDK provides different options to view the sample application. You can use the sample console client if you don't have any local support for Unreal Engine development. The instructions for the Unreal Engine client assume that you are using Windows.
The console client displays a list of entity events as
they occur. The client gets the entity event information from
the ViewApp
. If your console client displays
the list of events, then it confirms network connectivity with the
ViewApp
and activity in your simulation.
The PathfindingSample
simulation creates
stationary and moving entities on a 2-dimensional plane. The
moving entities move around the stationary entities. The
Unreal Engine client provides a visualization of the
entity events.
- Windows console client
-
Requirements
-
Microsoft Windows 10 or higher
-
Microsoft Visual Studio 2019
or later, with the Desktop development with C++ workload installed
To connect to the sample application with the sample console client
-
In a command prompt window, go to the folder for the console client (in the app SDK folder).
cd
sdk-folder
\packaging-tools\clients\PathfindingSampleClients\ConsoleClient -
Use CMake3 to create a Visual Studio solution in this folder.
cmake .
Note
Make sure to include the space and period at the end.
Important
Keep the command prompt window open for further steps.
-
In Visual Studio, open the
PathfindingSampleConsoleClient.sln
that you created in the previous step. -
Select the RelWithDebInfo build configuration.
-
Choose Build > Build Solution.
-
In your previous command prompt window, go to the build output folder in the folder for the console client.
cd RelWithDebInfo
-
Run the client with the IP address and port number of your
ViewApp
..\ConsoleClient.exe --url tcp://
ip-address
:port-number
Your command prompt window should display numbers for entity update, delete, and create events, similar to the following example output.
Note
The IP addresses and port numbers in the following example output are placeholders. Provide the IP address and port number of your
ViewApp
to the console client. Provide theActual
port number if you want to connect to aViewApp
that runs in the AWS Cloud. Provide the IP address and port number 127.0.0.1:7000 when you connect to aViewApp
that runs on your local system. For more information, see Local development.##PathfindingSample#ViewApp Message Reader## Added argument url:tcp://198.51.100.135:4321 Some subscription arguments are missing, restoring defaults. ***** Sample usage without a MoveStrategy: ConsoleClient --url tcp://198.51.100.135:4321 --subs-center-x 600 --subs-center-y 500 --subs-radius 50 Sample usage with CircleMoveStrategy: ConsoleClient --url tcp://198.51.100.135:4321 --subs-center-x 600 --subs-center-y 500 --subs-radius 50 --subs-move-strategy circle --circle-center-x 500 --circle-center-y 500 --circle-speed 0.001 ***** Starting NNG client. NNG version: 1.2.4 Creating socket ...done. Connecting to View App ... done. Initiating connection to tcp:// 198.51.100.135:4321 ... done. Receiving messages ... [2022-10-04 19:13:00.710] CreateEntity Count: 72 [2022-10-04 19:13:00.756] UpdateEntity Count: 42 [2022-10-04 19:13:00.794] DeleteEntity Count: 72 [2022-10-04 19:13:03.690] CreateEntity Count: 11 [2022-10-04 19:13:03.725] UpdateEntity Count: 2 [2022-10-04 19:13:03.757] UpdateEntity Count: 2 [2022-10-04 19:13:03.790] UpdateEntity Count: 2
Note
For troubleshooting guidance, see PathfindingSample console client fails to connect.
-
Press CTRL +C to quit the console client.
-
- Linux console client
Important
We provide these instructions for your convenience. They might not work in some Linux environments. These procedures are unsupported.
This procedure assumes that you are working entirely within a Linux environment. You can also view your simulation using clients built in Windows.
Requirements
-
CMake3
-
C compiler (already included in Amazon Linux 2)
-
Git
To connect to the sample application with the sample console client
-
At a Linux shell prompt, go to the folder for the console client (in the app SDK folder).
cd
sdk-folder
/packaging-tools/clients/PathfindingSampleClients/ConsoleClient -
Create a build folder.
mkdir build
-
Go to the build folder.
cd build
-
Use CMake3 to build the client.
cmake3 ../ && cmake3 --build .
Note
Make sure to include the space and period at the end.
-
Run the client with the IP address and port number of your
ViewApp
../ConsoleClient --url tcp://
ip-address
:port-number
Your command prompt window should display numbers for entity update, delete, and create events, similar to the following example output.
Note
The IP addresses and port numbers in the following example output are placeholders. Provide the IP address and port number of your
ViewApp
to the console client. Provide theActual
port number if you want to connect to aViewApp
that runs in the AWS Cloud. Provide the IP address and port number 127.0.0.1:7000 when you connect to aViewApp
that runs on your local system. For more information, see Local development.##PathfindingSample#ViewApp Message Reader## Added argument url:tcp://198.51.100.135:4321 Some subscription arguments are missing, restoring defaults. ***** Sample usage without a MoveStrategy: ConsoleClient --url tcp://198.51.100.135:4321 --subs-center-x 600 --subs-center-y 500 --subs-radius 50 Sample usage with CircleMoveStrategy: ConsoleClient --url tcp://198.51.100.135:4321 --subs-center-x 600 --subs-center-y 500 --subs-radius 50 --subs-move-strategy circle --circle-center-x 500 --circle-center-y 500 --circle-speed 0.001 ***** Starting NNG client. NNG version: 1.2.4 Creating socket ...done. Connecting to View App ... done. Initiating connection to tcp:// 198.51.100.135:4321 ... done. Receiving messages ... [2022-10-04 19:13:00.710] CreateEntity Count: 72 [2022-10-04 19:13:00.756] UpdateEntity Count: 42 [2022-10-04 19:13:00.794] DeleteEntity Count: 72 [2022-10-04 19:13:03.690] CreateEntity Count: 11 [2022-10-04 19:13:03.725] UpdateEntity Count: 2 [2022-10-04 19:13:03.757] UpdateEntity Count: 2 [2022-10-04 19:13:03.790] UpdateEntity Count: 2
Note
For troubleshooting guidance, see PathfindingSample console client fails to connect.
-
Press CTRL +C to quit the console client.
-
- Unreal Engine on Windows
-
Requirements
-
Unreal Engine 5 development environment
-
Microsoft .NET Framework 4.8 Developer Pack
-
Windows console client (see the Windows console client tab on this page)
Important
Other versions of Unreal Engine and .NET are not supported and might cause problems.
To connect to the sample application with the sample Unreal client
-
The Unreal Engine client uses the NNG library from the console client. You must build the console client for Windows if you haven't already built it. For more information, see the Windows console client tab on this page.
-
In a file manager window, go to
.sdk-folder
\packaging-tools\clients\PathfindingSampleClients\UnrealClient -
Open
UnrealClient.uproject
. -
If the editor asks you if you want to rebuild the
UnrealClient
modules, choose yes. -
In a text editor, open
.sdk-folder
\packaging-tools\clients\PathfindingSampleClients\UnrealClient\view_app_url.txt -
Update the URL with the IP address and port number for your view app:
tcp://
(it should look likeip-address
:port-number
tcp://198.51.100.135:1234
). -
In Unreal editor, choose play.
Your Unreal editor should display a visualization of the simulation, similar to the following screenshot.
Note
Depending on the power of your local development system, it could take a few minutes for the Unreal editor to display the simulation. During this time, the system might appear to freeze.
Use the W, A, S, D keys to move in the Unreal client. Hold the mouse button and drag the mouse to turn.
You can press the [ (left square bracket) key to decrease the size of the subscription area. You can press the ] (right square bracket) key to increase the size of the subscription area. The size of the subscription area determines the number of entities that appear in the client.
You can press the C key to create an entity in the simulation. The client sends a
CreateEntity
command to the view app. The view app will then create the entity and transfer it to the spatial domain.You can examine the code for
ViewAppDriver::HandleEntityCreationRequests
in
to see how the app implements this process.project-folder
\src\PathfindingSample\ViewApp\Driver\ViewAppDriver.cpp -