oniskanen / webludo-server Goto Github PK
View Code? Open in Web Editor NEWA Phoenix backend for beer-Ludo
A Phoenix backend for beer-Ludo
When all players have agreed on a new raising round, there should be an announcement saying so.
Currently if a player closes the page, the rest of the players do not get any indication that they aren't playing
Maybe on refresh due to the react app updating?
Allowing players to choose different rules during game setup has been raised a few times now.
Some initial variants:
If one goes to https://webludo.katris.dev, writes a random string to the name of the game, and presses join, the player is directed to a page for a game that is non-existent. (see attached screen shot for the non-existing game)
A really minor issue, but might be confusing for some.
Some announcements would come logically only after the frontend has finished animations. Let's add a new delayed_animations
object under changes
whenever broadcasting a new game_updated
event.
Solution is to add a short (500ms?) debounce on the server side.
I don't if it even should it be possible at this point :)
But, moments ago tested playing with 3 players on the live site at https://webludo.katris.dev/.
After creating a new game, players were able to join the game. The first player started with only 3 players were present. They were able to start the game and get their first piece moving. But after their turn, it seemed like it became the missing 4th players turn. No present player got a chance to throw or move after that.
The fix here would be to store the chat messages on the server and update the client once it comes back online. To do this properly, we'll need end-to-end encryption for the messages so that we don't store them in a readable format
Current logic allows incrementing and decrementing a collective team penalty value. We should keep incrementing team penalty as is, but allow players individually to mark their own penalties done. Team remaining penalties can be calculated by # total team penalties - (sum # player penalties done) / team player count
Let's improve the random number generator distribution to more closely mirror the real life Pop-o-Matic. Two studies on the topic: https://kvantti.ayy.fi/archive/2013_3.pdf (p. 23) and http://statistition.com/?p=440
The actual probability distribution is most likely out of reach for this hobby project, but giving the same number at 1/13 - 1/9 probability, neighboring numbers at uniform 1/6 to slightly below 1/6 and the opposite number at 1/4 - 1/3 probability is probably "good enough".
We'll need to track the previous roll across game changes to support this, but that shouldn't be too tricky.
Trying to roll out of turn should give a penalty with a corresponding announcement
Miska had 3 ylintä maalipaikkaa, oli syöntiruudussa, tuli 6 ja korotusmahdollisuus, mutta painettiin roll mutta tuli vielä uusi roll
Currently any other player can call out a missed "Jag bor i Hembo" call after the move animation has started for the move. As per the regular rules, the player calling Hembo has time until the next roll to call it. In addition, there should be a short grace period for calling "Jag bor i Hembo" without a penalty even after someone calls a missed Hembo.
Multiple players should be able to join a single team. Initially we should target having the possibility to join a random team or join a pre-determined team.
On the frontend side, this will expand the pre-game selections quite a bit. Setting a name and clicking "Join" will enter you into the list of players, but without a set team. You will be able to toggle whether you wish to play or only spectate. You will be able to manually join a team # 1-4. The creator of the game will be shown as the host, with additional options. The host can choose to manually or randomly assign the players into teams. The game starts when the host clicks "Start game" (and there is at least one team set). When starting the game, the numbered teams are randomly assigned a team color and a random team is chosen as the starting team.
For the backend implementation, we need to split Player
into Player
and Team
. Team
contains 1..n
Players
. A Player
has a name and can roll for / choose to move pieces / choose to agree to a new raising round / mark penalties done. A Team
accumulates penalties and each Player
can mark penalties done, accumulating their personal finished penalties (which are summed and compared to the Team
penalties to see if the team has finished).
There's a potential pitfall with two or more players simultaneously finishing penalties summing up to more than the required amount. Allowing marking fractional penalties might help.
A Player
will be able to toggle whether or not they wish to participate in the game, which is recorded as a new database field.
This will allow building a frontend check when joining a game in the lobby. (Current flow navigates to the game page and shows a no game found error)
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.