Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Flash/Actionscript 2.0 halp?

Name: Anonymous 2010-09-05 10:51

So for over a year now, maybe more. I've been building up the basics for an AS2 based multiplayer game. My only problem is, the communications between my server and clients is way to slow. Right now, I'm using communicating between server(php) and client(AS2) like so:

client -- send variables to php page -- server tells php page to print XML -- client receives xml and parses this and makes use of it.

This all works somewhat okay, except I clearly can't use this method for realtime online gameplay. Could someone please tell me if there is a way flash (as2) can communicated faster with  a server, and what kind of server code language should I use?

I'm pretty good with php, which is what I'm using now. But php isn't fast enough. I have a limited knowledge of C++ and am pretty good with Visual Basic (lol).

Any help much appreciated.

Name: Anonymous 2010-09-05 11:44

>>2
If you want realtime multiplayer over the internet, you MUST:

1. Send data over UDP.  Please note that UDP is unreliable.  You can still use TCP connections (such as HTTP requests) for information that is not too time-sensitive.  If you ignore #1 and use TCP, you will see huge latency spikes from time to time, even on good connections.

Regarding ActionScript: http://stackoverflow.com/questions/907041/is-it-possible-to-use-udp-in-flash-actionscript

2. Allow different clients to see the world inconsistently.  Usually, clients display the predicted game state while they wait to receive the server's authoritative state.  Their predictions will necessarily be inaccurate.  If you ignore #2, you'll be forced to introduce extra latency between input and response, which may be fine if you're doing an RTS but it's definitely not okay for action games.

3. Design your game from the ground up to support multiplayer.  The architectural decisions necessary to support multiplayer are not trivial and cannot be tacked on at the end.

Have fun rewriting your game logic from scratch.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List