Skip to main content
gamedev.net
🔒 Locked

Multiplayer Asteroids Protocol Design

Started by Andrew2110 Jul 13, 2008 at 11:42 AM 1 replies 1.5k views
Original Post
Andrew2110
Andrew2110
Hi Guys, I got started working with SmartFoxServer Pro (a Flash Socket Server) and now I've started to come up against some problems (not smartfoxservers fault, my lack of design skills fault)... I'm developing a multiplayer asteroids game and am having a lot of trouble keeping all clients sync'd properly. The basic idea at the moment for player movement and sending it to the server is the following - Having a gameloop that runs ~40 times a second - Every 10 frames, work out what keys user is pressing, work out how this effects ship speed and angle, x and y positions. Send what keys are being pressed, speed and angle and x and y position across the network. - Upon receiving object data from the server, find the ship that the object is relating too (each object has a unique playerID value) - Give the objects data to the appropriate space ship. - Now all ships (local and remotely controlled ships) have the same amount of data, speed, angle, what keys were last pressed for this ship, so perform time based movement for each of the ships. My most recent attempt can be found at: http://www.dukesbox.com/games/game22.php You can login using an username (or leaving blank), then click 'Join Free Play' and then select any ship. Use arrow keys to move. You might need two browser windows open to play yourself and see the glitchyness... I'm thinking that my thinking is just flawed for this, so I'm not sure on a good way forward... Many thanks in advance for any help anyone can offer.. I can post some code if that helps at all
hplus0603
hplus0603
You probably want to google for "extrapolation," or look in the Forum FAQ for that topic.
enum Bool { True, False, FileNotFound };
Andrew2110
Andrew2110
Thanks for the reply. It gave me a few ideas on how to fix my problem and now its all working amazing well.

Thanks again

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.