A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: creating an ONLINE flash game

  1. #1
    Senior Member Celtic_K's Avatar
    Join Date
    Dec 2004

    creating an ONLINE flash game


    How complicated would this be? and is there an .fla or a tutorial i can use to accomplish this?

    I want to create a basic online flash game all it is. is when someone gets to the site , it adds a dot on the screen and the user can move that dot around, and if someone else enters the site , a new dot appears so now both dots are on the screen and both users can control their dots.

  2. #2
    Senior Member
    Join Date
    Aug 2000
    If you're talking multiplayer, It can become quite complicated, specially server-side, where you would need a special server, socket server amongst other possibilities. I suggest you search and read about in multiplayer games in the game forum. You'll find a lot of info there.


  3. #3
    Join Date
    Apr 2006
    Alright, I'mma start of with my opening statement...

    I'm currently working on an MMORPG. The client side is flash, and the server side is ruby. I started off with the same question as you. I have came across a lot of road bumps since I started doing this 2 years ago (I've quit and restarted a lot....). I've picked up new techniques and syntaxes. It's not really that complicated, but most of us programmers have major ADHD. You'll have to pick up a completely new language for this, and be able to remember what is related to what in you server source in correlation to your client source.

    I will recommend using Ruby as your server side. The advantage of ruby over the following is as stated below:

    Ruby is better than PHP because it is FASTER and can do more than one line at a time. Ruby has multi threading capabilities, allowing it to process a crap load without slowing down your data flow.

    You do not have to compile ruby. I've tried figuring out how to compile java, and it's a real pain in the ass. All you have to do for ruby is have ruby installed (also you need to take the time to install ruby gems, but it's worth the trouble) and you're set to code.

    C++, C#, C, VB6, VB.NET, and almost every other language
    Ruby is a scripting language, so it's not the fastest thing in the world, but it is fast enough for your needs, I don't care if you're a multi million dollar corporation, or a hobo, it can meet your demand, if used right. Once again, it does not have to be compiled. The down side is, you're more limited unless you install extra crap on your computer for a GUI, which shouldn't be important.

    The downside to ruby's TCPserver
    Ok, I'll admit that there is a downside... I've looked for a way to detect disconnected clients, and I've not found anything like a "on disconnect" action feature. You'll have to work around it. I have the last data send from the client logged (in mysql) and after 15 seconds of not sending anything to the server, the client is prepped for server cut off. The server does client.close and removes the data about the client from mysql.

    Now, if you were paying attention, you've noticed I mentioned that you have to install ruby gems. Ruby gems comes with the ruby exe installer. You just have to use the shell access to install ruby gems. You can just find a tutorial via google, because I forgot how.

    Kirupa has an example of flash XMLsockets with a php server.

    Alright.... you're probably asking "But Life!!!! Why don't you link me to a ruby server tutorial too!?!?!"... It's simple... There are no complete tutorials on ruby TCPserver class. I've been stuck referencing through the ruby documents (documentation here...) on it and reading through the crappy coding crap like:
    irb(main):001:0> "Hello World"
    => "Hello World"
    That is NOT how you program in ruby. This is why ruby is no where near as popular as php, because of the people that obfuscate the codes into something unreadable, and not understandable.

    The server side is the BIGGEST obstacle that you have to overcome. I hope this helps you in your quest, and who ever else, to get your own multi-server game up and running.

    Anything else that I have not said, is implied...

    This is a library for MySQL connection in ruby... It came in an installable package for ruby, like ruby gems, but I couldn't figure out how to make it properly install, so I don't expect you to either. I just include it like I would include any other ruby file in my script.... with:
    load "mysql.rb"
    It came from http://www.tmtm.org/en/ruby/mysql/

    // Edit,
    Also, something that took me a while to notice when I started messing with this a long time ago. All the data sent from the server to the client will not be noticed by flash without the 0x00 hexadecimal at the end of the string sent from the server. In php it is chr(0x00) and in ruby it is 0x00.chr
    Attached Files Attached Files
    Last edited by LifeToTake; 05-17-2008 at 05:53 AM.

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