3 Replies Latest reply: Oct 31, 2013 12:12 PM by Aaron Beall RSS

    Create a Multiplayer game for Android/iOS using flash?

    tom_w2000@yahoo.co.uk Community Member

      Hi guys,

       

      We're creating a flash - turn based game for iphone and android using flash builider (flex) and actionscript 3. We've built the game and have a working Ai and are now trying to figure out how we can provide multiplayer support on iOS and Android.

       

      As far as Im aware there are the following options:

       

      - Serversocket (although apparently this doesnt work with mobiles.

      - p2p with native air plugin (although I understand that this requires a database as well as the build of a front end connect to players)

      - apparently there is a new way with html - whereby two players can exchange data over a website without the need for a server.

      - Third party package like appwarp?

       

      This is driving me crazy as I understand the principle - i.e. send data from one mobile to a database - database fires message to opposing player - updates state of game on both mobile and on the server.

       

      All we want is a turn based game that sends a simple string of code with the moves between two devices. Is there any way of doing this for mobile (Android and ios) using flash and actionscript 3, or flash builder - without using a database?

       

      Can anyone recommend a straight forward way to do this? 

       

      If not - Im actually thinking of taking the finished game to a company and asking them to host the servers and port the game to android and ios for a cut of the royalties. Any thoughts on this?

       

      Thanks for you help on advance,

       

      T.

        • 1. Re: Create a Multiplayer game for Android/iOS using flash?
          Aaron Beall Community Member

          You're making a lot of duplicate posts.

           

          ServerSocket is available on AIR 3.8 and above (someone corrected me on this in your other thread.) It would still require a service to allow clients to discover available clients, similar to what you need for Cirrus.

           

          Like someone else already said in your other-other thread, you are most likely going to need a server to some extent, even if the server is only handing off client IDs to enable p2p.

           

          Pretty much the only way I can imagine doing this without a server at all would be to have users send an invitation from their phone to someone they know, via email or text. That would limit the game to be played with people you know, not just anyone else who has the game.

           

          -Aaron

          • 2. Re: Create a Multiplayer game for Android/iOS using flash?
            tom_w2000@yahoo.co.uk Community Member

            Hi Aaron,

             

            Thanks for you kind response.

             

            Do you know how to use air 3.8 to create multiplayer for iOS android? It's frustrating, it's a basic turn based game so all we really need is to send 1 line of code containing a move between two devices which then changes the graphics. I've done something like this before using a MySQL server.

             

            I have a MySQL service on my hosting package for my domain, not sure whether I could use this?

             

            As far as I'm aware theres now an option in HTML 5 to do thus kind of thing without a server and swap data directly through a web address.

             

            Do you know roughly how much a small server costs to run?

             

            We're basically trying to get this on ios, android and desktop mac and pc. We also want to launch it through steam nd allow people to play each other via the steam network. Do you know or know anyone that knows about this kind of stuff?

             

            Thanks again, for your email. Where are you based?

             

            Tom.

            • 3. Re: Create a Multiplayer game for Android/iOS using flash?
              Aaron Beall Community Member

              Hi Tom,

               

              HTML has a bleeding new p2p API (WebRTC) but that has the same challenge as Cirrus in that it still requires some kind of web service to make clients aware of each other.

               

              You could definitely use your hosting with MySQL to do the server part. It would just involve clients sending a unique ID (and perhaps name), then clients can request a list of IDs/names from the service and try to connect to them. Once the p2p connection is made, the server is hands off. You would just need enough bandwidth to cover this login/logout functionality.

               

              Yes, I've created a realtime and turn-based p2p games in AIR using this technique, though not for mobile. Mobile would have the added challenge of connection drop-outs... this would best be solved by some persistent server-side identification. I may be able to help you with this. Send me more info to contact@abeall.com

               

              -Aaron