Git Product home page Git Product logo

machikoro's People

Contributors

aquadragon avatar kevinddchen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

sharklera

machikoro's Issues

Variable supply not implemented correctly

Currently, for variable supply we set the number of copies for each Major (purple) establishment to numPlayers. In reality, this should actually be 4 when playing with <= 4 players, and 5 when playing with 5 players, and the extra copies are removed from the supply when they are not needed so that newer establishments can be added.

The effect is that when playing with 2 or 3 players, the chances of Major establishments being in the supply is lower than what they should be.

Amusement Park and Radio Tower interaction bug

Suppose a player owns the Train Station, Radio Tower, and Amusement Park. If the player rolls doubles but then re-rolls with one die, they will get a second turn. The intended behavior is that they should not get a second turn.

Make unit tests

We currently have no tests. That means if we push breaking code, we have no idea until it breaks. We need tests.

React should have a built-in testing suite.

Non-null assertion causes linters to fail

One of the uncompleted tasks in #71, the non-null assertion in the various parts of the typescript source code causes the GitHub linter to fail. It can be resolved by running npm run prettier:fix, but it appears to be a quick fix and not a long term solution.

This was discussed in #97 (comment).

Custom middleware is broken

In #105, I removed some custom middleware from the server-side code, which did:

  • cleanup player names, e.g. remove whitespace, normalize unicode
  • validate player name lengths
  • check no duplicate player names

The primary issue was that the "hack" of reading the body of the ctx.req and then putting the bytes back into the stream doesn't work over the web. This line:

while (null !== (chunk = ctx.req.read() as Uint8Array)) {
is not correct for reading the full stream, and we need fancier logic to tell when the stream has ended. We could read the entire stream with something like

for await (const chunk in ctx.req) {
    ...
}

but then I do not know how to but the bytes back into the stream.

Some possible resolutions:

  • Try harder with the hacks, and get something that works both locally and online
  • Implement these checks client-side, but this does not guarantee total safety if someone knows how to make malicious API calls
  • Try to fix things in the boardgame.io repo.

Buying landmarks in Machi Koro 1

In Machi Koro 1, a player can buy a landmark by clicking on a landmark that is not in their PlayerInfo component. This should not happen.

Rare client-side crash

Crashes when a player rolls 12 w/o Harbor or Radio Tower and an opponent has Harbor + Tuna Boat. Screen goes white in production.

Everything is fixed when the browser is refreshed.

This is caused due to a strange interaction between ctx.random and the automatic commit roll feature.

Make game log more efficient

The player-facing game log stores the 200 most recent lines in the game state. While this is convenient to access, this is memory inefficient, since each line of the log will be redundantly copied in several game states. We need a new implementation for the game log that stores each line of the log only once.

One possibility would be to store only the new lines of the log to the game state. When it comes time to render the game log, the client would go through the previous game states and pull those log lines.

Chat

during the game there is a lack of chat.

Remember player's name in lobby

The client has the ability to recall the player's name but the lobby loads a blank field in the "Enter Player Name" input every time it loads. This means that the player has to re-enter their name when they accidentally create a room, leave and return to the lobby or something similar.

Possible solutions are to initialize a blank state at the start of the game or to be able to get the client to check if a name has already been entered at the start.

Add indicator to show that the inactive tabs in Game Log/Chat have new updates

With the addition of a chat box that occupies the same footprint as the game log (#97), it may be useful to have an indicator that appears when the other tab has new updates. For example, when the Game Log is selected, an indicator would appear when there are new Chat messages. Similarly, if the Chat is selected, an indicator would appear when the game progresses and there are new log messages related to the game.

Disable chat for spectators

Here are two interesting features we could implement now that we have spectator mode and a chat:

  • Allow spectators to participate in chat. Spectators can enter a name and their typed messages will show up. (right now nothing happens for spectator when they enter typed messages)
  • Allow room host or any players to enable/disable spectators from chatting. Mostly for spam control. (First we need to show # of spectators in the room.)

(removed good first issue tag as it might be a bit more involved in having to add other features before getting the above to work)

Amusement Park bug

The amusement park activates whenever a player has rolled doubles, even if they re-roll

Display a custom message when the game starts

I want to be able to display a custom message right when the game starts. For example in MK2, I want it to display '(Start of initial build phase)' immediately when the game starts. In the future this can be used to include information about the game settings like which version etc.

I spent more than 3 hours today trying to figure out how to do this (and a few hours in another session before logOtherEvent was implemented [#92] ) and there has been no progress on this at all ๐Ÿ˜  ๐Ÿ˜  ๐Ÿ˜ 

I'm working with the .\src\game\machikoro.ts file. Apparently a line like Log.logOtherEvent(G, 'TEST') only works in the list of const functions in the Moves section (although it shouldn't be there). I tried creating a move helper but it didn't work. I tried defining it in the setup (Game section after lines 1012) and it didn't work either. I think there has to be a separate function that is not written like a Move const function and is called when the game initializes. Unfortunately I'm too noob at typescript and can't tell the difference between const X: Y => (Z) => and const X = (Z: Y): void => to know how to write this correctly.

NODE_PATH not recognized on Windows

When following instructions to run Machi Koro locally, NODE_PATH is only recognized on macOS/Linux terminals and not on Windows cmd. (https://stackoverflow.com/a/63270514)

As a result, npm run serve:dev or npm run serve:prod will generate the following error when running on Windows:

'NODE_PATH' is not recognized as an internal or external command,
operable program or batch file.

One solution to solve this issue is to do the following:

  1. Install the cross-env package with npm install cross-env
  2. Use cross-env with the serve:dev and serve:prod commands by updating package.json, i.e.

    "serve:dev": "cross-env NODE_PATH=./src ts-node-dev ./src/server/index.ts",
    "serve:prod": "cross-env NODE_PATH=./src ts-node --transpileOnly ./src/server/index.ts",

However, checks will need to be performed to see if this solution affects other OS systems. If it doesn't, then other solutions will have to be proposed.

Hybrid supply marketplace rows should be fixed

With hybrid supply, the establishment marketplace is divided into rows: one row for establishments with rolls 1-6, one row for establishments with rolls 7-12, and one row for major (purple) establishments. These rows should not mix during the game.

Next UI Update To-do List

I made a to-do list in 2023 to update the UI, but was not able to work on it yet so I'll just leave my notes here in case I pick it up again.

  • Add border to cards to distinguish between different expansions
  • Add background to the different 'decks' (e.g. 1-6, 7+, purple)
  • Add indicator to chat tab when there is a new unread message'
  • Fix overflow text in Member's Only Club

Feel free add and/or suggest new items for the next UI update.

Tuna Boat Bug

Tuna boat is not implemented correctly: one roll should be made for all players

Game asset overhaul

Our app currently uses copyrighted materials. We need to reskin each game object and create new assets. Ideally, the theme we come up with should parallel the original intent of the game (kind of like how https://richup.io/ reskined monopoly)

Credential error

If a user has corrupted credentials, they will still be allowed into the room but not get any feedback that their credentials are no good any more.

To replicate: join a game, refresh, edit local storage, and change the value associated to the matchID.

Fix grammar

The logs say 1 coins when it should be 1 coin.

Doubled game log on win

In Machi Koro 2, the game log shows the winning message twice if a player buys Launch Pad as their third landmark. The log should only show this message once.

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.