Export (0) Print
Expand All

Getting Started With Networked Games

Bb975642.note(en-US,XNAGameStudio.30).gifImportant

Games for Windows - LIVE is not available to finished games. This functionality is not included in the redistributable version of the XNA Framework, and a game that attempts to use these components without XNA Game Studio installed will result in a GamerServicesNotAvailableException.

Dependency on Gamer Services

XNA Framework games must explicitly initialize the gamer services subsystem before networking API calls can be completed. The gamer services system provides a system for raising notifications such as sign-in status changes, game invitations, or other messages from the Guide. The Guide provides an interface that allows players to sign in to Xbox LIVE or Games for Windows LIVE, view messages or game invitations, or use Xbox LIVE user interface elements such as the keyboard during a game. Initialization of the gamer services system that provides access to the Guide is required to use networking because it allows access to the user interface necessary to sign in and receive other messages from the LIVE system.

Most games will use the GamerServicesComponent, a game component which wraps the GamerServicesDispatcher object and takes care of the process of initializing and retrieving messages from the gamer services system. This component will automatically pass through the graphics device and window handle, and call GamerServicesDispatcher.Update at regular intervals. To take advantage of this component, most games will simply need to add one line to the Game constructor:

Components.Add(new GamerServicesComponent(this));

For more information on the gamer services system, see Gamer Services Overview .

XNA Creators Club and Xbox LIVE Membership Requirements

There are two types of online multiplayer games available when you create a networked game with XNA Game Studio: system link game sessions and LIVE sessions. These two forms of online multiplayer gaming describe whether the multiplayer gaming session is on the local area network (system link games), or if the gaming session is advertised and found through the LIVE service. With system link games, you can search the local area network to find the gaming sessions. With LIVE sessions, you can use the LIVE service to find available game sessions. Use the searchProperties argument of NetworkSession.Find to specify the parameters used to search for an available game session – a game session that uses either system or the LIVE service.

Developing and testing a networked game requires at least two machines, but you only need one Xbox 360 console and one Creators Club membership to test network code for the Xbox 360. This is because XNA Framework supports cross-platform system links so developers can run one instance of a game on an Xbox 360, and a second on a Windows-based computer. This functionality helps creators debug their titles without having to purchase a second console. It is also possible for more than one Windows-based development computer to connect several machines in a system link session without any memberships required.

This table shows what memberships are required for a player on a Windows-based computer and Xbox 360 console in a network session, depending on the session type that has been created.

Xbox 360 ConsoleWindows-Based Development ComputerZune
Run an XNA Framework GameLIVE Silver membership + Premium XNA Creators Club membershipNo memberships requiredNo memberships required
Use System Link for Local Area Network gameplayLIVE Silver membership + Premium XNA Creators Club membershipNo memberships requiredNo memberships required
Sign-on to Xbox Live and Games for Windows - LIVE ServersLIVE Silver membership + Premium XNA Creators Club membershipLIVE Silver membership + Premium XNA Creators Club membershipNot available on Zune
Use LIVE to connect to other machines over the Internet while the game is in developmentLIVE Gold membership + Premium XNA Creators Club membershipLIVE Silver membership + Premium XNA Creators Club membershipNot available on Zune
Use LIVE to connect to other machines over the Internet once the game is an XNA Community Game and has been downloaded from Xbox LIVE MarketplaceLIVE Gold membership + Game purchaseLIVE Silver membership + Game purchaseNot available on Zune
Bb975642.caution(en-US,XNAGameStudio.30).gifCaution
The XNA framework components that interact with Games for Windows LIVE require an XNA Creators Club membership. If for any reason a LIVE profile without a Creators Club membership is set to auto sign-in on a Windows-based computer, the game will not be able to connect to the LIVE service. Furthermore, the XNA framework gamer services components, including the Guide, will not be available. To disable auto sign-in for a LIVE profile on a Windows-based computer, first make sure you are disconnected from the network. Then launch an XNA Framework game, and open the Guide.

Please note the following.

  • If you are running an XNA Framework Game on the Microsoft Windows operating system on a dual-core AMD processor, and the game contacts the Xbox LIVE servers or otherwise uses the Gamer Services extensions, you may experience unpredictable behavior such as a hanging of the game process. To work around this issue, you should install the AMD Dual-Core Optimizer from AMD on the computer on which you are running the game. Currently, the optimizer is available at the following location.

Hardware Requirements

It is not possible to run multiple simultaneous instances of a networked game on a single development computer.

When launching to multiple machines for network testing, we recommend that you load multiple copies of your solution into separate Visual Studio instances, one per machine.

For a system link game, any one of the following hardware configurations may be used to test a networked game:

  • One development computer and one Xbox 360 console (running one instance of the game on a Windows-based computer and one on Xbox 360). The creator will require one LIVE Silver and one Creators Club membership to run code on the Xbox 360.
  • One development computer and one client computer (running one instance of the game on each Windows-based computer). Creators cannot run two networked XNA Framework games at the same time on the same computer, so creators will need a second machine to run a second game instance for testing purposes. No LIVE memberships or Creators Club memberships are required for this scenario.
  • One development computer and two Xbox 360 consoles (running one instance of the game on each Xbox 360). Here a creator deploys and debugs the game on two Xbox 360s. The creator will need at least two LIVE Silver memberships and two Creators Club memberships (one pair for each Xbox 360) for this scenario.
  • One development computer and two Zune devices (running one instance of the game on each Zune). Here a creator deploys and debugs the game on two Zune devices. The creator will need no additional memberships for this scenario. Note that Zune only supports system link networking and does not support cross-platform networking or internet connectivity.

If a game creator wants to use LIVE to connect to gaming machines over the Internet as opposed to using system link to connect gaming machines over a local subnet, you may use any one of the following hardware configurations:

  • One development computer and one Xbox 360 console (running one instance of the game on the development computer and one on the Xbox 360). The creator will need two LIVE Gold memberships and two Creators Club memberships (one pair for each machine) for this scenario.
  • One development computer and one client computer (running one instance of the game on each computer). The creator will requre two LIVE Gold memberships and two Creators Club memberships (one pair for each machine).
  • One development computer and two Xbox 360 consoles (running one instance of the game on each Xbox 360 console). The creator will require two LIVE Gold memberships and two Creators Club memberships (one set for each machine).

Community Additions

ADD
Show:
© 2014 Microsoft