Flash Multiplayer Game

Posted on 2006-11-28
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 84 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 83 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 83 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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

For those of you searching for a fun but also medium paced MMORPG game I would highly suggest Ragnarok Online. This MMORPG is a bit older than World of Warcraft and in a way is extremely different. Compared to WoW's 3D environment and massive wor…
Artificial Intelligence comes in many forms, and for game developers, Path-Finding is an important ability for making an NPC (Non-Playable Character) maneuver through terrain.  A* is a particularly easy way to approach it.  I’ll start with the algor…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

691 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