Live data from Hacker News

High-Throughput Game Message Server with Python WebSockets

mortoray.com

11–20 of 61 posts

Re: High-Throughput Game Message Server with Python WebSockets

#12
post #8

Author contemplating an eventual C++ rewrite, but this is a perfect use case for Rust. When you want performance and where memory mistakes can be a serious security problem.

Or F#/C#. Rust will have memory fragmentation over time.

Previous discussion on this https://news.ycombinator.com/item?id=18190573

Re: High-Throughput Game Message Server with Python WebSockets

#14

Earlier quoted context omitted.

Ah yes, C, well known for its memory safety!

As with any tool, if you don't use it properly it can hurt you.

That's quite a ridiculous statement in this context. Even highly-trained, extremely smart developers are proven to not be able to use C without introducing gaping security holes. That's not "it can hurt you". That's "it hurts you and everyone that is exposed to your RCE machine".

Re: High-Throughput Game Message Server with Python WebSockets

#16
post #8

Author contemplating an eventual C++ rewrite, but this is a perfect use case for Rust. When you want performance and where memory mistakes can be a serious security problem.

Or F#/C#. Rust will have memory fragmentation over time.

Memory fragmentation is generally a problem for pets, not cattle. In 90% of use cases it’s nothing that frequently reaping processes won’t fix. This works regardless of language, as it pushes the job of garbage collection onto the os. Another nice feature of treating your processes like dirt is that you tend to get high fault tolerance and scalability as emergent properties.

Re: High-Throughput Game Message Server with Python WebSockets

#17
Might as well plug the game server I wrote over the summer. It's a python UDP server that I was able to scale to over 100 concurrent users based on various sources, but mostly the Gaffer On Games blog.

I chose python because I wanted game development to be fun. Ultimately, I couldn't find an existing python framework for multiplayer games that scaled well to my needs.

[1] https://pypi.org/project/mpgameserver/

Re: High-Throughput Game Message Server with Python WebSockets

#18
Quesrions for people familiar with the industry: my understanding is that UDP is optimal for fast-pased games, you don't have to wait for re-sends of old packets, etc.

However, it seems you can't just flick a switch and get encrypted connection like you can with TLS.

So what do people normally use? Does everyone do a custom AES-packet or something?

Re: High-Throughput Game Message Server with Python WebSockets

#19

Quesrions for people familiar with the industry: my understanding is that UDP is optimal for fast-pased games, you don't have to wait for re-sends of old packets, etc. However, it seems you can't just flick a switch and get encrypted connection like you can with TLS. So what do people normally use? Does everyone do a custom AES-packet or something?

Some games encrypt them, but while I would normally never say this - there's nothing really to protect over the udp packets if it's just game state. And you want to keep the latency as low as possible for those packets.

You want to do everything else over tcp and encrypted.

Re: High-Throughput Game Message Server with Python WebSockets

#20

Quesrions for people familiar with the industry: my understanding is that UDP is optimal for fast-pased games, you don't have to wait for re-sends of old packets, etc. However, it seems you can't just flick a switch and get encrypted connection like you can with TLS. So what do people normally use? Does everyone do a custom AES-packet or something?

Check out Valve's game network sockets layer, it addresses a lot of the things you're worried about

https://github.com/ValveSoftware/GameNetworkingSockets

Post reply on HN