A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 25

Thread: PHPgateway

Hybrid View

  1. #1
    Flash Developer on a break
    Join Date
    Jun 2001
    Location
    The Netherlands
    Posts
    1,370

    PHPgateway

    I was asked a while back to make a few PHP scripts so you guys can easily put things together for turn-based or a (slow) realtime multiplayer games.


    Sounds like a good idea, right?

    So.. will this be like a low-end, soft version of Flash Remoting and/or FlashComm?

    Well, first we should know then what those two things are:
    What is Flash Remoting?
    Flash Remoting is a Flash MX specific feature which allows you to execute Remote Procedural Calls (RPCs) via Flash MX and transfer serialized, type-persistent objects directly between the server and a Flash MX client.
    In more simple terms, Flash Remoting allows your Flash MX movie to exchanged typed data directly with a server-side language, allowing for increased and more easy integration between the front-end and backend of your site. For example, you can send an array from your server-side language into Flash as an array, instead of as an XML object or a String representing an array (which you process within Flash to turn back into an actual, Flash readable array).
    The major use for Flash Remoting is in creating Rich Internet Applications (RIAs). In other words, using Flash not just as an animation tool, or even a jazzy HTML interface, but as the GUI and Client for a full-scale, service providing, Internet application.
    What is Flash Communication Server?
    It is basically a server you can connect to with your Flash applications to develop the next generation of online communications:
    Deliver multi-way audio, video, and real-time data in your websites and Rich Internet Applications. Create engaging pre-sales applications that integrate audio, video, text, chat, and enterprise data. Develop powerful corporate presentations with streaming video and synchronized multimedia content that are deployed seamlessly within the context and branding of your site. Or build collaborative meeting applications that bring people together in real-time-connecting them to each other, to live data sources, and to back-end services for a significantly more compelling online experience.
    My idea was first to create a small easy script that lets you send some variables to a MySQL database and someone else to retrieve it. But now I'm thinking about something better.
    It won't be exactly like Flash Remoting, since I won't use the AMF(ActionScript Message Format) protocol to send objects and the like over the net. Instead simple objects that are converted into strings can be send.
    It won't be exactly like FlashComm. PHP don let you stream things, and without some rare PHP-server settings, you won't be able to send anything in realtime using socket technology. Instead data, it doesnt matter if it is for a chat, simple text or arrays will be transferred with a small delay.

    So I will make a full component with new actionscript functions, reference, etc. (So no digging yourself in PHP scripts..) However, I'd like to ask you guys if you like some feature I might be able to implement. Or just feedback.

    Features I want to implement for sure:
    - LoadAndSend refresh rate
    - Able to send and load simple Objects made with new Object()
    - Able to send and load arrays
    - Able to send and load variables


    What do you guys think?

    Jeroen

    | "Keep Flashing!"-Jeroen
    PHP multiplayer? Check this thread: PHPgateway

  2. #2
    Phantom Flasher... Markp.com's Avatar
    Join Date
    May 2000
    Posts
    16,034
    Sounds good... so this would be great for an online game of chess, or turn based game.

    Is it going to connect to a database at all?

  3. #3
    Flash Developer on a break
    Join Date
    Jun 2001
    Location
    The Netherlands
    Posts
    1,370
    You will need a server that supports PHP and MySQL(database).

    The only time you'll have to mess with the PHP scripts is when you upload them and run them the first time manually to setup the tables in your MySQL database.

    | "Keep Flashing!"-Jeroen
    PHP multiplayer? Check this thread: PHPgateway

  4. #4
    Phantom Flasher... Markp.com's Avatar
    Join Date
    May 2000
    Posts
    16,034
    Ok cool... will it have an install script for setting up the mysql database/tables etc...

  5. #5

  6. #6
    Senior Member martin47's Avatar
    Join Date
    Dec 2000
    Posts
    413
    Sounds very interesting.

    I am concern about one thing regarding multiplayer applications with php and mysql: what happens with the performance of the overall system when you have many players? Is there a way to check how the system is performing?

    A couple of suggestions for your tools:

    How will work matching players, getting them together, etc.?
    It will be good to be able to see how many players are using the system.

    I´ll keep thinking.
    http://www.drakon.com.ar

  7. #7
    Hype over content... Squize's Avatar
    Join Date
    Apr 2001
    Location
    Lost forever in a happy crowd...
    Posts
    5,926
    What a fantastic idea / offer

    Squize.

  8. #8
    Flash Developer on a break
    Join Date
    Jun 2001
    Location
    The Netherlands
    Posts
    1,370
    Markp.com
    Ok cool... will it have an install script for setting up the mysql database/tables etc...
    Yes, it will.

    martin47
    I am concern about one thing regarding multiplayer applications with php and mysql: what happens with the performance of the overall system when you have many players? Is there a way to check how the system is performing?
    A normal server can handle douzens of simultaneous users. A MySQL database can have thousands of simultaneous requests at the same time. The lag will lay with the server bandwidth and the client bandwidth.

    How will work matching players, getting them together, etc.?
    It will be good to be able to see how many players are using the system.

    I will make a way so you can add players in a game list who use the same game variables. (So the flash app sends a playerid, the script checks in what game the player is and stores the players data in the database while retrieving the data from the players who are in that same game.)

    What about a setting so the administrator(You, with ftp access) can set a max amount of players for the whole server? And a que(sp?) list so players can wait in turn untill there's a spot free?

    That way you can see for yourself if the server gets bogged down and set the max amount lower.

    | "Keep Flashing!"-Jeroen
    PHP multiplayer? Check this thread: PHPgateway

  9. #9
    Phantom Flasher... Markp.com's Avatar
    Join Date
    May 2000
    Posts
    16,034
    Originally posted by jeroen84
    What about a setting so the administrator(You, with ftp access) can set a max amount of players for the whole server? And a que(sp?) list so players can wait in turn untill there's a spot free?

    That way you can see for yourself if the server gets bogged down and set the max amount lower.
    Yup... good ideas about the login etc... I think it needs an administration panel anyway.

    Is there a way to limit the bandwidth... just if your game turns out to be popular, this might be a good feature

    Limiting it to run on the one server, so you can't get someone poaching your files/bandwidth.

    Also I'm sure I don't need to tell you but no passwords in the SWFs I am so dissapointed when I get a great php/swf app and some dumbass has included passwords in the swf

    I hope this isn't spiralling out into something you are going to have to take a year out of life to write

  10. #10
    PSN
    Join Date
    May 2001
    Location
    WC
    Posts
    48
    Can't wait 'til you release this.

    I have a question. I was wondering if you can post as much as you have as you go along creating this. The reason being is that I know a little bit of PHP and MySQL, I just really need a base to start on. From there, I think I can go in and modify it.

    Thanks

  11. #11
    Flash Developer on a break
    Join Date
    Jun 2001
    Location
    The Netherlands
    Posts
    1,370
    Markp
    I'll make an Administration panel.

    Is there a way to limit the bandwidth... just if your game turns out to be popular, this might be a good feature.
    The only way what I can do is keep a record of the amount of bytes send back by the PHP scripts. That's an idea tho. But you should remember that the flash game itself probably makes up most bandwidth.

    Limiting it to run on the one server, so you can't get someone poaching your files/bandwidth.

    Also I'm sure I don't need to tell you but no passwords in the SWFs I am so dissapointed when I get a great php/swf app and some dumbass has included passwords in the swf.

    Don't know what you mean by it to run on one server.. Protecting the SWF itself is something for the Flash Developer himself. PHP scripts can't be downloaded. (Well.. except for the ones that I'll publish.)

    The system that lets Flash communicate between PHP won't be secured with passwords. As you said, flash passwords aren't very secure. I'll use HTTP Referers instead. That way only the flash file can communicate between the php files. (You will have to give the url of the game in the admin panel.)

    And I hope to be ready in a few weeks.

    drakz - I'll give you two PHP example scripts that you(or others) can use. It's the basics tho.
    Attached Files Attached Files

    | "Keep Flashing!"-Jeroen
    PHP multiplayer? Check this thread: PHPgateway

  12. #12
    PSN
    Join Date
    May 2001
    Location
    WC
    Posts
    48
    Thanks jeroen84, I will take a look at your php scripts and see what I can get out of it.

    Can't wait to see your final products in a few weeks.

    Good luck

  13. #13
    -= phil =- d3s_inc's Avatar
    Join Date
    Oct 2002
    Posts
    610
    may I ask you expect to tell flash that it need to load new data?
    The only way I can think of is loading something every few seconds, no?

  14. #14
    Senior Member RazoRmedia's Avatar
    Join Date
    Oct 2000
    Location
    UK
    Posts
    3,016
    sounds very interesting jeroen84,

    I'd like to get involved. I'm a flash developer and a PHP programmer. If theres anything you want help with, let me know.

    nice one
    Living the dream

  15. #15
    Senior Member gilgaMExe's Avatar
    Join Date
    May 2003
    Posts
    163
    So where is this stuff?

    I'm developing right now my turn-based game and I'll need php scripting in short!

    Somebody wants help me?
    HEXTRATEGY - Coming August 2003 (I hope)

  16. #16
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    Originally posted by jeroen84
    And I hope to be ready in a few weeks.
    jeroen, how are you doing?
    Can the scripts be downloaded now?

  17. #17
    Senior Member
    Join Date
    Oct 2001
    Location
    Belgium
    Posts
    467
    "Bandwidth"

    Haha, lucky me, i'm a webhost :-)


    Aha this is exactly what we all needed!
    Thank you Jeroen :-)

  18. #18
    Heli Attack! iopred's Avatar
    Join Date
    Jun 2003
    Location
    Sydney, Australia
    Posts
    923
    =) Im doing something similar atm now you mention it.

    You can replace:

    $sql1 = "UPDATE $db_table SET flashvarX='$x' WHERE game='$gameName'";
    $result1 = mysql_query($sql1);

    $sql2 = "UPDATE $db_table SET flashvarY='$y' WHERE game='$gameName'";
    $result2 = mysql_query($sql2);

    with:

    $sql = "UPDATE $db_table SET flashvarX='$x',flashvarY='$y' WHERE game='$gameName'";
    $result = mysql_query($sql);

    stops multiple requests..

    Im working on a similar thing, but including level saving for users, so a user can log in and create say, a racetrack. Then anyone can load up their map.. should be awesome.
    Last edited by iopred; 06-27-2003 at 06:32 PM.

  19. #19
    Senior Member random10122's Avatar
    Join Date
    Mar 2002
    Location
    Sheffield, UK
    Posts
    1,747
    Im just kicking this back upto the top because it is interesting and will be very helpful to a lot of us. Have you done any work on it jeroen?

    fracture2 - the sequel
    fracture - retro shooter
    blog - games, design and the rest

    "2D is a format, not a limitation" -Luis Barriga

  20. #20
    Senior Member random10122's Avatar
    Join Date
    Mar 2002
    Location
    Sheffield, UK
    Posts
    1,747
    Sorry to bring this back (again)

    I was just wondering, when you say 'slow' realtime games what does this constitue? Because i would probably be interested in using this in a project that im just beginning.

    fracture2 - the sequel
    fracture - retro shooter
    blog - games, design and the rest

    "2D is a format, not a limitation" -Luis Barriga

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