A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Browser-based game to interact with databases

  1. #1
    Junior Member
    Join Date
    Aug 2010
    Posts
    2

    Browser-based game to interact with databases

    I am trying to creating a simple game that will be played via a web browser. The game has to in-turn talk to a Database which holds "game pieces" and display them. The user will interact with these "game pieces" and through the game play expresses whether he likes the item or not. His preferences need to be recorded back into the Database (with the idea that ultimately we want to know how many gamers liked an item and how many disliked it).

    Is this is an unusual request?

    Since this has to be a browser-based game (and not a stand alone application), the difficulty seems to be that Adobe Flash does not have the ability to speak to Databases, at least in a straight forward way. If it was showing numbers or text from the database that seems to be doable. But to show images from the database seems to be a bottleneck.

    I am seeking your help to see if it is indeed true that Flash cannot interface with Databases and if there are any other methods to make this game. I am not bound to Flash and any other program is fine too.

  2. #2
    Senior Member bluemagica's Avatar
    Join Date
    Jun 2008
    Posts
    766
    Use PHP.
    Transfer the image info as byteArray.
    Build the image from it. easy work...
    If you like me, add me to your friends list .

    PS: looking for spriters and graphics artists for a RPG and an Arcade fighting project. If you can help out, please pm me!

    My Arcade My Blog

    Add me on twitter:

  3. #3
    Junior Member
    Join Date
    Aug 2010
    Posts
    2
    Thanks for your reply. Couple of things I was told as to why this was a problem:

    1) There are 100K "game pieces". The array will get huge.
    2) Converting to an array is laborious requiring many days.
    3) Writing back which "game piece" the gamers preferred into the database is difficult.

    Does this sound correct?

  4. #4
    Senior Member bluemagica's Avatar
    Join Date
    Jun 2008
    Posts
    766
    Umm, how exactly were you planning to store the images in your db in the first place?

    Normally people use a blob type (long or short as needed) data field, and that means the image is being stored as binary data. Now the only thing remaining is getting that data to flash via php....what's the problem?

    Anyway
    1) You were expecting to store 100k pieces in a single db field? -_-'
    2) How exactly is it laborious, when you can write a simple php script, to write all your image files to your db? Don't tell me simply running the script, while leaving your pc powered on. till the script finishes execution is laborious....
    3) I have completely no idea how you are planning to approach this, that makes this a "problem", but normally you would simply write the id of the image to the db, or increase a counter.
    If you like me, add me to your friends list .

    PS: looking for spriters and graphics artists for a RPG and an Arcade fighting project. If you can help out, please pm me!

    My Arcade My Blog

    Add me on twitter:

  5. #5
    Hype over content... Squize's Avatar
    Join Date
    Apr 2001
    Location
    Lost forever in a happy crowd...
    Posts
    5,926
    Could I suggest an alternative to using a DB ?

    How about just loading the images in randomly, like any old slideshow, and using google analytics to store which game pieces the user likes / dislikes.

    That way google does all the heavy lifting for you.

    Squize.

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