Solved

Flash Multiplayer Game

Posted on 2006-11-28
6
21,501 Views
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
0
Comment
Question by:QuddusAli
  • 2
6 Comments
 
LVL 14

Accepted Solution

by:
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.

--trigger-happy
0
 
LVL 5

Assisted Solution

by:psyki_be
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.
0
 
LVL 5

Expert Comment

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

http://www.flashvista.com/details/item/585/

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.
0
 
LVL 13

Assisted Solution

by:AngryBinary
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.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
RTS game state, how is it optimally encoded in a Java byte[] ? 12 318
How do I hire a good copyright attorney? 3 129
Spell-checking 1 95
Any decent scenery blocks for my RTS 6 81
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 …
Author Cited: Konstantinos Dimopoulos URL Cited From: Article from Indie Games: http://indiegames.com/2012/07/browser_game_pick_the_grid.html The Grid (http://codeelf.com/games/grid/) is the sort of game I haven't played in over 10 years. It is …
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

910 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now