#๐Ÿ”’ Golden Gems for learning (videogame) networking with WebSocket and Asyncio?

14 messages ยท Page 1 of 1 (latest)

hot willow
#

I'm trying to get an understanding for how to configure a backend of an online videogame (arcade-module).
Asyncio is relatively tangible for me, I think I just need to play around with some test examples to see what the module can do.
But I'm having a harder time reasoning around WebSockets and how to combine the two.
Most tutorials start off fine, but suddenly jump "...Now I'm going to paste this pre-written code" - and you've successfully lost me.
So now I'm looking for any golden gems to help me achieve this, your help finding these would be very appreciated!

twilit lionBOT
#

@hot willow

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

storm marten
#

i would start by devising a protocol between the server and the clients

#

the way you send data to your clients is a web socket

royal yoke
#

you use websockets with asyncio by using a websocket library that supports asyncio

#

like websockets

#

!pypi websockets

twilit lionBOT
#

An implementation of the WebSocket Protocol (RFC 6455 & 7692)

Released on <t:1724878414:D>.

dusk flicker
#

Will the game and the back-end be expected to communicate over the internet?

#

I dont recommend opening up your server to the internet with just webscokets. Just a warning to be careful when opening up anything to the internet. There are bots that search the web for common vulnerabilities.

stone quartz
#

You could use SSE instead of websockets. They're generally a bit better because they can be multiplexed over a single http2 or http3 connection

hot willow
twilit lionBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.