CTR Pia  4.11.3
Game Communication Engine
clone/TeamMatchmake Sample Demo

Introduction

This demo uses PiaClone and joint session features to perform team matchmaking.

Scope of the Demo

This sample primarily demonstrates the following.

Process Overview and Controls in Each State

Network Connection State

You automatically transition to this state on start. Connecting to the Internet and logging in to the game server are handled automatically. When the process is finished, you automatically move to the team selection state. When the network connection fails, you automatically transition to the error display state.

Team Selection State

This state is where the local station selects the type of team it belongs to.

Input Operation
+Control Pad The local station selects the type of team it belongs to. Three types of teams are available for use in this demo.
A Button Sets the type of team the local station belongs to. After making this setting, you transition to the matchmaking state.
START Log out from the game server.
After this option is selected, the Pia module is finalized, the system logs out from the game server, and Internet communication ends. The system then automatically transitions to the network connection state.

Matchmaking State

In this state, the system waits for the random matchmaking process that forms the teams to start. The local station automatically searches for teams of the type it belongs to and is matched with stations that have selected the same type of team.

Input Operation
A Button Starts the random matchmaking process that forms the teams. After the random matchmaking process finishes, the demo transitions to the communication (team session) state.
B Button Transitions to the team selection state so that the team type can be selected again.
START Log out from the game server.
After this option is selected, the Pia module is finalized, the system logs out from the game server, and Internet communication ends. The system then automatically transitions to the network connection state.

Communication State (Team Session)

Communication occurs among the stations in the team session. From this state, you can use the joint session feature to perform random matchmaking with teams of another type. In this state, each of the stations communicates in the following way.

  • Information about the positions where rectangles are displayed on screen is sent to all members 15 times per second.

In this state. a character (rectangle) is assigned to each connected station and displayed to indicate that communication is taking place. An index of the team members is shown to the right of the character. Rectangles representing objects shared within the team and objects shared with all stations are also shown. The various rectangles are categorized as follows depending on the letters shown on the right.

  • Numbers: Rectangles representing the stations that match the number in the team member index.
  • A: The rectangles that stations in the team can operate and that send and receive data using AtomicSharingClone.
  • Q: The rectangles that stations in the team can operate and that send and receive data using SequentialSharingClone.
  • CA: The rectangles that all stations can operate and that send and receive data using AtomicSharingClone.
  • CQ: The rectangles that all stations can operate and that send and receive data using SequentialSharingClone.

For the A and CA rectangles, a question mark ("?") is shown on their right while the AtomicSharingClone lock is being obtained. Once the lock is obtained, an exclamation point ("!") appears where the question mark was. Also, the CA and CQ rectangles are only shown during game session communication states.

When operating as a client, the local station automatically transitions to the session changing state when the host starts the process of joining the joint session. If the local station is unintentionally disconnected from the network, such as when the signal is poor, it transitions to the error display state.

Input Operation
+Control Pad Moves the position of the rectangle displayed on the screen. The rectangles with red arrows or letters shown to their right are the ones that can currently be operated.
When there is no input from the +Control Pad, the rectangle moves to the right to indicate that communication is taking place.
X Button When operating as the host, the local station first transitions to the session-changing state to perform the matchmaking with another type of team, and then it transitions to the communication state (game session).
Nothing happens when the local device is acting as a client.
B Button Leaves the team session and transitions to the team selection state.
R Button Changes the rectangles that are subject to operation.
L Button Can only operate the session host. If the session is closed, begins the process of accepting participants. If the session is in the open invitation, begins the process of closing the session to participants. When other stations detect the process started by the host, they begin the same process. When all stations in the session begin the process, the process actually starts to run.
A Button Attempts to get a lock if the operable rectangle is of the A type.

Session-Changing State

In this state, the system waits for the process that changes the session state to finish. After the process finishes, the system transitions automatically to the appropriate state according to the processing result. This state is passed by in the following situations.

  • Transitions from the communication state (team session) to the communication state (game session), to make matches with other types of teams.
  • Transitions from the communication state (game session) to the communication state (team session), to disband the game session and return to the team session.
  • Transitions from the communication state (game session) to the team selection state, to leave the game session and the team session and return to team selection.

Communication State (Game Session)

Communication occurs among the stations in the game session. The game session for this demo is a session for P2P communication with a team of another type. The demo creates the team session using the joint session feature. The content transmitted by each station and the screens shown are essentially the same as in the communication state (team session).

The host can use the process for disbanding a joint session to disband a game session and restore each team to a team session communication state. The stations that are not the host automatically transition to the session-changing state when the host starts the process of disbanding the joint session. If the local station is unintentionally disconnected from the network, such as when the signal is poor, it transitions to the error display state.

Input Operation
+Control Pad Moves the position of the rectangle displayed on the screen.
When there is no input from the +Control Pad, the rectangle moves to the right to indicate that communication is taking place.
X Button When operating as the host, the local station first transitions to the session-changing state to disband the game session, and then transitions to the communication state (team session).
Nothing happens for the stations that are not the host.
B Button Leaves the sessions for the game and the team, and transitions to the team-selection state.
R Button Changes the rectangles that are subject to operation.
A Button Attempts to get a lock if the operable rectangle is of the A or CA type.

Error Display State

The demo transitions to the error display state when it cannot communicate because of problems with the connection to the access point or when session communication cannot be maintained. This state shows the error type (the reason for transitioning to the error display state) and the result and network error code. Error types are shown in the following list.

  • Initialization failed because you are in wireless-disabled mode.
  • Initialization failed for other reasons.
  • Matchmaking failed.
  • The session was lost.
  • The network connection was lost.
  • Error due to circumstances in the application.
  • A communication error has occurred for some other reason.
Input Operation
A Button Leaves the current state and transitions to the team selection state.
If the network needs to be reset (such as when logging in again), the system transitions to the network connection state after the Pia finalization process.