rbtying / shengji Goto Github PK
View Code? Open in Web Editor NEWAn online version of shengji (a.k.a. tractor) and zhaopengyou (a.k.a. Finding Friends)
Home Page: https://robertying.com/shengji/
License: MIT License
An online version of shengji (a.k.a. tractor) and zhaopengyou (a.k.a. Finding Friends)
Home Page: https://robertying.com/shengji/
License: MIT License
title
For the more hardcore players :)
Since there is ambiguity in trick-format interpretation for throws, we should show the trick groupings after we've identified the trick format, so as to not surprise people about their legality.
The fastest way to do this is probably to use trick.units
in the frontend for the leading trick, and then use played_cards
for the remainder. This is kind of ugly from the data model point of view, so we could also make played_cards
either a Vec<Card>
or a Vec<TrickUnit>
, depending on whether the play matches the format.
Love this game! Would be very interested in learning rust and contributing! ๐ฏ
May be this is a corer case.
https://robertying.com/shengji/stats:
{"num_games_created":4,"num_active_games":1,"num_players_online_now":4,"sha":"ae9e896131daf4fc3b9a25ff7a682dffb0600f25"}
"(...)" - cards left in hand (probably does not matter)
P1: 9 9 10 10 K (3 4 4 5 7 7)
P2: 3 3 5 5 7 (8 J Q)
P3: 3 5 10 J Q (6 8 8 8) <- This considered illegal
P4: 6 6 6 x x (no card in same suit left in hand) <- Only have 3 cards in the same suit
Our group found some joy in spamming beeps, but it should probably be throttled a tad (doesn't currently seem to be any limit). I'm not too familiar with React, but seems like there's a few decently easy ways to unmount the beeper for a second or two.
Related bug: sending too many beeps too quickly seems to cause the beep sender in question to need to refresh the page in order to play their next hand.
If nobody bids a trump, allow cards from the kitty to be revealed and bid instead.
Two variants:
Revealing cards from the kitty prevents players from making bids themselves.
Allow players to mark themselves as "suspended", so they act as observers until they come back
For game #2d3e38799f8d7e2d, the game refreshes and fails to load for the leader once cards are picked up. This was a 9 player game.
Console shows:
Error: Invalid card string: undefined
at main.js:60
at kr (main.js:60)
at Qa (main.js:39)
at vl (main.js:39)
at su (main.js:39)
at lu (main.js:39)
at Zl (main.js:39)
at main.js:39
at t.unstable_runWithPriority (main.js:47)
at Wo (main.js:39)
el @ main.js:39
Once Landlord has taken the kitty and set it down, other players in turn order may over-declare aka over-flip to a new trump suit, following standard over-flipping rules, to both change the trump suit and access the kitty. Exception: if you were the one whose declaration is the currently active, you may not over-flip your own declaration.
If over-flipping doesn't occur, the game immediately starts as normal.
If over-flipping occurs, after the kitty is set back down again, all of the players besides the over-flipper, including the landlord, may yet again over-flip, following the same rules, in turn order starting from after the over-flipper. And so on.
So this is possible:
Issues to resolve:
When autodraw is on (the default), making bids involves a minigame of trying to hunt down the card to bid before clicking "make bid". This is not desired behavior. Here are two ideas I had for how to fix this:
Move the trump cards to the left. This doesn't completely fix the moving target issue but it does cut it down by a factor of ~10. Probably the easiest to engineer.
Have a row of five buttons in fixed positions (representing the four suits and NT. Maybe six if you want to separate NT into small Jokers and big Jokers) that are only activated when you can make that bid. In terms of bid quantity, probably the simplest solution is just that the buttons represent the lowest valid bid quantity; if you want to bid two cards on a previously un-bid round in a row you can simply double click.
In addition to improving clarity when it's NT (I've had multiple instances where I thought hearts was trump when it was actually no trump), it would probably be good for beginners.
For example, say there are two players in a game โ let's call them Lincoln and Alex. If Lincoln wants to play a 5-card combo such as AKKQQ in a suit, and Alex only has four cards, it forces Lincoln to play the KKQQ, even though AKKQQ is a legit play. Then, when Lincoln plays the A, Alex can trump it and take control, much earlier than he should have been able to.
Note in our scenario, there was another player who has a pair AA in that suit as well, so that might have contributed to the bug.
Prevents players from exploiting it to test throws. Since you can queue up a play anyways, this feature isn't necessary imo.
Allow the trick to be started, but don't let the next player play -- we can still rely on out-of-band enforcement of the invalid throw
When you create a game, you could mark the room as "public", so that it shows up on a listing prior to joining the room.
Apparently it is prefixed with webkit
It seems like the websocket connection will occasionally die for unknown reasons, without updating the client state to show that the connection has died.
We can probably detect this, because every websocket message is shortly followed by a state update from the server -- setting a few hundred millisecond timeout before alerting the user is probably sufficient
Chat currently gives away name of player who has a higher card than a given throw.
Chat shows:
<Player 1> tried to throw ๐๐๐, but <Player 2> can beat it.
Chat should show:
<Player 1> tried to throw ๐๐๐, but someone else can beat it.
Thanks again for creating this game ๐ฏ
Number of Friends
GAME: <Name> set the game mode to Finding Friends
GAME: <Name> set the game mode to Finding Friends
For example:
C should win the trick, but B wins instead
On an optional basis, we should allow games to run with explicit throw penalties.
This will require the following:
Since there is currently no general state machine for throw mechanics (it's all done via the take-back mechanism), the fastest-path-to-happiness here is probably for there to be a way for players to specify point penalties, independent of the actual throw.
Add aggregators which sum up the points for the two teams
apparently, correlated with the winner changing more than one seat away?
Right now, nothing happens when you win, and the level is capped at A.
It should probably be capped at NT, and there should be some indication of winning
All I did was install Rust, git clone
the shengji project, then run cargo run
on my MacBook (Mojave 10.14.6). Looks like frontend/dist doesn't exist.
error: couldn't read backend/src/../../frontend/dist/main.js: No such file or directory (os error 2)
--> backend/src/main.rs:581:19
|
581 | static JS: &str = include_str!("../../frontend/dist/main.js");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: couldn't read backend/src/../../frontend/dist/main.js.map: No such file or directory (os error 2)
--> backend/src/main.rs:583:23
|
583 | static JS_MAP: &str = include_str!("../../frontend/dist/main.js.map");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 2 previous errors
error: could not compile shengji
.
If you join a game while a game is ongoing, you can just open a new tab and join as an existing player's username to see their cards and play moves for them
It's not complete yet!
suggestion: if the backend can return structured data message like
{
type: 'play',
player: PlayerID,
cards: Array[Card],
}
we could render in the chat more detailed information, like
When playing cards, allow people the option to check a box and enqueue the play (and then uncheck the box once it has been played)
Find a way to handle the UI when the screen is small -- perhaps make the cards smaller?
Would be nice to have an option to configure whether or not pairs draw out triples.
e.g.:
Say we're playing 4's. If someone flips two 4 of spades, anyone can flip two 4 of diamonds or two 4 of clubs, etc. The first flip should block out the rest?
We can probably re-use beep-on-turn functionality for this. It would likely be defined as a specific message type which can only be sent to the player whose turn it is.
The beep functionality only beeps once.
Also, consider a unique beep-tone per person, in case of Zoom relaying the beep noise
This allows more alternative reinforcement strategies
Apparently Pragmata Pro has half-width card unicode
Have a game option where a player is not forced to play a "higher" play, even if a sub-component of that play matches the trick-format.
e.g.
Open questions: how to generalize to N decks; do pairs draw out tractors, etc.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.