Hacker News new | ask | show | jobs
by lifthrasiir 1682 days ago
Based on my experience [1], you would definitely run into a situation where users would inadvertently hinder others and that feels really annoying. We have tried to solve this issue by introducing two major concepts:

- The corner slots that would fixate the final image. This also makes easier to move crowded pieces around. Note that edge pieces are not constrained (unlike, say, jigsawpuzzles.io mentioned above) because that would make guesswork easier.

- Any cursor can pick and hold a group of pieces only for a certain amount of time. The timer was designed so that doesn't reset and instead runs backwards when you are not holding pieces, and you can't pick new pieces when the timer hasn't passed some threshold.

Also synchronizing all the things would be very interesting if you haven't done that so far :-) We specifically used a combination of lag compensation and opportunistic state merger, but there are a lot of other valid strategies you can try.

[1] https://news.ycombinator.com/item?id=29218867

1 comments

Good points! With my websocket test I'm currently experimenting with syncing micro actions rather than syncing the full puzzle state every time a user makes a move. For lag compensation I'm likely just going to lerp the mouse/piece position movements to make them appear smooth, but I'll see how well that works out.