okay... I'm pretty new to this stuff. I'm familiar with a few different languages but sever-client stuff I have no real experience with.
goal:
i have a "game" in actionscript ("AS" from now on). (There is no possibility of recoding in another language.) You create "messages" by setting a variable, which then "objects" base their motions on. It's multplayer in that two people at the same keyboard can play against each other. But I want it to be multiplayer online. It's a 2-player game.
so now the game is:
- player 1 sets a variable
- everything refers to that variable in its methods and so "responds" to the change
I want it to be:
- player 1 sets a variable and sends a message to player 2
- player 2 receives a message and sets a variable
- everything refers to that variable in its methods and so "responds" to the change
background info (if it's useful to you):
i've got cheap webhosting... like the cheapest. This is not intended for a large number of people. I want to use it for a site for people to pair up at, but I'm thinking I will have to make a "members" feature with usernames for the site, so somehow I will have to send clients' usernames on on the site as well as the messages from the client-side instance of the AS game. I use drupal (or try to) and would pull user names from this somehow. But the idea is to have people pair up on the site, then one of the pair would host and it would go peer-to-peer via udp (i think this is what I want based on a LITTLE preliminary reading I've done). So, the idea is:
- clients both have the same code/game (either could be host)
- both connect to the same "server" from within the AS game (which can tell clients which other clients are also connected)
- somehow, the clients can pair up, either by requesting a random partner, or by requesting a user by their username
- clients send messages to one another, and these get into their AS runtime.
what I need help with:
how do I set up a "server" for the AS clients to pair up at?
how do I get it so players can use this server from within the AS game?
how do I get the AS clients to message each other once they get the info they receive from the server through "pairing up" (I guess using UDP)?
another question, sort of separate from the others: if I were to put the variables on the cheap hosting server and have the clients message the server then the server message the clients with the new value of the variable, would the cheap hosting be up to doing this well/in a "real-time" way? (It would be handling a most a few 2-player games, small number of variables per game but getting passed regularly and possibility concurrently.)
Thanks for reading and for responding (if you choose to).