kreibaum / pacosako

This code drives the pacoplay.com website where you can play Paco Ŝako.
http://pacoplay.com
MIT License
23 stars 3 forks source link

Determine legal moves in the webclient #81

Closed kreibaum closed 6 months ago

kreibaum commented 1 year ago

Use the work done in #68 to determine legal moves in the frontend. This will make the "dots" where you can place the piece appear a lot faster on slow connections.

I should add some "websocket delay" rocket config so I can properly simulate a bad connection.

kreibaum commented 1 year ago

I just played with some other passenger on a train and this one was really missing. So a solution might be brought to you soon courtesy of Deutsche Bahn.

kreibaum commented 6 months ago

I think this is really two requirements.

Just calculating valid moves in the client reduces network traffic a tiny bit, but the server still needs to acknowledge each action.

However, moving the legal moves into the Frontend makes it possible to optimistically skip the acknowledgement with a letter change.

This would save me from building the optimistic Frontend logic while already reaching into WASM - I can also use that for check warnings that Origami Man asked for.

I recently showed the game to some new players and understood how that would help them.

kreibaum commented 6 months ago

Since I was already optimistically showing the action as executed, it actually wasn't hard to also optimistically determine legal actions.

The behavior on re-connection still isn't great, but at least all the actions are actually retained and just replayed on re-connection.