Play Onitama in your browser, compete with friends or lose to a bot

Overview

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
Comments
  • AIs

    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?

    opened by truchi 7
  • Mobile: middle card face the wrong way

    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!

    opened by Electronicks 2
  • Pull node version from .nvmrc

    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.

    opened by jaythomas 1
  • Put spare card closer to the board and some graphics fixes

    Put spare card closer to the board and some graphics fixes

    • Put spare card closer to the board (fixes https://github.com/jackadamson/onitama/issues/11)
    • Slightly reduce the "hide-spare" breakpoint because the spare card can be way closer to the board than before

    Before: Screenshot_42

    Now: Screenshot_43

    Collapsed: Screenshot_44

    opened by cmaster11 0
  • Support for cards' direction and respective moves color

    Support for cards' direction and respective moves color

    Add support for cards' direction, which can be "balanced", "left" or "right". This causes the cards to display the moves in the respective colors (yellow-ish, blue or red), as the real game cards do.

    Screenshot_38

    Note: implicitly contains the Sensei's Path PR ( https://github.com/jackadamson/onitama/pull/13 ), because I had to also add colors for those cards.

    PS. Also, some fixes around for Windows machines :) (like crossenv and gitattributes)

    opened by cmaster11 0
  • Sensei's Path Expansion

    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.

    opened by Fu14n0 0
  • Place 5th card closer to the board

    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

    opened by misha-franz 0
  • Analysis mode

    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.

    opened by misha-franz 0
Owner
Jack Adamson
Jack Adamson
Rewrite of the Discord Bot used for Managing the Infinity Bot List Servers.

Arcadia Rewrite of the Discord Bot used for Managing the Infinity Bot List Servers. Contributing Always run fmt.sh before making a Pull Request! MacOS

InfinityBotList 3 Dec 15, 2022
Just a personal Rust Playground to play around and understand the language.

Rust Proactive Introduction The code is a bit messy but it serves just as a personal Rust Playground to play around and understand the language. You c

Fernando Cejas 3 Dec 21, 2022
Telegram bot to fetch images from Terceira Ponte and Rodosol into your Telegram chat.

rodosol-telegram-bot Add this bot to your contacts list This bot is a quick scraper that gets the pictures from the rodosol "De olho na via" feature a

Armando Magalhães 1 Jan 9, 2022
Web Browser Engineering

This is a port of Web Browser Engineering series from Python to Rust done by Korean Rust User Group.

한국 러스트 사용자 그룹 36 Dec 12, 2022
Using engines running outside of the browser

External engine (ALPHA) Using engines running outside of the browser

Lichess 43 Dec 31, 2022
A simple bot for discord.

Rusky Um simples bot para o discord! ?? Executando ⚠️ Antes de tudo você precisa do Rust Instalado você pode instalar clicando aqui Preparando Primeir

Rusky 3 Aug 12, 2022
A Simple, But amazing telegram bot, Made using the Rust language!

Telegram bot in Rust A fun Telegram bot made using Rust language.

Deep Alchemy 2 Dec 21, 2021
This is a Telegram bot I'm working on in my free time to learn Rust.

Maldness Bot This is a Telegram bot I'm working on in my free time to learn Rust. Building docker build -t . should be enough.

Sergey Kislyakov 10 May 13, 2022
A Discord bot for lichess and Rosen related things

liro Liro is a Discord bot that follows in the footsteps of Lichess-discord-bot, without necessarily aiming to replace it. The main pain point that th

Sebastian Lauwers 5 Feb 16, 2022
This is a simple Telegram bot with interface to Firefly III to process and store simple transactions.

Firefly Telegram Bot Fireflies are free, so beautiful. (Les lucioles sont libres, donc belles.) ― Charles de Leusse, Les Contes de la nuit This is a s

null 13 Dec 14, 2022
Hi I'm Sophy, a discord bot in devlopment, soon I'll be available to help everyone (❁´◡`❁)

Sophy Bot Hi I'm Sophy, a discord bot in devlopment, soon I'll be available to help everyone (❁´◡`❁) Contribution Do you like me and want to help me?

Far Dragi 0 May 30, 2022
Telegram Bot Template with Cloudflare Workers

cf-workers-telegram-bot-template Usage This template starts you off with a src/lib.rs file, acting as an entrypoint for requests hitting your Worker.

Lee Taehoon 2 Sep 23, 2021
Rust telegram bot library for many runtimes

Telbot Telbot provides telegram bot types and api wrappers. Specifically, telbot now supports: telbot-types: basic telegram types / requests / respons

kiwiyou 17 Dec 3, 2022
Just a bot for Neovim's Matrix room(s)

nvim-matrix-bot Currently just supports replying to messages with :h <some_doc> or similar in them with a link to the docs on Neovim's website. Plan i

null 8 Aug 6, 2022
Music bot written in Rust

Akasuki What is Akasuki? Akasuki is a simple discord music bot written in rust. Highlights Select your music using discord's new select menu feature,

Forbidden A 0 Dec 19, 2021
A Discord bot for sending GeoGuessr challenge links that uses the GeoGuessr API written in rust.

GeoGuessr-bot-rs This is a simple implementation of a discord bot that send GeoGuessr-challenge links on demand. Features: Slash-commands Lightning-fa

Luukas Pörtfors 6 Nov 18, 2022
🦴🤖 // A Discord bot about collecting all the Borpa

?? ?? Borpa Bot Borpa Bot is a Discord bot about collecting all the Borpa possible. If you dont know what a Borpa is you can find it here Crate Descri

mellowmarshe 1 Dec 19, 2021
A scriptable discord bot (WIP)

Status This project is currently a VERY EARLY WORK IN PROGRESS. Contact me on discord for more details: Jonas747#0001 (105487308693757952) BotLoader (

null 26 Dec 21, 2022
🦜 A hassle-free, highly performant, host it yourself Discord music bot built with Serenity in Rust. Powered by youtube-dl and Genius.

?? A hassle-free, highly performant and fast evolving Discord music bot built with Serenity in Rust. Deployment Usage Just create a bot account, copy

Miguel Mano 82 Dec 14, 2022