Best Solution for building Multiplayer Flash Game in PHP

Discussion in 'PHP' started by dart_phpcoder, Jun 12, 2008.

  1. #1
    Hi All,

    Please suggest me which of the below ways would be best to make a multiplayer flash game in PHP. I want all players to simultaneously see the steps made by other players.

    1) Polling the server at regular intervals using AJAX.

    2) Using Socket programming.

    Please also suggest me if there is any other way possible using AJAX and Action Script etc.

    I personally feel that socket programming would be the best way. If any of you feels the same, please suggest me how to go about this..

    I would really appreciate.

    Thanks....
     
    dart_phpcoder, Jun 12, 2008 IP
  2. TextAdMarket

    TextAdMarket Peon

    Messages:
    520
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I would also agree with Socket.
     
    TextAdMarket, Jun 12, 2008 IP
  3. 2beers

    2beers Well-Known Member

    Messages:
    195
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    110
    #3
    multiplayer flash games and php don't work very whell. PHP socket functions are not so good in creating real time games. You should use a java for the game (on the server side) and flash on client side.
    Ajax is good but for the client. Your problem is not sending the information is receiving the info. For this you'll need to use XMLSocket functions from AS. See Flash documentation for more detailes. Of course if you have lots of money you can use Flash Media server
     
    2beers, Jun 12, 2008 IP
  4. clinton

    clinton Well-Known Member

    Messages:
    2,166
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    110
    #4
    I agree, if you want to bake a cake, hire a cook, not a doctor.:D PHP is at it's best elsewhere, thats what Java is for.
     
    clinton, Jun 12, 2008 IP
  5. dart_phpcoder

    dart_phpcoder Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    But now, the problem is that I am not acquainted with Java. :(
    Can you guys please tell me what actual performance difference is there between sockets in PHP and sockets in Java. Whether it is in terms of Load handling capacity , or speed , or anything else.

    Also, if I want to do this in PHP , how can I improve the performance of sockets in PHP .

    It seems that the Texas Hold'em Poker game on Facebook is made in PHP :-

    http://apps.facebook.com/texas_holdem/index.php

    This game gets a lot of hits and its performance is also good.
    How do you think does it manages this ?
     
    dart_phpcoder, Jun 12, 2008 IP