2 Replies Latest reply on Nov 7, 2014 9:50 AM by LeaPaul

    Should I be using NetStream or NetGroup (or both?)?

    LeaPaul Level 1

      Hi, I got a simple matchmaking logic in a php that so far works perfectly with a 1 versus 1 game I was doing these last past weeks.

       

      However, now I'd like to incursion into a NvN game. That makes me wonder, should I be using NetGroups for that?, or can I create multiple netstreams to all of the other farIDS in my custom made group?.

       

      I use a database to store the farIDs that then I pass to the client so they can find each other.

       

      Thanks.

        • 1. Re: Should I be using NetStream or NetGroup (or both?)?
          Michael Thornburgh Adobe Employee

          that depends on how big N is, and whether you need a full-mesh of connections or you can get by with transitive connectivity.  that choice will probably depend on your latency requirements.

           

          if N is less than 15-17, you can use a NetGroup and still probably have a full mesh, and that may be easier than constructing your mesh with NetStreams.  you can still make your mesh with NetStreams.  however, there may be performance problems if you have a lot of NetStreams.

           

          see my session from MAX 2011 for tips and tricks to using NetGroup, including how to use its different modes and where the magic number of "15-17" comes from:

           

            http://tv.adobe.com/watch/max-2011-develop/advanced-p2p-with-rtmfp-tips-and-tricks/

          • 2. Re: Should I be using NetStream or NetGroup (or both?)?
            LeaPaul Level 1

            Michael, thanks for you answer. N is never going to be bigger than 10.

             

            I've been using NetGroups and I'm kind of stuck with this issue, I need to know some data about the neighbors that connect to the NetGroup, at least a string representing their name. And since this seems easy, I can't find a good way to do it, I've tried/thought about this:

             

            - Listening to NetGroup.Neighbor.Connect, when this event fires I check the database to see the data from the new connected player, it seems the wrong way to do it, but it works.

            - Listening to NetGroup.Connect.Success, when this event fires I make a post(), but it doesn't seem to work, I've read some minutes ago that this works when you receive a NetGroup.Neighbor.Connect.

            - Listening to NetGroup.Neighbor.Connect, when this event fires I send a post() or sendtoAllNeighbours() sending my custom data. This should work, but still doesn't seem the right way to do it.

             

            Another thing, I need to be certain that this message is sent to all members of the group, it needs to be completely reliable.

             

            My question is, what is the best way to send the data of the newly connected member to all of the previously members of the group?.

             

            Thanks.