A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: Facebook API: Can it make multiplayer games easier?

  1. #1
    Senior Member Alluvian's Avatar
    Join Date
    Jun 2006
    Posts
    967

    Facebook API: Can it make multiplayer games easier?

    I have been kicking around a few multiplayer turn based games for awhile in my head, and am wondering if the facebook flash integration would help with that or if it is just a way to draw people in, and I would still need to run the data transfer with a socket server or something like that.

    I don't have a server I can use as a socket server (just a shared server with pretty standard hosting).

    I have dabbled in using php and mysql to store and send data to flash and do simple things like talk to my wife in a simple lobby setup.

    Would the facebook flash integration help with sending data from one person to another or would it just be adding another layer of complication on top?

  2. #2
    Senior Member
    Join Date
    May 2009
    Posts
    138
    Facebook API doesn't really help with data transfer, it is primarily for getting information about the player and the player's friends.

  3. #3
    Senior Member Alluvian's Avatar
    Join Date
    Jun 2006
    Posts
    967
    So all I would really be skipping is a login page (I could instead just require facebook login and use their username), and possibly some leaderboard issues.

    Such a pain to do multiplayer without a socket server.

    I can do communication with Flash>php>mysql and have the flash players just constanstly query the database for changes to gamestate and what the other players have done since last query.

    But handling disconnects and reconnects is very problematic for me. Actually that is a problem as a designer as much as a programmer... Let the other players keep playing or stop the game? Do I have to adjust difficulty now based on less players? What if the dropped player comes back in 15 mins? BAH. Hehe.

    Thanks for the info Redjag.

  4. #4
    Senior Member
    Join Date
    May 2009
    Posts
    138
    Yeah, a socket server-type solution is ideal for multiplayer games. If you want to do it with php/mysql you can discover disconnects by having the polling Flash player touch a timestamp every X seconds and then count them as disconnected if they haven't checked in for X*3 seconds, or something along those lines. The design questions are up to you and your game, though

  5. #5
    2KHeroes / Sylvaniah designer luxregina's Avatar
    Join Date
    Jul 2001
    Location
    Somewhere between Kirlundin and Anskaven
    Posts
    1,273
    Redjag is right - dont expect Facebook to bring any kind of solution to your multiplayer game - problems and answers will be answered way before ready for a facebook port, but once you solve them, you can rely on Facebook to promote the viral nature (or not) of your game...

    At this time, Facebook doesn't provide any server framework to interact )or speed up interaction) with their data : the only thing they provide is access to data and connected data ( friends list ).

  6. #6
    2KHeroes / Sylvaniah designer luxregina's Avatar
    Join Date
    Jul 2001
    Location
    Somewhere between Kirlundin and Anskaven
    Posts
    1,273
    this said, as an (ex) web pro, I can tell you that major brands are looking for a way to go viral on Facebook : the one that finds some sort of reliable solution will hit the jackpot ( and I'm talking "huge" brands )

  7. #7
    Member
    Join Date
    Aug 2006
    Posts
    50
    facebook api wont help much, for a turn based game since speed doesnt matter tooo much, make a temporary table for the user storing health, damage, attack being done whatever whatever. and just run a query of inserts and selects and base what happens on the results, setting up a socket server is quite tough. although if you have time go for it. may be like a second or 2 if you go with the database way but still very playable for turn based.

  8. #8
    Senior Member
    Join Date
    Aug 2002
    Posts
    349
    If you dont need the rapid multiplayer, polling might be easiest for you.

    Sockets are nice, but they can become unstable and be a royal pain in the but.

    I will be looking later into turning my mpog into a facebook app, just have to better understand thier server code and get some wasteable time lol.

    Edit -

    You can use PHP socket servers, but I left them because after 15 or so users, on a rapid use basis of sockets, they become REALLY unstable and crash. I use custom java for my server, but there are many other sites out there with prebuilt servers that may make things much easier for you than making your own.
    Last edited by kyled; 05-26-2009 at 08:17 PM.
    Free Flash Multiplayer Gaming
    http://www.gecko-games.com

  9. #9
    Registered User
    Join Date
    Aug 2011
    Posts
    1

    game_maker

    hi,
    I am pretty much new to this server polling concept can u provide me with some examples or may be a link to make a multiplayer turn based gaming server side code... using php and mysql as scripting language and database with flash as my platform
    pls do help me.............
    Thanks in advance

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center