Giter Club home page Giter Club logo

onitama's Introduction

Onitama App

Docker Image CI

Can be played at https://onitama.app/

Roadmap

Things that could be cool to implement, that aren't done yet, and might one day get done

  • Show piece that last moved, and where it moved from
  • Say when opponent has requested a rematch
  • Add chat (maybe)
  • Add "how to play"
  • Add different difficulty AIs

Local AI

The default Dockerfile will disable server-side AI, and instead compile the AI Agent as web-assembly and run in a JS WebWorker.

An alternate Dockerfile (Dockerfile.remoteai) uses server-side AI which runs the agent code in the same process that serves the game and delivers messages for multiplayer games.

The server-side AI is roughly 30x faster at running Monte Carlo simulations, meaning that the hard bot is notably harder when run server side.
The server side AI is roughly 2x faster, ever since swapping out the RNG used in the Monte Carlo search. Previously it was significantly slower.

To use server-side AI, build the container with

docker build -t onitama:remoteai -f Dockerfile.remoteai .

As of writing this, https://onitama.app/ uses the local AI as it is very light on server resource requirements.

Deployment

Run from GitHub

Pull from GitHub container registry

docker pull ghcr.io/jackadamson/onitama:latest

Run the container

docker run -dp 80:8080 --name onitama --rm ghcr.io/jackadamson/onitama:latest

build Locally

build the container

docker build -t onitama .

Run the container

docker run -dp 80:8080 --name onitama --rm onitama

Development

Requires Rust (nightly) and Node (v14)

  1. Install dependencies with yarn install
  2. Start the backend with cargo run onitamaserver
  3. Start the frontend with yarn start
  4. Visit http://localhost:3000 to see the app

To develop single-player without the backend, start the frontend with

yarn start-local-ai

onitama's People

Contributors

cmaster11 avatar jack5thdomain avatar jackadamson avatar onitamasuperfan 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  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

onitama's Issues

Pull node version from .nvmrc

For those not using docker, it would be nice to have a .nvmrc file that gets picked up by fnm/nvm so the app can run locally and ensure I'm developing with a compatible version of node. Likewise, the Dockerfile which currently has a node version hardcoded could instead use the .nvmrc file too along with fnm to automatically install the correct version of node during container setup.

(Accessibility) Selected card difficult to distinguish

Selected cards have a different border color, but being the border is small it is difficult to tell which card was selected. A few suggestion would be applying a css outline in addition to the border:

Screenshot from 2021-07-20 12-36-39

Or simply changing the background color:

Screenshot from 2021-07-20 12-34-02

Sensei's Path Expansion

Hello, your website has been a great training tool for me and and also an efficient way to play matches with distant friends. As a lover of this game I would like to ask if there are any plans to add the cards present in the sensei path expansion.

imagem_2022-09-15_092117104

Promo Cards:
pic3718352

Currently don't know of any other way to play the expansion with friends without a physical version of this game so I believe it would be a great addition.

Thank you very much for your work.

Add Nessie Promotional Card

image

In 2022 Arcane Wonders produced the promo pictured above for Tabletop Scotland.

It's quite unique in its asymmetric pattern and physical copies are incredibly rare, so including it in the web app as an option would allow many more players to experience it.

Mobile: middle card face the wrong way

Hello.

First of all, thank you for this beautiful little app. I love playing it againsta bot on occasion and it's great to show a friend with the local multiplayer.

I found this issue on mobile (aka, when the screen size is too small to have the middle card beside the board). In this case, the middle card is placed in the opponent's zone but still in the opponent's orientation. This messes me up often because I have to rotate the card in my head to find out what my hand will be next round. I was able to test this on desktop just by icreasing the zoom level until the layout changes, you can see the middle card flip from my own orientation to the opponent's.
desktopOK
mobileNOK

I highly suspect the coding to put the card in the opponent's orientation when it is in the opponent's zone. So I see two ways to fix the issue.

A: Code a way to flip the middle card in the opponent's zone
OR
B: Move the middle card to the player's zone and identify it as unusable for this turn (greyed out?).

I have zero experience in the languages used in this repo, so I apologize for not offering a pull request instead of an issue ticket. Hopefully it is a simple fix for you. Cheers!

Hint

Please add hint option. AI can be great learning tool, but it is hard without undo and hint options.

Last position visible

Currently game over message covers the game board and it is impossible to the last move.

Place 5th card closer to the board

When playing on large screens, 5th card is very far away from the board. It can be placed same distance from the board as other 4 cards, just to the left or to the right.

Screenshot 2022-08-25 173942

Analysis mode

Please add analysis mode. When game ends one can start the mode and look back into the game. The mode would show couple of best moves from AI point of view and allow to re-play the game. Good example of the mode can be found in Lichess app.

Add promotional cards Mejika, Okija, Kumo, and Sasori

These four promos are based on cards from the first edition of the game. They would require additional functionality to work properly since the move you can make with your Master is different than with your Student.

Okija and Mejika
Sasori and Kumo

AIs

Hey bro,

Can I ask what were the technical resources you used to implement the AI algos?
Also I'm very interested to know how did you rank your AIs? Did they battle against each other? What are your findings?

I want to make AIs fight to death on this game (in Rust), started reading your code! Playing with friend on your website gave us the idea :)

Thanks

PS: Do you plan to implement the extensions?

Hard to play with friends, private games?

Thanks for releasing this browser version of Onitama!

I had trouble introducing people into the game online however because of the difficulty in landing in the same game.

More specifically, it was very hard on phones to get the same game because you find yourself trying to send screenshots and dealing with intermittent disconnects. After several attempts my friends gave up because of the hassle.

I would love to see the option for either, a private only game or password protected game.

Add Light & Shadow Expansion

The Light and Shadow expansion adds hidden information and asymmetric forces to Onitama. It adds two new Ninja pawns, a hidden Ninja board, and four Lantern tokens used by a special action to try to reveal opposing Ninja(s) that are hidden. The full rules are available in this pdf.

Adding this expansion to the web app would be a great boon to those interested in playing with it since it has a lower amount of favour amongst perfect information abstract strategy fans that are the general audience for Onitama. It also would eliminate the need to trust your opponent's moves on the hidden board. Personally I look forward to playing this variant against the AI especially.

I think it's important that in addition to making it optional to force either game mode, we also add it to the default random play experience, even if we add a toggle to turn it off. For that I suggest a 5% chance of the random game being either Light or Shadow, and then within that a 70% chance of Shadow (where each player has a Master, two Students and a Ninja) and a 30% chance of Light (where one player has only two Ninjas and the other player has a standard Master and four Students).

As for the Ninja pawn icon itself, I think a traditional Chess Knight would be most appropriate. Unlike the physical game there is no reason the Ninja's colour should not match the colour of the player who controls it.

Also, in the case of currently unimplemented Student/Master promotional cards, we need to either decide how the Ninja should move (since there is no official guidance at this time) or exclude those cards from games where the Ninjas are used for now.

  • Add Ninja pawns
  • Add support for Ninja pawn movement (ie, use the same Movement card twice or pass)
  • Add hidden movement tracking
  • Add Ninja reveal when capturing
  • Add Ninja captured message when another pawn captures one
  • Add Ninja capture attempt option for each Ninja
  • Add Ninja placement step to game setup
  • Add Lantern counter
  • Add Lantern special action and visuals
  • Add Way of the Shadow game mode toggle
  • Add Way of the Light game mode toggle
  • Add the ability to force which player is the Ninja player in online multiplayer
  • Add Light & Shadow to random games

Obviously this is an even more intensive addition than Way of the Wind, but I think they both merit inclusion in the web app. Adding support for these options could be useful for future game additions that may come as well.

Add Way of the Wind Expansion

The Way of the Wind expansion involves a neutral Wind Spirit pawn that either player can move instead of (or with some cards, in addition to) one of their other pieces. It also has the ability to trade places with a Student pawn if it lands on one, but can never land on a Master pawn. The full rules are available in this PDF.

Here are images of the Wind Spirit move cards.
image

To implement this, I would suggest allowing players to choose to enable the Wind Spirit at the beginning of the game, and then allow them to choose a number between 0 and 5 Wind Spirit cards to be force included in the draw. 2 is the default number for a Way of the Wind game, and a random amount between 0 and 5 would also be a nice option but not strictly necessary.

It could also be interesting to allow for the Wind Spirit to be included at random in quick play games. I suggest this is handled by including the Wind Spirit 25% of the time. To handle the number of Wind Spirit cards, I would suggest the following distribution: Zero (10%), One (15%), Two (35%), Three (15%), Four (15%), Five (10%).

For the Wind Spirit's icon I suggest a traditional Chess Queen in some type of grey colour.

The Wind Spirit itself and the Wind Spirit cards require some additional functionality not currently present but could be useful in the future.

  • Add Wind Spirit neutral pawn
  • Add Wind Spirit game toggle
  • Add Wind Spirit move card functionality
  • Add Wind Spirit move cards
  • Add # of Wind Spirit move cards selection
  • Add random # of Wind Spirit cards option
  • Add the Wind Spirit to random games.

AI breaks the rules

AI often seems to be able to make impossible moves. I'm new to the game but I'm pretty sure it can't make that "knight-move" shape from the cards available.

image

Hornet card is incorrect

Hi,

thanks for the nice implementation of Onitama!

I noticed, that the hornet is not symmetrical to the centipede. I looked it up on BGG and found that it indeed should be symmetrical to the centipede.

Another thing:
I always win against the easy ai while almost never winning against the medium ai. I don’t know, how the difficulty is implemented, but maybe it’s easy to add a difficulty between those?

Undo

Please add undo option. Maybe even back and forward. It is OK to have this only when playing with the AI.

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.