Connect "client to client"

Options
Christuff
edited June 2010 in DotNet
Hello,
Having discovered Photon this morning, and considering using it I've a question.

Our purpose will be to replace the unity networking model, but as we have some games where client plays the role of authoritative server i wonder if Photon allow a client to connect directly to an other client
( send directly the updates to the client, instead of sending them to the server which send them back to others client ) ?

I've looked the documentation but haven't found anything related to it.

If no, on a role of just redirecting client orders, how many client could we hope to handle ( assuming 10 - 12 updates / sec / client ) - I don't want accurate numbers of course, juste an exemple will be great -
To simplify the question, a game like paintball paradise require something like 1 server to track the games, or something like 1 server for every 10 games ? ( by server I mean a single machine )

Thanks.

Comments

  • dreamora
    Options
    The answer is no, all communication goes through Photon. Its the center of the world for your networking simply put.

    As for the amount of players:
    Depends heavily on the connection of the server, its available cpu power and the amount of players in in average in a "room" (or LiteGame if you do your work basing on that).
    These are all crucial informations, especially the avg players / room as the bottleneck will be the server sending out the data (remember, you send data from x players to server but the server must send x * (x-1) data blocks to inform all other players in the same "environment". At least unless you want them to be sent to only 1 player explicitely).
  • bertelmonster2k
    Options
    If no, on a role of just redirecting client orders, how many client could we hope to handle ( assuming 10 - 12 updates / sec / client ) - I don't want accurate numbers of course, juste an exemple will be great.
    Tough one. I will approach it a little bit differently.

    We had several design goals with Photon:
    • Saturate a 100MBit network adapter on a decent machine and leave room for the business logic. Our Photon core is in native C++ code to handle the heavy lifting.
    • Provide a lean binary protocol. The size of each command has a major impact on the throughput.
    • Use a lean reliable UDP protocol (we use eNet as a basis, completly refactored and optimized for a server). Unreliable messages save a lot of bandwidth - and the are the majority for FPSs and MMOs.

    So assuming you can use 80% of the 100Mbit network leaves you with 10MB/s bandwidths for traffic.

    Each operation/event has a size of about 90Bytes. Assuming an aggressive send (10 ops/s) ops/events can't be packaged into one UDP package.Actually a 75% of the traffic is "overhead". With TCP and a text Protocol this gets worse.

    This leads to: 10MB/s / 90Bytes = 121,363 ops/s

    Using our light logic (like Dreamora described above) this leads to the follwoing CCUs and number of games:

    CCU_games_players-per-game.png

    The # of users per game has an exponential impact on the possible number of CCUs and number games. So with 8 players per game you can handle 190 games and 1517 CCUs.

    These values are theoretical - but have been partially verified in first tests.

    Find the Excel Sheet I used for calculation here: exitgames_photon-traffic-calculator.xlsx
  • dreamora
    Options
    Very usefull and indepth collection of information and the graph will definitely offer indepth understanding of the materia and complexity of the problem, especially to developers new to the field.

    Thank you bertelmonster2k
  • First, sorry for the reply time, we've been in rush to finish a projet the past week and i've completly forget to look at this topic,

    Thanks a lot for theses usefull reply,
    In fact, the hardest part is to determine our needs, because we plan to use the same architecture for many projects varying from 2 player games to, why not, some kind of mmo ( or big multiplayer games ).

    I will let you what will be our decision.
    Thanks again for your replies.
  • Tobias
    Options
    Please keep in mind: the "traffic calculator" is just approximating the data amound. It's not absolute or complete.

    Some things like "pings" and "acks" are left out or covered by some kind of buffer. If you send more data reliable, there won't be as many pings and the other way round. Also, actual traffic depends on network loss and how much of your data is resent.

    Still, the calculator is a good tool to get a feeling for the impact players/room and events/second have.