Live data from Hacker News

Show HN: Server-rendered multiplayer games with Lua (no client code)

cleoselene.com

21–30 of 62 posts

Re: Show HN: Server-rendered multiplayer games with Lua (no client code)

#21

"We stream drawing primitives instead of heavy pixels or complex state objects." This is cool ... but I suspect just pushing video frames like Stadia etc did is just as efficient these days and a lot less complicated to implement and no special client really needed. Decent compression, and hardware decode on almost every machine, hardware encode possible on the server side, and excellent browser support.

On the other hand, you could take a list of primitives from, say, the JS Canvas API, come up with a format that can encode all of them and use that as your protocol. Bam, with that you get one client for any game that uses JS Canvas.

That's exactly my approach! I'm sending canvas commands instead of pixels, which makes things faster

That said.. I don't think stadia could do that since it's not opinionated about the game engine. Unless they go really deep on the graphics card instructions instead, but then it becomes comparable to pixel rendering I guess

Re: Show HN: Server-rendered multiplayer games with Lua (no client code)

#25

Since you're doing this is rust, try experimenting to see what would happen if you did zstd compression using a dictionary on the data you're sending back and forth, it might give you a performance benefit.

I will definitely try it!

I'm using Gzip since it comes with all browsers hence a easy approach

That said, I will find som zstd decompressor for js/wasm and try!

edit:

I just added and the difference was huge! Thank you!

Re: Show HN: Server-rendered multiplayer games with Lua (no client code)

#26
post #22

Cheating with AI will be possible even with server side rendering ; nvidia has released models able to learn to play - it's going to be very difficult to detect whether it's an AI or a human ; very impressive however

That’s a very different kind of cheating though. The kind of cheating this effectively makes impossible is cheating where a player has more information than they’re intended to have.

If someone makes an AI that plays the game as a good player, then it’s effectively indistinguishable from a real player who is good. If they make it super-humanly good, then it would probably be detectable anyway.

It’s still fair in the sense that all players have the same (intended) information per the game rules.

Re: Show HN: Server-rendered multiplayer games with Lua (no client code)

#27
The latency is a little intense from Australia … but surprisingly not as bad as I thought it would be.

It was playable.

I wonder if you can use speculative execution to play the game a few frames ahead and then the client picks what to display based on user input, or something like that.

Each frame is 16ms, so you’d have to work ahead 6 frames to conquer the nominal latency of around 100ms, which may actually be 200ms round trip.

(In that case, something like Haskell would be a good candidate to build a DSL to build the decision tree to send to the JS client…)

Re: Show HN: Server-rendered multiplayer games with Lua (no client code)

#29

The latency is a little intense from Australia … but surprisingly not as bad as I thought it would be. It was playable. I wonder if you can use speculative execution to play the game a few frames ahead and then the client picks what to display based on user input, or something like that. Each frame is 16ms, so you’d have to work ahead 6 frames to conquer the nominal latency of around 100ms, which may actually be 200m…

It could help visually but you'll still have 200ms between you and your next door neighbor's actions
Post reply on HN