[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now


Flash Multiplayer Game

Posted on 2006-11-28
Medium Priority
Last Modified: 2013-12-04
Hi. How do I create a multiplayer game in Flash? I can use and understand actionscript but I dont have experience of MySQL, or PHP, or ASP. As I have allotted 250 points to the answer to this question - i would like the answer to include code aswell please. Thanks :D
Question by:QuddusAli
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 14

Accepted Solution

trigger-happy earned 336 total points
ID: 18061276
Creating any kind of game is not as easy as it sounds, let alone a multilayer game. There are several things you can do to create a multiplayer game. The 1st one would be through the use of PHP, MySQL, etc. These kinds are rather slow and would be recommended for games like chess, tictactoe, checkers, etc. The 2nd type would be through the use of sockets. Socket will allow you to create a more real time interaction between players and can allow you to create games that require faster reaction times. In creating a game, you should ask yourself the following:

1.) What kind of game are you making?
2.) Is it feasible in flash and what technique should be used?
3.) Do you have enough experience in using flash to create a game?
4.) Do you have the time to create such a game?
5.) Do you think you'll be interested all the way in making such a game?

Don't overlook any of these questions because game development of any kind is very difficult and time consuming.

Finally, there is no single code that can help you create a good multiplayer game. If you're really willing to make a game then my suggestion is to do some experiments in flash on how to use PHP, MySQL and the XMLSockets to accomplish things. Once you get a good feel on how to use them, you would have completed the 1st step to creating multiplayer games in flash.


Assisted Solution

psyki_be earned 332 total points
ID: 18062742
What kind of game would you like?

Something slow? like chess, checkers, ...
Or a real-time game, (mini shooter, ...)

And, yes, what exactly is your question?
The question: how do I create a multiplayer game?.
Where exactly are you stuck?
have you ever written a single player game?
What is your level of expertise with Flash?

I'd recommend some smaller projects, maybe a small single player game, or checkers, Battleships, ...before writing a full multiplayer game.

However, if you're gonna go trough with this, I wouldn't use php and mysql. Those are good or keeping highscores, ... But they're too slow for most of the things you want to do (definitely if you want something like a shooter game you need a direct connection between your clients to do that).
You can use a direct connection, trough XML Sockets, like trigger-happy already said.

Developing a game will consume lots ADN lots of time, lots of frustration and points where you'll be stuck, or bored and want to give up. Definitely if you haven't exactly coded much yet.
However, I do not know your level of expertise, so... good luck.
If you have more questions, feel free to ask, but ask more 'specific' questions.

We can't write some sample code for something as big as you want.

Expert Comment

ID: 18062752
Here's a quick tutorial on the use of XML Sockets.


It makes you able to write a simple chatbox.
Now, as you see, the server code is NOT Flash.
You'll need C++, PHP, Java, ... to do you serverside coding.
I'd recommend Java.

Anyway, to get you started.
You have to send messages from the client to the server, which then can send that message to other clients.
So, let's say character 1: Mario moves forward. He will have to send a message to the server, that he moved forward.
The server will tell all your other clients that Mario moves forward. When your clients receive this specific message, you have to let Mario move.

I never did this in Flash, but it's pretty much the same for Java, where I have written small multiplayer games.

Some more advice: don't start off expecting to write the best game ever.
Start with small minigames. Later, you can use the code, and everything you've learned to create better and bigger games.
LVL 13

Assisted Solution

AngryBinary earned 332 total points
ID: 18066183
I've done multi-user flash apps with both Java and C++ server... PHP might be a bit too slow for anything being done in real time. AquaServer is an open source java server designed for use with flash clients that configures pretty easily right out of the "box". I'm not sure if this has been fixed or not, but there was some issues with non-threadsafe operations during client logon.

Of course, the easiest solution, if you're already comfortable in ActionScript, would be to look into Adobe Breeze. I don't know what it costs, so that might be a deal-breaker right there for you, but it's designed specifically for multi-user applications (games falls nicely into that category). After viewing the developer version (they released a version that allows you to simulate a multi-user session by running multiple flash instances running on the same box, to make it more available to programmers), I'd estimate it cuts out 95% of the coding drudgery and lets you work with the high-level concept of the game rather than the details of implementation.

Featured Post

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

See the related links at the bottom of the tutorial for downloads and supplemental information. Introduction The Nvidia 3D Vision Kit is a [not so] new gaming technology which allows you to play the newest computer games in "Stereo 3D" (like …
What is RenderMan: RenderMan is a not any particular piece of software. RenderMan is an industry standard, defining set of rules that any rendering software should use, to be RenderMan-compliant. Pixar's RenderMan is a flagship implementation of …
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question