Giter VIP home page Giter VIP logo

seven-wonders's Introduction

Seven Wonders Online

Online Status GitHub license

A digital version of the 7 Wonders board game.

โš ๏ธ DISCLAIMER: We do not own the rights on the 7 Wonders game concept and rules, nor on the assets used here. This is a pet project, not intended to be sold.

Try it!

You can play it for free on http://seven-wonders.hildan.org.

๐Ÿšง The game is still under development. It is possible that you experience a server restart when new versions are released.

Self-hosted

The game is published as a Docker image on DockerHub.

If you have Docker installed, you can run the server on your own machine by running:

docker run -p 80:80 hildan/seven-wonders-server

And then go to http://localhost in your browser to play (add some bots if you're alone).

Technicalities

This project is written 100% in Kotlin. You can find the history of the technical decisions in the decisions history document.

This project uses websockets and STOMP for the communication between frontend and backend. For this, it uses the krossbow multiplatform library.

How does it look?

The game contains all the features of the actual board game:

  • Play cards, discard, or upgrade your wonder
  • Buy resources from your neighbours
  • Special bonuses: pick from discarded cards, play your last 2 cards, copy neighbour guild etc.

There are also some features you can only get online:

  • Add bots to play with you, even if you're less than the minimum 3 players
  • The game greys out the cards you can't afford and the actions you can't perform
  • You can see a preview of the cost of each action (play or upgrade)
  • Save time to compute the score!

Some screenshots:

Basic board Hover to see your hand
Basic board Hand hover

Preview your opponents' boards:

In front Left neighbour Right neighbour
Board preview 1 Board preview 2 Board preview 3

seven-wonders's People

Contributors

archangelx360 avatar bgstack15 avatar dependabot[bot] avatar gradle-update-robot avatar joffrey-bion avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

seven-wonders's Issues

Handle reconnection after closed tab

That will require caution regarding who can "reconnect" to a given user's session.
This might require authentication, or some means of identification (cookie?).

Support prev/next browser navigation

Navigating between routes is something that people naturally do.
We need to respect all possible states in all screens to accommodate for unexpected navigations, and also add better navigation within the application itself to get back to the "expected" route.

Example problems:

  • pressing the "back" button from the game browser to go to the homepage: it doesn't properly trigger the home saga and doesn't listen to the change name event anymore (see #114 and #116)
  • pressing the "back" button while in the lobby: ideally the game should handle this event as a "leave lobby" action, or at the very least the browser screen should respect this state and provide a button to get back to the lobby
  • pressing back from the game browser after leaving a game from the score board button. It currently brings us back to the score board, but the game is supposed to be deleted at that moment.

Allow to browse the boards at end of game

Currently the scoreboard is modal and doesn't allow to check out the other boards for a "debriefing".
This is usually a nice moment at the end of the game, we want to allow this!

UI to see rules / card chaining tree

As a simple informative tool, we could add a button to check the rules of the game.
At least displaying the card-chaining tree could be useful.

Wrong effect of "Bazar" and "Vineyard" cards

It looks like we don't get the expected gold when playing "bazar" (we should get 2 coins per grey card of each direct neighbour and on our own board). My latest test seems to show that only the cards from the right neighbour are taken into account. To be confirmed.

The bug seems to also occur with the equivalent card yielding coins for brown cards of neighbours and self ("Vineyard").

Feature request: Dont mix A and B sides

The option to either play

  1. Only A
  2. Only B
  3. Allow the player to choose which side to play
  4. Random, as it is right now
    would be nice.
    The default random choice could potentially lead to unbalanced games.
    Thanks in advance

Add UI indication for connection drop

We can't see errors in the UI, in particular connection drops.
It would be nice to add toasts with errors for all server errors, and maybe reset the redux state for missing heart beats indicating a connection drop.

Refactor frontend architecture

Right now, all files are separated by functionality (containers, components, redux, etc)

I suggest that we refactor to group files by functionality.
eg:

src/
  |-features/
    |-gameBrowser/
      |-GameBrowserContainer.js
      |-ducks.js
      |-sagas.js
      |-{specific components for game browser}.js
    |-...
  |-layout/
    |-LayoutComponent.js
  |-shared/
    |-...
  |-utils/

Make prepared move non modal

It is sometimes useful to look around and check other players' boards while waiting for other players to play.

Circular list for players in lobby

It'd be nice to display the players in the lobby in a circle representing the table. The way I see it is:

  • the current user is at the bottom in the center (each client sees from its point of view)
  • the host of the game can reorder players (with a randomize button for now)
  • each user receives reorder updates and the list animates accordingly

Add time limit

It is annoying if a player leaves or forgets to play for a while. We should add a time setting, and then start a timer when the hands are sent to the players.

If the limit is reached, we could, for instance, automatically discard the first card of each player that has not prepared his move yet.

Migrate to seamless-immutable

Using Immutable JS has proved to be a pain, especially because the cumbersome API is not contained in the reducers but leaks out in the React components. As far as accessing the data is concerned, I dislike not being able to do it the native way, well supported by IDEs. What's more, using strings in such accesses is not refactoring-friendly and it obscures the errors when we make typos.

Using .toJS() in each selector could seem to be a solution to avoid such accesses in React components, but given Alex Faunt's experience, it does not seem to be a good idea as it destroys performance.

Seamless Immutable seems to be our life savior, providing immutability with an equivalent mutation API, yet keeping native read accesses.
We should try to migrate, not forgetting to use redux-seamless-immutable for a compatible combineReducers() and routerReducer().

De-couple some sagas from routes

Some sagas being tied to routes is debatable. I reckon the only sagas we should keep bound to routes are the ones that listen to multi-clients web socket events.
For instance, the saga watching the list of games is coupled to the game browser route, which makes sense. If we were to keep this saga running all the time, we would be flooded with events even in times where we don't display the game list and don't care about it (like during a game or in the lobby), and we can't afford the extra processing (especially when the number of users grows).

On the other hand, sagas that listen to dispatched actions don't need to be coupled to routes.
For instance, the createGame saga sends messages on the socket when the REQUEST_CREATE_GAME action is dispatched. This saga does not need to be linked to the game browser route. If we're not on this route, then the REQUEST_CREATE_GAME action will never be dispatched and there will be no issue having the saga running (in a blocked state). If ever this action is dispatched outside of this route, then we'd better send that message to the server, because that would mean there is a new situation in which we want to send this action.

Allow owner to leave and/or disband the game

From the lobby, other players may leave the game but the owner cannot.
The server doesn't prevent the owner from leaving, but it brings the owner's client to a weird state (it doesn't get the update about the left game).
Also, there is no UI currently to do this.

We would need 2 main actions:

  1. owner leaves, making someone else the owner (and removing the game if the owner was alone)
  2. owner disbands, kicking everyone out of the game and removing the game

React redux toastr CSS not accessible in production

The CSS is referenced from an HTTP url, which is blocked for security reasons.
This file should in fact be embedded in the app rather than fetched from the internet all the time. This would also ensure reliability.

'Ready' button not indicating click action

The 'ready' button does not change colour/indicate you clicked it nor does the counter show how many people have clicked 'ready'.
This is cosmetic only. The game is still playable.

While on the subject: is it really necessary to click 'ready' after every playing action?

Font Issue in firefox

The fantasy font in Firefox 70.0 on Fedora is not displayed. Manually changing to e.g. arial helps... but I think it is some addon causing this, as others on firefox do not have this issue

Bug: Buying resources with Olympia B-side

When playing as Olympia B-side, upon building the first wonder stage (buy neighbouring resources for one gold), it becomes impossible to buy more than two resource units of the same type from the same neighbour, even though the neighbour has more than enough available and the player has enough gold.

Cant open new game

It is impossible to start a new game. Neither hitting enter nor clicking the "plus" button work (tested on FF on Linux, Chromium on Linux, FF on Mac, Safari)

Discarded cards pile sometimes overflows

The hand component is not suitable for showing a lot of cards, which happens sometimes when a player picks from the discarded pile. The cards go out of the screen on both sides, especially on smaller screens (see screenshot).

We should have a specific component for that (e.g. a grid, or something with scroll)

Untitled

Display prepared cards (back) of other players

We should show which players have prepared their cards, to know who to push ๐Ÿ˜„

Additionally, a loading element in place of the prepared card when the user hasn't prepared his move yet would be great.
(seeing stuff move makes it more lively)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.