Jump to content
  • Advertisement
Sign in to follow this  
Andrew2110

Multiplayer Asteroids Protocol Design

This topic is 3748 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!