XNA Creators Club Online
Page 1 of 1 (10 items)
Sort Posts: Previous Next

Single player game and networking

Last post 10/21/2009 10:47 PM by Radly. 9 replies.
  • 10/17/2009 2:44 PM
    • (0)
    • premium membership
    • Posts 7

    Single player game and networking

    I'm working on a single player game that needs to get data from a data server on the local network.  So far the only networking samples I can find relate to networking multiplayer games, the Network Architecture ClientServer example being the best case in point.  I tried adapting it, but the NetworkSession.Create function will not allow a session with only one player.  The basic idea is for the game running on an Xbox connected to a local area network to have a simple exchange of data packets with a PC on the same network.  The PC is controlling a device (Novint Falcon, in case you're curious) with which the game player is interacting.  Can someone point me in the right direction?
  • 10/17/2009 4:31 PM In reply to

    Re: Single player game and networking

    You cannot communicate between an Xbox and any non-Xbox PC, except when that PC is running a development version of Windows Live! (as you get with XNA Game Studio installation). That's just the way it is.

    Jon Watte, Direct3D MVP
    Tweets, occasionally
    kW X-port 3ds Max .X exporter
    kW Animation source code
  • 10/17/2009 6:29 PM In reply to
    • (0)
    • premium membership
    • Posts 7

    Re: Single player game and networking

    Well, if "that's just the way it is" then that kind of reduces my option space, which is always a liberating experience.  Thanks, I guess. :)
  • 10/17/2009 11:45 PM In reply to
    • (0)
    • premium membership
    • Posts 7

    Re: Single player game and networking

    So out of curiosity, I'd like to understand WHY That's Just The Way It Is.  For instance, if i try to have my XBox connect to a socket that has been created on a local PC, what gets in the way?  An answer something beyond TJTWII would be much appreciated.  For instance, is there some kind of built-in firewall?  Are all the TCP packets encrypted at that level?  Is the Socket API somehow munged?  I'm kind of determined by nature and knowing why I'm on a dead end road is usually very helpful.
  • 10/18/2009 12:07 AM In reply to

    Re: Single player game and networking

    I haven't been programming with XNA for very long (this is my first post), so I can't give you the technical answer you might be looking for. However, I can tell you the common sense answer. This is not an open platform you're working with; this is the Xbox 360, Microsoft's platform. They gave you XNA so you that you have to play by their rules. XNA has very limited networking abilities (compared to the PC). Basically all you get is peer to peer networking between two Xboxs that both have Gold accounts. No matter how you try, you just can't go beyond that using XNA and Indie games. I don't think even licensed developers could do what you are asking with the Xbox. If you really want to be ambitious with your programs, my best recommendation is to stick with the PC, which has fewer limitations.
  • 10/18/2009 3:04 PM In reply to

    Re: Single player game and networking

    Radly:
    So out of curiosity, I'd like to understand WHY That's Just The Way It Is.  For instance, if i try to have my XBox connect to a socket that has been created on a local PC, what gets in the way?  An answer something beyond TJTWII would be much appreciated.  For instance, is there some kind of built-in firewall?  Are all the TCP packets encrypted at that level?  Is the Socket API somehow munged?  I'm kind of determined by nature and knowing why I'm on a dead end road is usually very helpful.
    The simple answer is that there is no System.Net available on the 360's .NET Compact Framework.  So you don't get access to sockets or anything else, for that matter.  TJTWII
  • 10/19/2009 2:32 PM In reply to
    • (0)
    • premium membership
    • Posts 7

    Re: Single player game and networking

    Ah--no Systems.Net.  That explains it.  Thanks.
  • 10/19/2009 4:51 PM In reply to

    Re: Single player game and networking

    And, of course, the reason is not technical. The Xbox is a "managed platform," and all content you can view on the Xbox goes through some kind of review. If you allowed Xbox-to-web connectivity, then anyone could add all kinds of crap after-the-fact, which could add pictures of naked women (the horror!) to kid's games like Kissy Poo, or add remote 'sploitz to any poor Xbox untrusting enough to visit a given URL. It would be like a regular PC. Which, let's face it, it's pretty nice that it isn't!

    Jon Watte, Direct3D MVP
    Tweets, occasionally
    kW X-port 3ds Max .X exporter
    kW Animation source code
  • 10/19/2009 10:36 PM In reply to
    • (0)
    • premium membership
    • Posts 7

    Re: Single player game and networking

    I get that--I've got two cute granddaughters and I'm glad MS is doing all it can to help me help my kids raise 'em right.  And some day before I die, I'll get a "normal" project, but this (my first Xbox app) isn't it.  I've taken the ClientServer (tanks shoot-em-up game) and split it into two different projects--a server that handles my Falcon on the PC and a client that runs on the Xbox.  I "think" I've got the session set-up coded right, but when I hit the following bit of code:
    using (AvailableNetworkSessionCollection availableSessions =
             NetworkSession.Find(NetworkSessionType.SystemLink,1, null))
    {
        if (availableSessions.Count == 0)
        {
            return;
        }
    ...
    
    
    the count is 0 and the return is hit, so that's telling me the client isn't finding the server session.

    So either I have a coding error somewhere (still possible--I'm checking), or there's something lurking in the session that tries to tie the client to the server, and requires them to be running the same code base. Is that possible?  All the examples I've found are based on a "normal" game construction, where everyone is running the same code, just taking different paths at runtime.

  • 10/21/2009 10:47 PM In reply to
    • (0)
    • premium membership
    • Posts 7

    Re: Single player game and networking

    Thanks for everyone's help.  I now have a rudimentary demo of the Falcon controlling an Xbox game.  Don't expect to see it on Xbox Live though--it still requires Windows Live.  But it works as intended, given that constraint.
Page 1 of 1 (10 items) Previous Next
var gDomain='m.webtrends.com'; var gDcsId='dcschd84w10000w4lw9hcqmsz_8n3x'; var gTrackEvents=1; var gFpc='WT_FPC'; /*<\/scr"+"ipt>");} /*]]>*/
DCSIMG