CTR Pia  4.11.3
Game Communication Engine
API Reference Home

Nintendo Confidential

Warning

The content of this document is highly confidential and should be handled accordingly.
The contents of this document cannot be duplicated, copied, reprinted, transferred, distributed, or loaned, in whole or in part, without the prior approval of Nintendo.
This document contains confidential and proprietary information of Nintendo and is also protected under the copyright laws of the United States and foreign countries. No part of this document may be released, distributed, transmitted, or reproduced in any form or by any electronic or mechanical means, including information storage and retrieval systems, without permission in writing from Nintendo.


Library Usage And Implementation Notes

For more information about using the Pia library, see the Programming Manual.


Summary of Each Module

The Pia library is made up of several modules that implement P2P communication features. Each module is designed to minimize dependencies on code in other modules.

An overview of each module is provided below.


PiaCommon


The PiaCommon module provides features, such as memory management, that are shared by all modules. This library provides features intended for reuse by other modules; only some of its features are used directly from applications.
It includes the following features.
  • Memory management
  • Scheduler for (periodic) dispatching in Pia
  • Error handling
  • Logging output for debugging
For the API reference, see nn::pia::common.

PiaLocal


PiaLocal is a network management module that provides local P2P communication features. This module extends the UDS library in the SDK to provide more advanced functionality.
It includes the following features.
  • LocalNetworkFactory for local communication using a PiaSession instance.
  • Host migration for local communication that enables the network to be maintained when the connection to the local network host is lost.
  • A feature for searching for nearby networks during communication (planned).
PiaLocal uses the SDK's UDS library. For this reason, you can achieve the same performance just by using PiaLocal even if you are not using the UDS library directly. However, this is not compatible with UDS library receive-only child devices (spectators).
For the API reference, see nn::pia::local.

PiaInet


PiaInet is a network management module that provides Internet P2P communication features. Use it in combination with NEX server services. It includes the following features.
  • NexNetworkFactory for Internet communication using a PiaSession instance.
  • NAT traversal linked with NEX server services.
  • Matchmaking host migration linked with NEX matchmaking.
For the API reference, see nn::pia::inet.

PiaTransport


The PiaTransport transport management module provides a variety of send and receive features. Use it in combination with PiaSession. It includes the following features.
  • UnreliableProtocol that does not guarantee delivery of data.
  • ReliableProtocol guarantees delivery of data.
  • ReliableBroadcastProtocol that transfers data efficiently from a host to multiple clients.
  • Packet handling, keep-alive, and RTT measuring features.
  • Signing and encryption features.
  • TransportAnalyzer, which is used for analyzing game communication.
For the API reference, see nn::pia::transport.

PiaSession


PiaSession is a session management module that manages gatherings of game participants (sessions). Sessions in PiaSession are equivalent to the groups in the matchmaking sessions on the matchmaking server and the P2P mesh networks between stations using P2P communication. Creating and joining sessions is done by automatically performing matchmaking and creating and joining P2P mesh networks. (Matchmaking sessions and P2P mesh networks can also be managed separately.)
It includes the following features.
  • Session features that can manage Internet communication matchmaking and P2P mesh networks at the same time.
  • Features that can manage local networks and P2P mesh networks at the same time.
  • Host migration that enables the session to be maintained when the connection to the session host is lost.
  • A relay feature allowing a station to join a session even if NAT traversal fails
  • A random matchmaking feature equivalent to the auto-matchmaking feature of NEX matchmaking (supported only for Internet communication).
  • A joint session feature that makes team matchmaking possible by performing matchmaking between sessions (supported only for Internet communication).
The NEX matchmaking API is called when using Internet communication. The UDS library is called when using local communication.
For the API reference, see nn::pia::session.

PiaSync


The PiaSync module provides features for synchronizing input (game communication that shares key input data between stations).
It includes the following features.
  • SyncProtocol for using PiaSession to synchronize the input state. (You can add arbitrary data in addition to key input.)
  • A feature for removing redundant packets to improve packet-loss tolerance.
  • A feature for dynamically changing the delay buffer.
For the API reference, see nn::pia::sync.

PiaClone


The PiaClone module provides features for synchronizing communication states (game communication that shares object states between stations).
It includes the following features.
  • CloneProtocol for managing the overall state synchronization.
  • UnreliableCloneElement and ReliableCloneElement for sharing the state.
  • EventCloneElement for sending event notifications.
  • SendClone and ReceiveClone for sending and receiving states.
  • AtomicSharingClone for obtaining exclusive rights (locking) to modify states between stations.
  • SequentialSharingClone for sending and receiving without restrictions on changing states.
  • A feature for synchronizing clocks between stations.
For the API reference, see nn::pia::clone.

PiaReckoning


The PiaReckoning module provides features for interpolating states (such as position data) on PiaClone using dead reckoning.
It includes the following features.
  • ReckoningCloneElement for interpolating states using dead reckoning.
  • Simple3dReckoningStrategy for predicting 3D position data.
For the API reference, see nn::pia::reckoning.

PiaChat


The PiaChat module provides voice chat functionality.
It includes the following features.
  • A conferencing feature that lets all session participants talk at the same time.
  • A voice activity detection (VAD) feature that detects periods of silence to reduce the amount of communication.
  • An echo cancellation feature.
For the API reference, see nn::pia::chat.


CTR-06-0241-001-AN