Live data from Hacker News

What happens when you make a move in lichess.org?

davidreis.me

91–100 of 162 posts

Re: What happens when you make a move in lichess.org?

#91

And scalachess is written in scala, to piggyback off a post earlier this month that claimed the language is dead. The project is very successful and has been around and maintained for years.

If all the Rust people knew how nice Scala 3 as a language is... they would be surprised.

What still isn't great is the ecosystem and the build-tooling compared to Rust (part of it because of the JVM). But just language-wise, it basically has all the goodies of Rust and much more. Ofc. it's easier for Scala to have that because it does not have to balance against zero-overhead abstraction like Rust does.

Still, Scala was hyped at some point (and I find it wasn't justified). But now, the language is actually one if not the best of very-high-level-languages that is used in production and not just academic. It's kind of sad to see, that it does not receive more traction, but it does not have the marketing budget of, say, golang.

Re: What happens when you make a move in lichess.org?

#92
post #12

Earlier quoted context omitted.

What? Do you have some reason to think Netflix's architecture is deficient?

Overly complicated with microservices. Can be made 10x simpler.

You know something about their internal architecture and why it was built that way and the tradeoffs involved, I guess?

Re: What happens when you make a move in lichess.org?

#93

I wish this discussed the timing arbitration of each move. Based on the packet information (if that is correct & complete) then the timing is done entirely on the clients. However, they show the time in seconds which can't be right so I am curious how accurate this packet schema is (or if those are float values). Regardless, one thing I find maddening about chess.com is the time architecture of the game. I haven't se…

What I'd love is for my pre-moves to be sent to the server immediately so I don't time out when I pre-moved.

What's interesting about this is chess.com allows you to stack as many pre-moves as you like but they each cost 0.1s, whereas on lichess you can only have one pre-move which is technically free but maybe not because of delay.

Re: What happens when you make a move in lichess.org?

#94
post #56

Earlier quoted context omitted.

Vladimir Kramnik agrees with your observations about chesscom.

I'm surprised to see anyone bring him up here!

You're surprised that Kramnik is mentioned when the discussion topic is related to chess? I don't understand why. He's well-known in chess (and in chess memeland).

Re: What happens when you make a move in lichess.org?

#95
It seems shocking to me that the server enumerates and transmits all legal next-moves. I get that there could be chess variants with server side information, but the article also says it might be good for constrained clients. Is it really cheaper to read moves off a serialized interface than to compute them client side??

Re: What happens when you make a move in lichess.org?

#96
post #60

I wish this discussed the timing arbitration of each move. Based on the packet information (if that is correct & complete) then the timing is done entirely on the clients. However, they show the time in seconds which can't be right so I am curious how accurate this packet schema is (or if those are float values). Regardless, one thing I find maddening about chess.com is the time architecture of the game. I haven't se…

> it feels like the SERVER is tracking the time TBH this is what I expected for all online chess. How else to reconcile the two players' differing clocks and also prevent client-side cheating?

Netcode dev here. Predicting the clock is a trivially solved problem. The client and server know the latency between each other, the server can offset the timestamp on the input from the client to compensate for this difference, and the client can offset it's rendering of the clock data from the server. The same techniques used in regular online gaming would apply here. The only X factor here is the impact of the client lieing about its latency to the server, perhaps that could have an impact, not sure.

Re: What happens when you make a move in lichess.org?

#97

Earlier quoted context omitted.

Good for you. Now please aim 10,000 requests a second at your file server.

Because I don't use microservices, I don't need 10,000 requests a second to play a video file.

I think the point was 10,000 files on 10,000 different hosts, per second.

Re: What happens when you make a move in lichess.org?

#98

I wish this discussed the timing arbitration of each move. Based on the packet information (if that is correct & complete) then the timing is done entirely on the clients. However, they show the time in seconds which can't be right so I am curious how accurate this packet schema is (or if those are float values). Regardless, one thing I find maddening about chess.com is the time architecture of the game. I haven't se…

What I'd love is for my pre-moves to be sent to the server immediately so I don't time out when I pre-moved.

The worst part is they call it an intentional choice. "First off, premoves take 0.1 seconds. That is what has been preferred and agreed upon by most professional players we have consulted on the topic. They prefer .1 to .0 for premove. This is also what other chess servers do."[1]

It's super annoying and the reason I only play blitz+ on chesscom.

[1]https://www.chess.com/forum/view/help-support/mate-in-one-qu...

Re: What happens when you make a move in lichess.org?

#99
post #60

Earlier quoted context omitted.

> it feels like the SERVER is tracking the time TBH this is what I expected for all online chess. How else to reconcile the two players' differing clocks and also prevent client-side cheating?

Netcode dev here. Predicting the clock is a trivially solved problem. The client and server know the latency between each other, the server can offset the timestamp on the input from the client to compensate for this difference, and the client can offset it's rendering of the clock data from the server. The same techniques used in regular online gaming would apply here. The only X factor here is the impact of the cli…

> The only X factor here is the impact of the client lieing about its latency to the server, perhaps that could have an impact, not sure.

on lichess it does have an impact. lichess has a thing they call lag compensation where the server can add time to a player's clock after the server receives their move.

The goal is to make it fair for someone with high lag playing someone with low lag.

I don't know the exact cheating method used. I'll have a guess, though. What if someone spent a few seconds looking at the board before making their move, and then adding (edit: oops, subtracting) a few seconds to their clock in their response packet. The server would see the client made their move instantly based on the time in the response packet, but it took a few seconds for the server to receive the packet. i.e. lag. So it might add time to compensate for the perceived lag.

Lag compensation cheating is a frequent topic on the lichess forums.

Re: What happens when you make a move in lichess.org?

#100
post #37

So essentially lichess chose StackOverflow approach - (rather) beefy servers, instead of "treating them like a cattle". Interesting that they accumulate and periodically store game state. Unfortunately it is not very clear, where they store ongoing game state - in redis or on server itself. Also cost breakdown doesn't have server for redis, only for DB. BTW, their github has better architectural picture, than overly…

roughtly 3600 games per dollar? I have over 30k games... Time to pay up
Post reply on HN