🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Can I make Websocket multiplayer games for any genre ?.

Started by
2 comments, last by Tom Sloper 3 years, 3 months ago

Hello,

I'm guessing the answer to this question depends on the game. As far I've read so far (and I might be wrong): Websockets behave similar to TCP. Which means some packets are held back and sent later in specific situations.

UDP on the other hand sends all packets without holding any, at the expense of losing some of them. I've also noticed that most developers seem to recommend using UDP at all cost, and that UDP is not available for web.

If my understanding is correct, what kind of games can I reliably make with Websockets? Is the performance of websockets too bad for fps, rts, or real-time rpg games?

thanks

alexsunny

Advertisement

It is POSSIBLE to write a FPS game over TCP (which is what websockets ends up going over,) but that game will likely see more control lag than one over UDP, because of head-of-line blocking. You may be able to work around this by opening two separate websocket connections, and ping-pong messages between them, so when one gets held up, the other one might still flow, leading to what effectively looks like “50% packet drop” – and once the late connection catches up, you'd discard the late packets, just like you'd do for UDP. You of course have to hope that the underlying browser and server infrastructure don't decide to bundle both connections into the same TCP session, which may or may not happen based on implementation choices.

For what it's worth, big MMORPG games have used TCP, including World of Warcraft. RTS games also typically use TCP, including the Starcraft and Age of Empires series.

enum Bool { True, False, FileNotFound };

@alexsunny123 , you asked the identical question 2 years ago.

https://www.gamedev.net/forums/topic/701168-can-i-make-websocket-multiplayer-games-for-any-genre/

What is your deal??? Thread locked.

-- Tom Sloper -- sloperama.com

This topic is closed to new replies.

Advertisement