Results 1 to 10 of 22

Thread: multiplayer (and LNet)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    I guess that the best approach for multiplayer games, is to build the game around an IRC server/client architecture. One thing I was wondering about, is to do something around bittorrent as it may grant an option to build a serverless multiplayer game. Also have to be aware that any multiplayer game will suffer from lag (it's not a secret), no matter how well you code your network layer or the protocol/transport you use. Anyway you may timestamp your packets or set some way to tell priorities or number of packets before any action happens. Just my opinion.

  2. #2
    Quote Originally Posted by pitfiend View Post
    One thing I was wondering about, is to do something around bittorrent as it may grant an option to build a serverless multiplayer game.
    "something around bittorent" are you serious? You do know that torrent protocol is just a Per to Peer protocol which alows spliting large files into smaller packets to make data sharing a bit easier.
    Using torrent protocol for multiplaye is out of the question as it is optimized for sharing static data between multiple sources. In multiplayer game you have anything but static data.

    But yes using of Peer to Peer protocol you can achieve serverless multiplayer. This approach has been used for long time. DirectX was first masievly used framework which alowed that.
    But in the end it all depends on your multiplayer inplementation.

  3. #3
    PGD Staff / News Reporter phibermon's Avatar
    Join Date
    Sep 2009
    Location
    England
    Posts
    524
    Peer to Peer gaming has never been much of a success outside of a LAN, keeping any game state synchronized across such a model in real-time is difficult enough but when it comes to decision points it's nigh on impossible. Say you had 4 players, player one shoots player two. From players 2 state, player 1 didn't have line of sight for the shot, nor did they from player 3's state, but they did from player 4's.

    So did player 1 shoot player 2? well without a server you either have to take player 1's word for it (so you're opening the door to cheaters) or you have to take a vote, if the majority say the shot connected, it did etc

    But then you have a very quick action (a shot) requiring a quick decision from all or most of the peer to peer clients, which is only going to complete as fast as the slowest clients ergo slowing the game down for everybody.

    Yes lag differences between clients can cause similar issues in some FPS games, but the issue would be *greatly* magnified in a peer to peer topology.

    Of course you could just take players 1's word for it, but then they could either cheat, or player two is going to uninstall your game because they keep on getting excessivly killed by players with a lower ping who weren't even in the room (from their perspective) as they died.

    A server is more than just a physical hub for game clients, it's an essential 'mutex' in the concurrency problem that is network gaming.

    Obviously there are slower paced games / mode of play that might be better suited to a peer to peer model but then at the same time, they'd also be even more suited to a client/server model.

    Plus you can get away without UPnP for opening up ports on a players router etc in a server model as you're routing out. The moment you rely on UDP / incoming comnnections, you realistically need UPnP code unless you want your forum filled with "can't connect, help!" messages.
    Last edited by phibermon; 31-12-2013 at 05:05 PM.
    When the moon hits your eye like a big pizza pie - that's an extinction level impact event.

  4. #4
    'serverless' would be nice but I don't really see how this could work. I'm planning to have a central server for match making and some verification but game will be hosted on player's machine. co-op against bots so hopefully cheaters won't be such a game breaking factor

  5. #5
    Yes the biggest problem in Peer to Peer multiplayer is keeping game state synchronized between all clients. So you need active mechanizm which makes sure that game states are synchonized between all clients. This of course means that the slowest computer with worst connection will cause the most lag to all other players.
    But the biggest advantage of Peer to Peer multiplayer is that you don't require dedicated server for it (no aditional expesnes for dedicated servers) becouse anyone can host a game at any time.
    Another advantage is that using Peer to Peer you can distribute processing between different clients. This in the end alows using of more complex game mechanics.
    Unfortunately this introduces huge chances for players to cheat with modified clients.

    But if you wanna make a multiplayer game where noone could cheat all I can say is good luck. Why? There is no easy solution to this.
    For instance I remember a cheat mod for Far Cry which alowed you to easily shot at other players. All you needed was to have another player in sight and mod automatically calculated needed trajectory for bulet. This means you didn't even have to aim and was still making perfect kills.
    When PunkBuster service got implemented they prevented this mod to work until it was updated to work even with PunkBuster protection.

    So the only way to prevent players from cheating in multiplayer games is making games so that client simply sends player imputs to server and server simpy returs visual and audio information back to player. There is absolutely no processing made on client. So you need extreemly powerfull servers for this. But a viable solution is actually moving server into cloud to get enough processing power.
    And since all processing would be made on server side this would also alow you to play extremly demmanding games even on crappy computer (no need for advanced graphics cards, no need for large amount of RAM, no need for large HDD space as you would require only tiny application on your computer). All it is necessary is for that computer to be able to smotly play any streamed movie with desired resolution.
    But for this to work you need excelent network connection with minimal lag.

  6. #6
    I'm aware that p2p multiplayer games are something hard to code. My idea takes in account that you have nodes/supernodes for each client/server. So, when you came into some specific area where a supernode is already working, game client switchs to it as main server, later all supernodes syncs between them to keep data integrity, or as soon as you move to another supernode or became one. Anyone in that network scenario could became a supernode, as any client could upscale as needed.

    On the pros side, you could play solo or with your friends (multiplayer is an option).

    On the cons side, you may need humongous disk space for user data validation, once you became a supernode. A house keeping mechanic must be implemented to make this viable. A tracker server may be needed to be able to sync nodes/supernodes.

    This is just a project on planning stage. I know there are lots of things/condition to foresee/consider.

  7. #7
    PGD Staff / News Reporter phibermon's Avatar
    Join Date
    Sep 2009
    Location
    England
    Posts
    524
    A distributed model will work but you'll hit limits pretty quickly and it'd be an absolute nightmare to debug/optimize. You might want to make a virtual network with artificial delays, either using VM software or by mechanism in your code, it'll be a bit of work to get it set up but well worth it if you plan on making something robust enough for real-world use. Would love to hear about progress so please keep us updated!
    When the moon hits your eye like a big pizza pie - that's an extinction level impact event.

  8. #8
    As far my schedule permits it, I will, unfortunately this is a project I work on spare time.

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
  •