The Grand Multiplayer Thread
Well, you asked and you get.
I'll start with the basics and explain a bit.
There are two main ways of creating a multiplayer Flash game. All the ways require knowledge of another programming/scripting language (I'm not including the MM server, too expensive) and are not for beginners. Making a multiplayer game requires knowledge about a lot of different things, quite often you will need to know SQL (Structured Query Language) to store stuff in databases as well as your other language. Anyway, the two main ways to implement a multiplayer flash game are
Polling
This is the slower method, and not ideal for multiplayer games. This way, you create some server side scripts (in languages such as PHP, ASP, Perl, other CGI languages). Because of this, it is cheaper as most paid hosts allow some for of scripting.
This script must accept input in the form of variables in the query-string, like myscript.php?name=edmack&score=5 or via http POST (if you've made a form before you will understand this). The script must output plain text in the same form for flash to create variables from it. An example would be: score1=edmack&score2=Fred&score3=kim
Your flash script should do something along the lines of this to send your details, and add the variables it gets in response:
loadVariables("myscript.php?name="+myname+"&score= "+myscore+", this, GET);
This sends the variables
name = myname (var from flash)
score = myscore (var from flash)
Sockets
This is the fastest and best method. It requires that you have some sort of server sitting listening on some computer. This is usually a program of some kind, and typically requires more programming knowledge than the polling method. This can be acheived with Java, PHP (requires uncommon special settings), C, C++, Visual Basic, Python, Perl, and just about any other programming language.
The reason sockets are far superior to the polling method is that it is almost like a piece of tube is held on end by both sides, the client (Flash) and the server (whatever). At any time you can send text down this tube, and the server will know it's from you, and be able to quickly send stuff back. This is unlike the polling method, where you have to connect and disconnect to the HTTP server every time. An added advantage of the socket option is that the server will know when you disconnect, but with the HTTP option it will just have to pronounce you dead after X amount of seconds have passed.
I've included a simple example of a socket based game (it uses the free CommServer from a brilliant site www.moock.org . They offer an excelent server called Unity which is like the shell of a house, you just create the rooms... check it out if you know java).
http://www.koyote.dk/flash_files/move_ball_multi.zip
Feel free to post links, info or questions. I'll try to check in every now and again.
Connecting to you local machine from a domain.
If you own you own domain, then you prolly can do what im playing with. Its called a DNS pointer. It allows you to point a subdomain to a different ip then your normal webspace. Hey you could point it to your local machine even ;)
for example my game could be hosted at my webspace at xmcnuggetx.com, but i could have a dns pointer lets say (myserver.xmcnuggetx.com), and point it to my local machine.
Flash will allow a movie to connect to a subdomain, even if its a different ip =D *JOY*
Nugget
programming a vb socket server
http://www.winsockvb.com/article.php?article_id=18
Tutorial for excepting multiple connections using the winsock control. Wasnt specifically desinged for flash to connect to but it works =)
Nugget