a networked Flash game
I'm not sure how many of you here actually use flash, so let me tell you what its limitations are when it comes to games & networking - its not optimized for math operations - it only allows for tcp sockets I've managed to create a flash client that communicates with the server & synchronizes all of the players' states smoothly (but the sim. isn't running on the server) so i'm trying to create a twitch game with flash, but I'm not completely sure about a few things. - everywhere I've looked, people say you should simulate the game on the server...but if i run, for example, more than 3-4 instances of a flash game on a server it'll be extremely slow (in actual games, is there only one game per server or a lot more?) If i run a c++ copy of the flash game on the server and have flash clients it'd be a lot faster but I'm not sure how similar the outputs will be - using my current system, where everytime the user pressed a key, it sends the server its pos,vel,accel,etc. and the server sends that to everyone else with the change's time, how would i handle non-user-controlled objects & dynamic object-dynamic object collisions? thank you for any help Oz
Flash is, as you say yourself, not the ideal solution for a networked twitch game :-)
The reason you want to run the simulation on the server is to avoid cheating. If that's a risk you want to take, having the server just echo to everyone else is a workable solution, and it reduces the load on the server.
For 2-32 player games, one of the players typically "host" the server, and the other players get hooked up to that server through a matchmaker/lobby system. The hosting machine tyipcally runs two copies of the game; one for the server, one for the local client (unless it's a dedicated server, in which case it runs only one).
For games with more players, typically you get a server cluster, and a sectored/zoned design for scalability -- that's why MMOs need to charge money if they are large; nobody can host that in their closet.
For your game: If you need to put up a server, it would likely be of the matchmaking/lobby kind, and players would then choose to host games on their machines.
The reason you want to run the simulation on the server is to avoid cheating. If that's a risk you want to take, having the server just echo to everyone else is a workable solution, and it reduces the load on the server.
For 2-32 player games, one of the players typically "host" the server, and the other players get hooked up to that server through a matchmaker/lobby system. The hosting machine tyipcally runs two copies of the game; one for the server, one for the local client (unless it's a dedicated server, in which case it runs only one).
For games with more players, typically you get a server cluster, and a sectored/zoned design for scalability -- that's why MMOs need to charge money if they are large; nobody can host that in their closet.
For your game: If you need to put up a server, it would likely be of the matchmaking/lobby kind, and players would then choose to host games on their machines.
enum Bool { True, False, FileNotFound };
thanx that cleared up a few things
If I have one client as a host, wouldn't the data transmition be slower?
because right now the client sends their data to the server who sends the data to all other clients.
If the host is another client, the data would go to the server, then the host, then back to the server, and then to everyone else
I'm not exactly sure how a flash client can be the (server) host since flash cannot bind itself to a port
any tips?
also,
I don't really mind cheating (at least at this stage)
If I have one client as a host, wouldn't the data transmition be slower?
because right now the client sends their data to the server who sends the data to all other clients.
If the host is another client, the data would go to the server, then the host, then back to the server, and then to everyone else
I'm not exactly sure how a flash client can be the (server) host since flash cannot bind itself to a port
any tips?
also,
I don't really mind cheating (at least at this stage)
If flash can't bind, then you're SOL, and have to use a separate server. And, in that case, your server will have to forward data for all games out there, which will likely start chewing through bandwidth if the game becomes at all popular :-(
enum Bool { True, False, FileNotFound };
Viktor: that would work well, only I'm trying to steer away from that option because I dont have many servers available (prob. 2 at the most) and I'd like to think that many ppl will want to play my game
I'm guessing that if i want a multiplayer games with flash i need a lot of servers...
but take a look at this game
http://www.xgenstudios.com/play/stickarena/
u dont have 2 sign up to play
for them, the game doesn't run on the server--it only shares the data between clients, and they only have 4 servers total
My system right now works like theirs, but I want a bit of physics (like player-player collisions) in my game and I'm not sure how that would work with a system like that
I'm guessing that if i want a multiplayer games with flash i need a lot of servers...
but take a look at this game
http://www.xgenstudios.com/play/stickarena/
u dont have 2 sign up to play
for them, the game doesn't run on the server--it only shares the data between clients, and they only have 4 servers total
My system right now works like theirs, but I want a bit of physics (like player-player collisions) in my game and I'm not sure how that would work with a system like that
I've actually thought about that as a possible solution, but wasn't sure how well it would work. do you know this method to be successfully used anywhere?
I'll give it a try as it seems most feasible
but... what if the client who serves as the server leaves? what if the client's machine is very slow, then everyone else's experience will be affected
also, I just read an interview with the creators of that flash game, and here are some of their stats:
on their 4 servers they hold 1.1 million registered users, and handle 3000 users at peak hours
they allow a max. ping of around 250 ms round-trip
I'll give it a try as it seems most feasible
but... what if the client who serves as the server leaves? what if the client's machine is very slow, then everyone else's experience will be affected
also, I just read an interview with the creators of that flash game, and here are some of their stats:
on their 4 servers they hold 1.1 million registered users, and handle 3000 users at peak hours
they allow a max. ping of around 250 ms round-trip
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement