Log In  


Cart #onitama01-4 | 2021-01-01 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
23

Onitama is a chess-like abstract strategy boardgame.

The game is played on a 5x5 board. Each player has five pawns, with the master pawn starting in the middle. At the begin of the game, 5 move cards are randomly selected out of the total of 16 animal moves. The goal is to capture the opponent's master pawn or to move on top of their master's starting position.

You can play against an AI with 3 difficulty levels, or "pass 'n play" against another human.

Controls

  • Arrow keys, move the board cursor for pawn / destination selection.
  • [o] / z to switch between move cards.
  • [x] / x to select a pawn / destination.

Rules

During each turn the player chooses one out of two available move cards, and moves a pawn according to the chosen card. This move card will then be passed to the opposite player where it will become active next turn.

You can capture an opponent's pawn. By capturing the opponent's master pawn, or moving your master pawn to the opponent's master pawn starting space, you win the game.

Watch the short (3:24) instruction video on How To Play Onitama.

All movement cards

Credits

Thanks to @Krystman / Pico Checkmate for the reference Chess AI. Find more about programming Chess AI on http://chessprogramming.org/

Changelog

v0.5
Internal AI improvements: faster moves, position key, benchmarks
AI: purge bad moves, award PV
Logging bugfix

v0.4
Menu with opponent and difficulty selection

v0.3
Negamax with alpha / beta pruning
Quiescence
Position and move evaluation
AI thinking indicator...
Take turns after each game
Game statistics

v0.2
Naive AI player
Bugfix: moves shown on top of own pieces

v0.1
Table with 16 cards
Use different indexes
Board as table
Place / remove stone
Show mini board
Show opponent mini board
Show 5th card
Shuffle cards to begin with
Select active card
Rotate cards when playing
Show valid moves
Play move
Limit to valid moves
Detect win condition
Reset game
Draw Temples

23


1

Nice! I have the physical version of this game, but it's nice to be able to play against an AI! He is not too clever, though, because I managed to win :D

But it's a nice and clear implementation of the game, nice work. I would love to have an advanced opponent, but that's probably quite hard to add!


1

@dollarone thanks for your feedback and... Challenge accepted :-) After studying @Krystman's Pico Checkmate I am inspired to create a better AI opponent.


1

@dollarone The game now has way better AI logic. You can select 3 modes (easy/normal/hard), easy should be comparable to what you previously played against. Can you (still) win against normal / hard? ;)


1

that's so cool! :D


1

I like this a lot. Managed to just barely beat the hard difficulty on a very weird set of cards with no up movement, but it was crazy hard, and the AI nearly got me a bunch of times. As in, I had only one move that didn't kill me or allow the enemy's master pawn to advance into a guaranteed win. I'd say your difficulty settings are spot-on!


1

@shy wow, I am very impressed! Tuning difficulty levels without a lot of playtesters had me worried, I am relieved that it feels right to you.



[Please log in to post a comment]