CTR Pia  4.11.3
Game Communication Engine
reckoning/Simple Sample Demo

Introduction

This sample demonstrates the use of PiaReckoning.

Scope of the Demo

This sample demonstrates the following.

Process Overview and Controls

Mode Selection Screen

Select the communication mode from this screen. Select to perform matchmaking, and then go to the Main screen.

Input

Operation

A Button Run local communication (UDS library) as a host. After you successfully create a session, you transition to the Main screen.
B Button

Run local communication (UDS) as a client. Search the UDS network and join what you find, and then transition to the Main screen. If you press START during a search of the UDS network, you cancel the search and return to the Mode Selection screen.

X Button Run in the mode that uses Internet communication. Perform random matchmaking. If there is a session that can be joined, join it as a client. If there are no sessions, create one as the host. Then you transition to the Main screen.
START Exits the program.

Main Screen

Reckoning Image

Main Screen Operations

  • State:, the first item from the bottom of the screen, indicates the state of CloneProtocol. When two or more units become State:Active, communication starts and data is exchanged.

  • Clock:, the second item from the bottom of the screen, indicates the time. An 'R' appears after the time while the time is being resynchronized.

  • Send:Recv:, the center item at the bottom of the screen, displays the number of packets being sent and received every 0.5 second.


Input Operation
A Button Starts and stops communication using CloneProtocol.
L Stick Moves the position of the rectangle for the local station.
Up/down on the +Control Pad Selects the items in the lower-right of the screen (Reckoning, Latency, ChaseType, ChaseRatio, VelScale, StopThreshold, and Threshold).
Left/right on the +Control Pad Use Up or Down on the +Control Pad to change the selected value.
START Withdraws from the session and returns to the Mode Selection screen.

Switching the Numerical Values of Items

The numerical values can be changed for items listed in the lower-right of the screen.

By changing Reckoning/Unreliable, you can alter the movement of the rectangle and compare the communication volume (the Send and Recv values). By setting ChaseType to None, you can also truncate the correction.

  • Reckoning/Unreliable: Select whether to use Reckoning or Unreliable to send the coordinates for the position of the rectangle.
  • Latency: Use to adjust the RTT. The number is in units of milliseconds (ms), and the actual value is around 50 ms larger than the set number.
  • ChaseType: Enabled when Reckoning has been selected. Select either None or Chase. If you select Chase, the sent data is interpolated and made smoother.
  • ChaseRatio: The chase ratio when ChaseType is set to Chase.
  • VelScale: The scale value for the speed at which the rectangle moves. The larger the value, the faster the speed and the greater the braking.
  • StopThreshold: The threshold value for determining the Stop flag when Reckoning is selected. The Stop flag is sent as true when the distance of movement is shorter than this threshold.
  • Threshold: The threshold value for determining the deviance from the predicted value when Reckoning is selected. If the deviance is greater than this threshold, a sample value is sent.

When a session cannot continue because of an error or another reason, you are automatically returned to the Mode Selection screen.


Detailed Description

Performs communication using CloneProtocol.

The screen shows the rectangles controlled by each station and the values received for each rectangle* as described below.

  • Each colored line on the top of the screen corresponds to one ReceiveClone and displays the value of the registered ReckoningCloneElement.
    • R indicates a ReceiveClone.
    • The numbers after the "R" represent the ID of the station being connected to.
    • The text displayed next represents the send and receive mode for the SendClone and ReceiveClone.
  • The next two numbers shown are coordinates and represent the values received by each ReceiveClone.
    • If using Reckoning mode, the ReckoningCloneElement values are shown. If using Unreliable mode, the UnreliableCloneElement values are shown.
    • From left to right, the values correspond to the x- and y-coordinate of the rectangle for each connected station*, retrieved by calling GetValue. These values are updated and displayed when GetValue is called.
  • The value displayed to the right of the coordinates shows the RTT between the local station and each of the other stations.

(*) The square controlled by the local station is displayed using the local x- and y-coordinates.