Results 1 to 10 of 13

Thread: Best approach for simple network game

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    1. Use TCP for "realtime" communication, use HTTP for webpage-like stuff.
    Snake -> TCP.
    Chess -> HTTP.
    2. You should have server.
    2.1. In local network any PC has IP address, so if two ppl connected to same home router, either wired or Wi-Fi, they both have IP address in local network, so there should be no problem.
    2.2. To play over the Internet, either one of PCs should have static IP address, or you should provide one additional PC which would then act as an intermediate server in case u can't rely on players having static IP address. It is not even important if IP address is static or not. One of the PCs should be able to accept connections. When you view website, remote server accepts connection. When you play online game, remote server accepts connection. If there's no intermediate server, then one of player's PCs should act as server. To accept remote connections, configure your home router to accept connections & redirect them to ur PC, then look up your Internet IP address. Even then you can't be sure that you will be able to accept connections, the only way to be sure is to test it. Whether you will be able to accept incoming connections over the Internet or not depends on your Internet Service Provider.

    Most modern online games provide intermediate servers. Because in most cases you can't expect players to accept connections. Because to accept connections you should configure router, and then in most cases you also should pay your ISP additional fee, otherwise you won't be able to accept connections.

    U can still develop a game to be played using local area network, then there should be no problem.

    This all could change when IPv6 becomes more widely used. In IPv6 u have more addresses, so ISP's won't have to restrict IP addresses exposed to the Internet. Currently shortage of IPv4 addresses is the reason why every PC can't have static IP address. Same with mobile phones. However, what I said earlier about local area network is also true for Wi-Fi powered phones. Each phone in local area network has IP, so it can accept incoming connections....

    Lawl. I hope I managed to make some sense
    Last edited by dj_sharp; 20-05-2014 at 12:20 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •