Unite feudal Japan in this Risk-like strategy game! (This is extremely alpha and in active development.)
Up to 8 players: play against friends online, the computer, or both.
To start your Phoenix server:
mix setup
mix phx.server
Now you can visit localhost:4000
from your browser to play!
Want to improve the AI? Great! Computer players implement the Sengoku.AI
behaviour. The current AI is the Sengoku.AI.Smart
module.
Copy the current AI module and its tests. From the command line:
cp lib/sengoku/ai/smart.ex lib/sengoku/ai/smarter.ex
cp test/sengoku/ai/smart_test.exs test/sengoku/ai/smarter_test.exs
I’d like to automate this, but with lib/sengoku/ai/smarter.ex
manually rename Sengoku.AI.Smart
to Sengoku.AI.Smarter
, and within test/sengoku/ai/smarter_test.exs
rename Sengoku.AI.SmartTest
to Sengoku.AI.SmarterTest
.
Run mix test
to ensure everything’s working.
Run mix ai.arena Sengoku.AI.Smarter
with your new AI module:
Starting 2000 games with Sengoku.AI.Smarter as Player 1
against Sengoku.AI.Smart as all other players
Player | Win %
--------------------------------|-------
1 (Sengoku.AI.Smarter) | 11.9%
2 (Sengoku.AI.Smart) | 11.8%
3 (Sengoku.AI.Smart) | 13.6%
4 (Sengoku.AI.Smart) | 13.7%
5 (Sengoku.AI.Smart) | 12.4%
6 (Sengoku.AI.Smart) | 12.3%
7 (Sengoku.AI.Smart) | 11.5%
8 (Sengoku.AI.Smart) | 12.8%
(With mix ai.arena
, at least on the default "westeros"
map, win percentages should be even within a few percentage points.)
Now change how Sengoku.AI.Smarter
works! Continue running mix ai.arena Sengoku.AI.Smarter
to test the impact of your changes against the default AI.
When you’ve made an improvement, merge your changes back into Sengoku.AI.Smart
and consider opening a Pull Request with the improvements!