Search Unity

Is unity's built in networking p2p?

Discussion in 'Multiplayer' started by gl33mer, Sep 11, 2010.

  1. gl33mer

    gl33mer

    Joined:
    May 24, 2010
    Posts:
    281
    I haven't delved deep into this one, but I was just wondering if unitys implementation is similar to the new rtmfp http://en.wikipedia.org/wiki/Real_Time_Media_Flow_Protocol protocol for flash/flex?

    rtmfp enables p2p communication over UDP from flash clients. No server required except as a rendevouz service (similar to the master server?).

    I've jumped in to some flex development for an idea I've had (that isn't a game and can't be pulled off with unity) and been delving deeper into this.

    It's quite neat. Should be quite good for gaming. Haven't tried it.

    But then I'm wondering - this sounds quite similar to unity's built-in networking...am I getting this wrong?

    (btw, this has all been in beta on flash player 10.1 only using Stratus as a developer rendevouz server ...but now seems to be coming out with FMS 4 enterprise which includes this service.)

    Thanks
     
  2. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    No its not p2p, its 1 dedicated "server player" + many clients

    p2p with udp is something thats highly troublesome as network setups that don't allow nat punchthrough disallow the user to play at all.
    if you have dedicated server players, such users are commonly just unable to host games (as in WarCraft III custom games for example where the games can't be joined)
     
  3. gl33mer

    gl33mer

    Joined:
    May 24, 2010
    Posts:
    281
    Thanks for the quick reply.

    I've been reading up on it, and it seems they have the NAT traversal solved somehow (unless your firewall is blocking UDP completely).

    From the Stratus Faq:

    There seem to be many advantages to this scheme.

    Also, this would mean no hosting costs if games could be played reliably over p2p. All we'd need is a rendevouz service.

    Does Xbox live work this way?

    Anyhow I was just wondering if this could/should be implemented in Unity.
     
  4. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    their solution is the same as all do. NAT Punchthrough.
    it can work but it also can not work and its totally out of your control

    No idea how xbox live works. But I always found it inacceptable that I pay $120 per year for hosting my own games on my own connection, thats why my gold membership was never renewed actually after my initial year.


    you can implement whatever you want through UDP Socket, but the point here is really "YOU"
     
  5. gl33mer

    gl33mer

    Joined:
    May 24, 2010
    Posts:
    281
    Ok.

    That got a little mystical there :)

    They're making a big deal of this over at Adobe. I've tried some of their sample code (Simple Video chat - p2p no server except the rendevouz service for finding the other clients) and it just works.

    It seems quite robust.

    http://www.flashrealtime.com/category/video-tutorial/

    This blog has quite a few examples (videos) which delve deeper into what this can enable.

    Anyhow, I'm not about to go head 2 head with "You" as I know very little about this stuff...but I have a hunch this will still become an interesting "game changer" in online web gaming.

    Then again I may be wrong.

    It surely will be quite interesting in other types of applications - for ex. censorship may be more difficult if the media is not hosted on a dedicated server.
     
  6. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    Well what they do and talk about unhappily does not touch you cause it has nothing to do with unity at all nor can you use.
    In addition, it iss used for stuff not available in unity if you use the webplayer (webcam and voice chat, or generally just heavy media data streams)


    Unitys network implementation is plain normal server client UDP networking, based on RakNet, no web multimediastreaming targeted technology as the one you cite.
    It wouldn't make sense to have such a tech for game networking as it isn't suited for the task


    what you can attempt is replicate the idea but thats basically the border
    and the rendevious server is much more than just finding others, its the backbone of the whole nat punchthrough actually (similar to the unity masterserver)
     
  7. gl33mer

    gl33mer

    Joined:
    May 24, 2010
    Posts:
    281
    Well..

    Happily it does.

    As I mentioned I've had an idea that can be implemented using this technology so I started looking into developing a prototype. It's not a game. (Btw, they give away Flash Develop 4 for free - if you're a student or unemployed)

    But since I love Unity and they do mention this technology as applying to multiplayer games (though I haven't seen more than very simple implementations) I thought I'd mention it here on the forums. If it is interesting maybe someone (or Unity) would look into it.

    Since I've seen you on many networking posts here on the forums, I'd imagine you know much more than me on these subjects.

    I can't see the advantage of having this kind of solution over the built in Unity networking solution.

    But maybe someone else can.

    Happy days.

    (awaiting unity 3 - when is it due? anyone know?)
     
  8. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    Unity 3 has no release date but soon from what mentioned :)


    Its definitely interesting stuff technically, thats out of question.

    But I'm generally not favoring p2p (thats why I'm waiting to see how badumna works out as the architecture seems to end with much more complex implementations and implementations to split authority between the distributed client calcs and dedicated server handling to reduce the requirements of own servers), cause p2p means that we have no dedicated authority (and thus far less cheat protection), the NAT passthrough problem which means you might lose users and you commonly still need a dedicated machine to host the required backend service to facilitate the nat punchthrough.

    But I guess it might depend on the game. for a tetris alike game for example and alike where you have 2 player and nothing that really needs authority, its definitely cool.

    But for me, I'm for the time being clearly favoring Photon and comparable technologies, cause they scale very well and allow me to avoid all these problems which means that my game can even be ported to mobile devices on 2G/3G/4G which otherwise won't work (no matter what magical tricks, passthrough will near always fail on mobile cause the phone providers totally block the stream there)
     
  9. gl33mer

    gl33mer

    Joined:
    May 24, 2010
    Posts:
    281
    As to the good news (Unity 3) I'm waiting patiently . So much more to learn :)

    I've just watched will's demonstration of deferred rendering - http://blogs.unity3d.com/2010/09/09/unity-3-feature-preview-deferred-rendering/ and found it very promising. Is it rumored to be part of the free edition?

    Back to Adobe's new p2p stuff and its relevance to Unity and possible future implementation.

    Well, I'll start from the end of your comment. It seems this stuff should work on Android (latest) out of the box (probably using an Air application).

    As for games, this is a quote I found from a book on real-time flash games:
    This is a quote from a book called "Real-world flash game development". (Safari books).

    Then I found some other quotes from another book about actionscript multiplayer game that states the problems with having p2p multiplayer games. 1) decision-resolution logistics 2) security.

    (ActionScript for Multiplayer Games and Virtual Worlds on google books)

    Basically the 1st can be solved by assigning one of the clients as a server running all the logic. But then you lose the advantage of quick response time and this leaves the security for games issue unresolved.

    I haven't found any mention of major games using this technology yet. I've seen some type of tower-defense game and pong game demo. I'm sure there's more out there. But this has been in Beta for quite a while, and has now been released.

    Knowing the creativity out there in game developer land - I'm sure solutions will start appearing.

    Since the rendezvous server as far as I can tell is only found on the FlasMediaServer Enterprise edition - I'm sure no indy developer would buy it. But then a 3rd party could implement it at a cheaper cost than hosting full server side code.

    Which is the bottom line. It seems to me that one could develop games that are playable by 100's or 1000's of players at a time with very low hosting costs. I guess we'll have to see what kind of games start coming out.

    If Unity decides to take this type of solution up as another built-in solution - and maybe hosts its own rendezvous service - we may be able to "host" games with little to no hosting costs.

    Hopefully this post is not too long to bare.

    I'll probably be getting back to learning Unity very soon (I miss it already) - Photon may be next for me. I saw that 50 CCu's is free. That's a good start :)

    But it has been a good experience moving to ActionScript and Flex from Unity. First, I feel empowered - after learning Unity and its JavaScript implementation for the past few months - AC3 wasn't as intimidating (although definitely not as fun) and there are still applications that just can't / shouldn't be built with Unity. Second, I grew to appreciate Unity more and feel ready to learn the stuff I wasn't prepared to dive into before (networking included).
     
  10. gl33mer

    gl33mer

    Joined:
    May 24, 2010
    Posts:
    281
    Just had a look at Badumna.

    Wow. Looks sweet.

    Btw, even with rtmfp - Authentication/Validation has to be done by the developer on his own server.

    Anyways. Just from a first look Badumna looks to be what I was referring to - only more robust, more features and centered around Unity and games.

    Very interesting.