4 ms·
> 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 a
by pshc 2y ago
> 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?
- MichaelZuo 2y agoIt hasn’t been done client side in any pvp game I’ve heard of.
- stevage 2y agoI'm pretty sure freechess.org did.
- MichaelZuo 2y agoHow is it being done client side?
- stevage 2y agoWell it's a long time since I played there. But it had custom chess clients, which I assume just recorded how much time your move actually took and sent that with the move. Yes, it's easy to cheat with this, but it's very easy to cheat with chess anyway.
- 4star3star 2y agoThis makes the most sense. Start a timer when the UI actually hands control to the player whose move it is, stop the timer when they've completed their move, and simply subtract that from their remaining time. The interval gets sent to the server and relayed to the other player to update their opponent's clock accurately.
- compiler-guy 2y agoFreechess shipped a binary called “timeseal” that did the calculations for you and encrypted the communications. It was not foolproof—-not by a long shot, but it also didn’t completely suck. You can read about what became timeseal here. https://eprint.iacr.org/2004/203.pdf https://eprint.iacr.org/2004/203.pdf
- bongodongobob 2y agoTrack the two clients pings? What client side cheating prevention would you need to do in chess? Afaik you can't cheat by clipping through walls or jumping around on the map.
- connicpu 2y agoThe client side cheating would by lying about when you received the packet in order to give yourself more time to think. Even if you only shifted it by 200ms per move, that could add up to a lot over the course of a long game.
- kaoD 2y agoTo give additional context: bullet chess can go down to 1 minute per player. Lying about a few millisecond per move there is huge.
- HDThoreaun 2y agoCheat by giving yourself more time
- MobileVet 2y agoI guess my naive frustration comes from crazy fps games tracking things so precisely and yet somehow Chess.com can’t handle a turn based game?! Honestly. I do recognize that fps games utilize predictive algorithms and planning to estimate future player positions but still, turn based networking with 100ms accuracy should be a solved problem
- pshc 2y agoYeah honestly I agree like it would be nice if they switched to WebRTC or UDP.
- palata 2y agoSo you need to send a few bytes of information every few seconds, but you want to spam the network with UDP packets containing those few bytes?
- lomase 2y agoEvery single online multiplayer game that cares about latency reimplements a subset of HTTP over UDP.
- WJW 2y agoHuh, that's not what I would expect at all. If you are having custom network protocols anyway, why deal with all the overhead that even a subset of HTTP brings? You might as well make an entirely new protocol at that point.
- lomase 2y agoIs TCP. Why everybody does it you ask?
- gs17 2y ago>reimplements a subset of HTTP over UDP. TCP, although I like to imagine FPS games where shooting someone sends "DELETE /players/n00b HTTP/1.1" to the server.
- nightowl_games 2y agoNetcode 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.
- crashbunny 2y ago> 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.
- palata 2y ago> How else to reconcile the two players' differing clocks and also prevent client-side cheating? Is there a point in preventing cheating, really? I can just make a bot...