Reference

Home Reference Index

Telemetry Server


Introduction

The application can be started with running a telemetry server. Clients can connect to the server to request telemetry data or remotely control the application. The server protocol is a binary message based protocol using TCP. Each message will be answered by the server with a specific message in the same order as messages were sent by the client.

Default TCP port of NoLimits 2 telemetry server is: 15151
Telemetry server needs to be enabled by starting NoLimits2 with command line parameter '--telemetry'
Port can be changed with command line parameter '--telemetryport=<port>'

E.g. for starting the server on port 15152, start with commandline: '"c:\Program files\NoLimits 2\64bit\NoLimits2app.exe" --telemetry --telemetryport=15152'

See the 'telemetry' folder inside the application install folder for an example client code.


Attraction Mode

There are special telemetry messages available that were designed for running the application as an attraction. Any park file can be automatically loaded, started, and restarted.

Please note that an Professional or Attraction License is required when this part of the telemetry interface is used. Contact nolimits@nolimitscoaster.com for details and pricing.

The start of a park can also be synchronized with multiple computers for allowing to implement multi-seat VR attractions where the same coaster is run simultaneously on multiple computers, one providing the VR images for each seat. In order to implement such a system, we recommend the following procedure:
  1. After starting all servers and the client, set all servers to the Attraction Mode using the Set Attraction Mode Message. This will make sure that there are no random factors making the individual computers run out of sync.
  2. Load the same park on each server using the Load Park Message, make sure to load the park in the paused state. The paused state is an option of the load park message. Without the paused state, the park will instantly start to run after loading on each computer, which is not what we want, because the loading times may slightly differ on each computer.
  3. Use the Get Telemetry Message to check if the park was finished loading and is ready to run. If the park has finished loading, the bit0 of the state flags of the telemetry message will be set, which indicates it will be in play mode and ready to run.
  4. When all servers are in play mode, which means they all have finished loading and are ready to run, send the Set Pause Message with 0, in order to disable the pause state. Send this message to all servers. Make sure to not have any delays between each message sent.
  5. All servers should now run almost perfectly synchronized. Make sure to use similar hardware for each computer, because frame rates may have a small influence on the simulation. Make sure that the computers can handle the park at reasonably frame rates.
  6. After a specific amount of time (when the ride is over), send the Reset Park Message or Close Park Message. The reset park message has a parameter to make the park set to paused state, that works similiar to the load park message.
  7. After resetting the park in paused state for each server, repeat with step 3.
Server: NoLimits 2 exe running on a separated computer with the telemetry interface activated
Client: Custom software that sends and receives telemetry messages in order to control or communicate with all servers



Message Format

Each message has the same basic binary format. All multi-byte values are in network-byte-order (big-endian)!!
The minimum message size is 10 bytes.
Clients are allowed to send Client Request messages (see Message Type Table). The server will respond with corresponding Server Reply messages. The Request ID can be freely assigned by the client and has no special meaning. The server's reply message will use the same Request ID in the corresponding answer.

Basic Message Format Structure:

Offset (Bytes)TypeSize (Bytes)Meaning
0uchar81Message Start (magic number, value = 'N')
1ushort162Message Type ID (see Message Type Table)
3uint324Request ID (can be freely assigned by client)
7ushort162DataSize (depends on message type)
9varyingDataSizeData (meaning depends on message type)
9+DataSizeuchar81Message End (magic number, value = 'L')



Message Type Table


MessageSent by
IdleClient
OKServer
ErrorServer
Get VersionClient
VersionServer
Get TelemetryClient
TelemetryServer
Get Coaster CountClient
Int ValueServer
Get Coaster NameClient
StringServer
Get Current Coaster And Nearest StationClient
Int Value PairServer
Set Emergency StopClient
Get Station StateClient
Station StateServer
Set Manual ModeClient
DispatchClient
Set GatesClient
Set HarnessClient
Set PlatformClient
Set Flyer CarClient
Load ParkClient
Close ParkClient
Quit ServerClient
Set PauseClient
Reset ParkClient
Select Seat MessageClient
Set Attraction ModeClient
Recenter VRClient
Set Custom ViewClient



Idle Message

Message Type ID: 0
Category: Client Request
Description: Can be send by the client to keep connection alive. No other purpose. Returned message by server is OK Message
DataSize: 0
Data: none


OK Message

Message Type ID: 1
Category: Server Reply
Description: Typical answer from server for messages that were successfully processed and do not require a specific returned answer
DataSize: 0
Data: none


Error Message

Message Type ID: 2
Category: Server Reply
Description: Will be sent by the server in case of an error. The data component contains an UTF-8 encoded error message
DataSize: Number of bytes of UTF8 encoded string
Data:
Offset (Bytes)TypeSize (Bytes)Meaning
0UTF8 stringDataSizeError message


Get Version Message

Message Type ID: 3
Category: Client Request
Description: Can be used by the client to request the application version. The server will reply with Version Message
DataSize: 0
Data: none


Version Message

Message Type ID: 4
Category: Server Reply
Description: Will be send by the server as an answer to Get Version Message
DataSize: 4
Data:
Offset (Bytes)TypeSize (Bytes)Meaning
04 bytes4Major to minor version numbers e.g. 2, 2, 0, 0 for 'Version 2.2.0.0'



Get Telemetry

Message Type ID: 5
Category: Client Request
Description: Can be used by the client to request common telemetry data. The server will reply with Telemetry Message
DataSize: 0
Data: none



Telemetry Message

Message Type ID: 6
Category: Server Reply
Description: Will be send by the server as an anwser to Get Telemetry
DataSize: 76
Data:
Offset (Bytes)TypeSize (Bytes)Meaning
0int324State flags
  bit0 -> in play mode
  bit1 -> braking
  bit2 -> paused state
  bit3 -> VR headset on
  bit4-31 -> reserved
4int324Current rendered frame number -> can be used to detect if telemetry data is new
8int324View mode (0=offride view, 1=ride view, 2=external ride view, other values are reserved = some other kind of view)
12int324Current coaster
16int324Coaster style id
20int324Current train
24int324Current car
28int324Current seat
32float324Speed
36float324Position x
40float324Position y
44float324Position z
48float324Rotation quaternion x
52float324Rotation quaternion y
56float324Rotation quaternion z
60float324Rotation quaternion w
64float324G-Force x
68float324G-Force y
72float324G-Force z



Get Coaster Count Message

Message Type ID: 7
Category: Client Request
Description: Can be used by the client to request the number of coasters. The server will reply with Int Value Message
DataSize: 0
Data: none



Int Value Message

Message Type ID: 8
Category: Server Reply
Description: Will be send by the server as an answer to messages requesting various numbers
DataSize: 4
Data:
Offset (Bytes)TypeSize (Bytes)Meaning
0int324Varying, depends on requested information



Get Coaster Name Message

Message Type ID: 9
Category: Client Request
Description: Can be used by the client to request the name of a specific coaster. The server will reply with String Message
DataSize: 4
Data:
Offset (Bytes)TypeSize (Bytes)Meaning
0int324Coaster index 0..N-1, client can use Get Coaster Count Message to query the number of available coasters N



String Message

Message Type ID: 10
Category: Server Reply
Description: Will be send by the server as an answer to messages requesting various strings
DataSize: length of UTF8 encoded string
Data:
Offset (Bytes)TypeSize (Bytes)Meaning
0UTF8 stringDataSizeVarying, depends on requested information



Get Current Coaster And Nearest Station Message

Message Type ID: 11
Category: Client Request
Description: Can be used by the client to request the current coaster and nearest station indices. The server will reply with Int Value Pair Message. First value will be current coaster index, second value will be nearest station index.
DataSize: 0
Data: none



Int Value Pair Message

Message Type ID: 12
Category: Server Reply
Description: Will be send by the server as an answer to messages requesting various value pairs
DataSize: 8
Data:
Offset (Bytes)TypeSize (Bytes)Meaning
0int324First value, meaning depends on requested information
4int324Second value, meaning depends on requested information



Set Emergency Stop Message

Message Type ID: 13
Category: Client Request
Description: Can be used by the client to set the emergency stop. The server will reply with OK Message
DataSize: 5
Data:
Offset (Bytes)TypeSize (Bytes)Meaning
0int324Coaster index
4uchar811 = on, 0 = off



Get Station State Message

Message Type ID: 14
Category: Client Request
Description: Can be used by the client to request the state of a specific station. The server will reply with Station State Message
DataSize: 8
Data:
Offset (Bytes)TypeSize (Bytes)Meaning
0int324Coaster index
4int324Station index (from Get Current Coaster And Nearest Station Message))



Station State Message

Message Type ID: 15
Category: Server Reply
Description: Will be send by server as an answer to a Get Station State Message
DataSize: 4
Data:
Offset (Bytes)TypeSize (Bytes)Meaning
0int324Station flags
  bit0 -> E-Stop On/Off
  bit1 -> Manual Dispatch On/Off
  bit2 -> Can Dispatch
  bit3 -> Can Close Gates
  bit4 -> Can Open Gates
  bit5 -> Can Close Harness
  bit6 -> Can Open Harness
  bit7 -> Can Raise Platform
  bit8 -> Can Lower Platform
  bit9 -> Can Lock Flyer Car
  bit10 -> Can Unlock Flyer Car
  bit11 -> There is a train inside the station
  bit12 -> The train inside the station is the current train of the ride view
  bit13-31 -> reserved



Set Manual Mode Message

Message Type ID: 16
Category: Client Request
Description: Can be used by the client to switch between manual and automatic station mode
DataSize: 9
Data:
Offset (Bytes)TypeSize (Bytes)Meaning
0int324Coaster index
4int324Station index
8uchar811 = on, 0 = off



Dispatch Message

Message Type ID: 17
Category: Client Request
Description: Can be used by the client to dispatch a train in manual mode
DataSize: 8
Data:
Offset (Bytes)TypeSize (Bytes)Meaning
0int324Coaster index
4int324Station index



Set Gates Message

Message Type ID: 18
Category: Client Request
Description: Can be used by the client to change gates in manual mode
DataSize: 9
Data:
Offset (Bytes)TypeSize (Bytes)Meaning
0int324Coaster index
4int324Station index
8uchar811 = open, 0 = closed



Set Harness Message

Message Type ID: 19
Category: Client Request
Description: Can be used by the client to change harness in manual mode
DataSize: 9
Data:
Offset (Bytes)TypeSize (Bytes)Meaning
0int324Coaster index
4int324Station index
8uchar811 = open, 0 = closed



Set Platform Message

Message Type ID: 20
Category: Client Request
Description: Can be used by the client to lower/raise platform in manual modet
DataSize: 9
Data:
Offset (Bytes)TypeSize (Bytes)Meaning
0int324Coaster index
4int324Station index
8uchar811 = lowered, 0 = raised



Set Flyer Car Message

Message Type ID: 21
Category: Client Request
Description: Can be used by the client to lock/unlock flyer car in manual modet
DataSize: 9
Data:
Offset (Bytes)TypeSize (Bytes)Meaning
0int324Coaster index
4int324Station index
8uchar811 = on, 0 = off



Load Park Message

Message Type ID: 24
Category: Client Request
Description: Can be used by the client to load and start a park (Only supported when used with a Professional or Attraction License. Contact nolimits@nolimitscoaster.com for details and pricing.)
The file path needs to be encoded using a specific format using '/' for the path separator.
Three type of path formats can be used:
A): Path can be internal path taken from Park Library, e.g.: 'intern:parks/Hybris/Hybris.nl2park'
B): Path can be relative to NoLimits 2 application (server) base folder, e.g.: 'parks/Hybris/Hybris.nl2park'
C): Path can be absolute. Windows absolute paths need to be specified like this: '/<driveletter>:/path' e.g.: '/c:/Program files/NoLimits 2/parks/Hybris/Hybris.nl2park'
DataSize: 1 + length of UTF8 encoded string
Data:
Offset (Bytes)TypeSize (Bytes)Meaning
0uchar810 = default start mode, 1 = start in paused state
1UTF8 stringDataSize-1Path to park file or package (see above for how the path needs to be encoded)



Close Park Message

Message Type ID: 25
Category: Client Request
Description: Can be used by the client to close the currently loaded or running park. (Only supported when used with a Professional or Attraction License. Contact nolimits@nolimitscoaster.com for details and pricing.)
DataSize: 0



Quit Server Message

Message Type ID: 26
Category: Client Request
Description: Can be used by the client to request the server to quit. The connection to the server will be lost after sending this message.
DataSize: 0



Set Pause Message

Message Type ID: 27
Category: Client Request
Description: Can be used by the client to change the pause state in play mode.
DataSize: 1
Data:
Offset (Bytes)TypeSize (Bytes)Meaning
0uchar810 = disable pause, 1 = enable pause



Reset Park Message

Message Type ID: 28
Category: Client Request
Description: Can be used by the client to stop and restart a park (Only supported when used with a Professional or Attraction License. Contact nolimits@nolimitscoaster.com for details and pricing.)
DataSize: 1
Data:
Offset (Bytes)TypeSize (Bytes)Meaning
0uchar810 = default start mode, 1 = start in paused state



Select Seat Message

Message Type ID: 29
Category: Client Request
Description: Can be used by the client to select a specific seat
DataSize: 16
Data:
Offset (Bytes)TypeSize (Bytes)Meaning
0int324Coaster index
4int324Train index
8int324Car index
12int324Seat index



Set Attraction Mode Message

Message Type ID: 30
Category: Client Request
Description: Can be used by the client to disable some things that may disturb working as an attraction (random station wait times, displayed messages). (Only supported when used with a Professional or Attraction License. Contact nolimits@nolimitscoaster.com for details and pricing.)
DataSize: 1
Data:
Offset (Bytes)TypeSize (Bytes)Meaning
0uchar810 = disable attraction mode (default), 1 = enable attraction mode



Recenter VR Message

Message Type ID: 31
Category: Client Request
Description: Can be used by the client to request recentering of VR head mounted display.
DataSize: 0
Data: None



Set Custom View

Message Type ID: 32
Category: Client Request
Description: Can be used by the client to set a custom fly view camera
The 'Select Seat Message' can be used to change back to a ride view.
DataSize: 21
Data:
Offset (Bytes)TypeSize (Bytes)Meaning
0float324Position X coordinate (meters) of camera
4float324Position Y coordinate (meters) of camera
8float324Position Z coordinate (meters) of camera
12float324Azimuth angle (degrees) of viewing direction, 0 means north (negative z-axis)
16float324Elevation angle (degrees) of viewing direction, 0 means horizontal
20uchar810 = fly view, 1 = walk view