PA multiplayer port and UPnP

Discussion in 'Planetary Annihilation General Discussion' started by antillie, May 31, 2013.

  1. antillie

    antillie Member

    Messages:
    813
    Likes Received:
    7
    A quick search has turned up nothing on this so I will ask.

    I'm rather certain that PA is going to use a single static destination port for connecting to multiplayer servers. This is just a wild guess on my part but it seems like the logical and easy thing to do. Which exact port isn't particularly important at the moment although I am a bit curious if it will be using TCP or UDP.

    My real question is if PA is going to support UPnP or not. Personally I can't stand UPnP and my home LAN does not and will not ever support it in any fashion. However many people find it convenient and like not having to set up port forwarding manually.

    I guess my only real concern is if PA does support UPnP will it spend 10-15 seconds trying to connect to my gateway device via UPnP every time I try to host a multiplayer game? I ask because I once played a game that did this and having to wait for UPnP to time out and then dismiss the resulting error message every time I played as pretty annoying.
  2. hostileparadox

    hostileparadox Well-Known Member

    Messages:
    1,186
    Likes Received:
    151
    According to the almighty Wikipedia, UDP seems more suitable to game design, due to it's speed, despite its inability to check if packets were delivered. Especially essential for onlines shooters and their quick reaction times.

    But RTS games do not require split second decisions do they?
  3. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    FA uses UDP and I am pretty sure that PA will use UDP as well.
  4. bgolus

    bgolus Uber Alumni

    Messages:
    1,481
    Likes Received:
    2,299
    Ironically, though SupCom used UDP, it did 100% of it's communication over essentially a full re-implementation of TCP.

    PA right now is TCP, though will likely be transitioning over to UDP during alpha.

    I don't personally know of any plans to support UPnP.
  5. SXX

    SXX Post Master General

    Messages:
    6,896
    Likes Received:
    1,812
    I think PA will use both.

    Developers mentioned before that PA server will have web-server inside, so multiplayer lobby will be done as normal HTML-page. I guess there might be some other functions like administration tool or statistics. HTTP(S) is TCP-based.

    But for games UDP is usually better, so I bet for actual game they will use UDP.
    These 10-15 seconds isn't UPnP fault, just developers of game is bad. Good designed program should cache result of UPnP and have option to disable it.

    On these forums we got direct access to developers and many of PA backers are programmers. I don't think Uber want to get nerd rage for doing something like that. :mrgreen:
  6. SXX

    SXX Post Master General

    Messages:
    6,896
    Likes Received:
    1,812
    I starting to understand why it's networking was so big bottleneck.
    What about web server part? HTTP over UDP seems like a strange decision, transferring big amount of data (like map) over UDP too... :?
  7. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    That's a surprise to me, but my knowledge is pretty limited. Why use UDP when you implement an TCP on top of it by yourself anyway? Why start PA with TCP and then transition to UDP? What is the reasoning behind this?


    If you integrate a webpage into the game's lobby it will probably use http over port 80, tcp. I don't see why that could not be totally separate from the game itself.
  8. teradyn

    teradyn Member

    Messages:
    232
    Likes Received:
    0
    I don't know what happened in this particular instance, but a lot of times it is a feature creep problem. You use UDP for its benefits, but then you start trying to add a little delivery guarantee, packet ordering, etc. till you find yourself re-inventing TCP...
  9. bgolus

    bgolus Uber Alumni

    Messages:
    1,481
    Likes Received:
    2,299
    Exactly this. UDP is faster than TCP, but you have to assume messages sent over it can get lost or come out of order and for that to be okay. Often people use UDP and implement two layers, one that's traditional UDP and another that adds message confirmation and / or explicit ordering.

    For SupCom my understanding is they implemented both fast (and potentially lossy) and "slow" (TCP-like) methods with the expectation of using both, but in the end all messages had to be guaranteed so the fast method never got used.

    Game's lobby is not going over HTTP. The game's UI is a webpage, but it's generated by the client not served by the game server.
  10. SXX

    SXX Post Master General

    Messages:
    6,896
    Likes Received:
    1,812
    I don't think game will use port 80, there as few reasons:
    1 - It's probably already used.
    2 - On Linux all ports bellow 1024 are privileged and only may be used by "root". Probably the same issue on OSX or Windows.

    PS: Already see bgolus answer.
  11. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    Err, I was thinking about embedding a webpage into the client. Like you would load some webpage and embed it into the lobby. That webpage would be loaded via http, wouldn't it?
  12. SXX

    SXX Post Master General

    Messages:
    6,896
    Likes Received:
    1,812
    Thank for clarification.

    But I totally sure that somebody of Uber staff mentioned something like "PA server will have something like web server in it". Probably it's was neutrino or garat, don't remember. :ugeek:
  13. bgolus

    bgolus Uber Alumni

    Messages:
    1,481
    Likes Received:
    2,299
    HTTP is a network protocol originally intended for transferring HTML data over networks, and reused to transfer pretty much everything on the internet. Loading the web page for the lobby is just opening some html, javascript, png, and css files that are already on the harddrive. In other words, no need for HTTP.

    And they're correct, the server will have a web server, but not for hosting the game lobby. That's for server administration, just like many other games have for server admin or like your home router does.
  14. SXX

    SXX Post Master General

    Messages:
    6,896
    Likes Received:
    1,812
    Okay got it. But please correct me if I wrong: there was talk (in one of streams as i remember) about html-based interface (particularly lobby) and some of devs said that lobby-design might be mod-able on server side as long as other part of game.

    It's how I'm understand this: if server contain some non-standard game content (for example units, map biome, sounds, lobby html's) client download it's automatically before connecting the game. It's how mod's management works in Minetest (open source minecraft-like game). Is it work like that?

    I understand if you probably can't answer on question like that yet (don't think you already decide what's better), but it's should be cool if server might have different lobby html/css/etc.

    That's nice feature too, but anyway i prefer to use ssh when possible.
  15. magisterquis

    magisterquis New Member

    Messages:
    9
    Likes Received:
    0
    If you're going to re-implement TCP, why not just use TCP?
  16. SXX

    SXX Post Master General

    Messages:
    6,896
    Likes Received:
    1,812
    I think you got it wrong. bgolus said it about SupCom, not about PA.
  17. bgolus

    bgolus Uber Alumni

    Messages:
    1,481
    Likes Received:
    2,299
    For the current alpha, it is not the case. For future stuff, it's quite probable we'll move in that direction for modding. I couldn't give you a time frame as to when though.

    Downloading mods from the server: I don't know the specifics of how that will function (we haven't written it yet for one), but I suspect we'll end up with something like your example. It's too early for me to say if we'll send lobby pages as part of a mod or directly as a web page. It's not part of my job for one. :)

    Implementing TCP like features using UDP lets you pick and choose how much speed vs reliability you want rather than using the full TCP. There are also issues with using TCP and UDP at the same time, namely causing TCP to slow down and UDP to lose packets. Generally for games you only need part of the TCP features, and dropping some of them (in particular the in-order behavior) makes for a much faster and consistent data flow.

    Here's a link if you're interested in reading up more on it:
    http://gafferongames.com/networking-for ... dp-vs-tcp/
  18. SXX

    SXX Post Master General

    Messages:
    6,896
    Likes Received:
    1,812
    Thank for answer, I'd like how gamedata work in SupCom when all archives "mounted" inside virtual filesystem.
    Let's see how that will be done when Beta arrives. ;)
  19. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    I was thinking about the scenario where an actual webpage is embedded for whatever reason. I.e. forums.uberent.com, my understanding is that this will be possible at some point. To load that webpage http will be required at some point. My train of thought kinda derailed from the lobby and game itself ^^
  20. SXX

    SXX Post Master General

    Messages:
    6,896
    Likes Received:
    1,812
    There is just few examples how Uber might use webkit/html/etc it without any http requests when all data about lobby (like players list, chat log) transferred over UDP in some binary/xml/json format:
    • Client get data, but only use html/js/css for internal "template engine" like smarty or django template. E.g client generate static-html and only then use this static html into embedded webkit.
    • Client get data, then it run embedded webkit with javascript which decode this info and render webpage.
    • All client logic done in javascript and there is some special API to use "native" functions inside embedded webkit.


    Let's see how Uber decide to done it. :ugeek:

Share This Page