Comments (9)
One thing to consider: It might not always be possible to create the subjective game state by all moves that are shared with a user.
Example variant, like Baduk but:
- Players only see their own moves
- If they try to make an illegal move, they are prevented to make that move and may make a different move
- Players are told, how many stones they have captured at any given moment
from govariants.
I agree with the fact that it is nice to have the game object in the client. That said, I want to address this part specifically:
If we add all this to the exported game state, It might add a lot of complexity to the variants.
Passing nextToPlay
, gamePhase
etc. need not complicate variant implementations. We could also pass all these "common" attributes over the state API as well. The payload could look something like:
{
"variant_state": { "board": [...], captures: {...} }, // output of exportState()
"next_to_play": [0],
"phase": "gameover",
"result": "B+R",
"round": 103,
}
That said, there are always multiple approaches to a problem. Is there a solution to "hidden information gets leaked via the API" that you see as preferable?
from govariants.
I'm thinking on working on this next.
Wonderful! Many thanks in advance
With respect to the move navigation, that would mean that traversing through the move history, each round requires one network request. Just to make sure, are we (still) ok with that?
I'm okay with that. Fixing this is higher priority than network optimization IMO
I do have some ideas on the network optimization if/when we want to approach that though
from govariants.
Can probably be done at the same time as #7
from govariants.
My concern with this is the following. Currently the game view creates a whole game object, using all moves. That gives us a lot of flexibility; We can use the method nextToPlay, the gamePhase and result, the round method, etc.
One could argue that these things are (strictly speaking) part of what defines the game state. But currently we don't handle it that way. If we add all this to the exported game state, It might add a lot of complexity to the variants. And the api endpoint would be called a lot (e.g. when navigating through the moves).
from govariants.
I haven't worked out the details, but an alternative might be to allow variants to modify the move sequence before it is sent to clients.
Parallel move variants could remove the staged moves (except yours),
Hidden move variants could obfuscate moves
However, I'm not sure if its preferable. This approach might give us less flexibility that your proposal does.
from govariants.
Yeah, you two convinced me. I'm on board with this π
from govariants.
Marking this high priority as there are other related issues (#266, #174), and the cost of this tech debt grows quickly as other features are start to depend on the full game object existing client-side (#168, #214)
from govariants.
I'm thinking on working on this next. I'm thinking of adding a server side endpoint like "get_game_state(gameId, round)"
With respect to the move navigation, that would mean that traversing through the move history, each round requires one network request. Just to make sure, are we (still) ok with that?
I believe there are alternatives that would optimize the data traffic etc. better, but 1.) would be a lot of work and 2.) probably add a lot of complexity to variants (especially hidden information variants).
from govariants.
Related Issues (20)
- Server crashes on game request with wrong id
- Quantum Go HOT 5
- [Thue-Morse] Refinements HOT 1
- Take / Leave Seat can cause crash
- Loading Spinner
- ASLI
- hash password before login request HOT 3
- Display player colors or symbols
- Dimensions object
- Adding the following features for go/variants/quantum HOT 6
- Admin users and dashboard
- Migration strategy HOT 4
- Duplicate move on game HOT 1
- Timeout bugs in parallel variant HOT 7
- Display komi and other "invisible" configs HOT 1
- Sequential Fractional Baduk
- Overlapping Layout in game page for variant quantum HOT 3
- Config Not Editable for Variants without a Config Form HOT 1
- Graph expects intersection IDs to equal their index HOT 7
- [optimization] do not re-render board every move HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from govariants.