RPS AI

This web application is more of a sandbox than a game, designed to showcase the real-time capabilities of neural networks for generalized pattern recognition. The backend AI features a custom-built feedforward neural network, intended to be accurate, fast, and lightweight, making it suitable for efficient deployment in various applications.

How to Play

Rock, Paper, Scissors is a straightforward game played between two participants. The gameplay follows a cyclic principle, where each shape defeats one of the other two. The game has four possible outcomes for each round:

  • Rock crushes Scissors.
  • Scissors cut Paper.
  • Paper covers Rock.
  • If both players choose the same shape, the round results in a tie.

In this implementation, players can either click the corresponding icon or use the numeric keys [1], [2], and [3] for rock, paper, and scissors, respectively. The game can be restarted with [R]

AI Controls

Holding the [Z] key reveals additional information, offering players insights into the game dynamics. The displayed statistics include:

  • Win rates for both the player and the computer at the top.
  • The AI's estimated probability of the player's choice in the lower right.
  • Confidence level in using short-term or long-term memory (explained further below).

Players can also toggle between different settings:

  • Computer Playstyle: Options include attempting to win (countering the player's choice), intentionally choosing the losing option, or mimicking the player's style.
  • Computer Memory Length: Allows the AI to access either short-term or long-term memory for decision-making.

These settings can be adjusted to demonstrate the versatility of the AI in various applications or to adapt to different player skill levels.

The AI logic comprises three models: a short-term model, reacting to immediate player changes (learning patterns and adapting within 2-16 moves); a long-term model storing player biases with approximately 100 examples of play; and a persistent model trained on a large dataset from various users that remains unchanged. The selected approaches will change based on the outcome of each model, adapting to changes in player strategies. For instance, if the short-term model is outperforming others due to recent successful choices by the player, its decisions will override results from the other models.



Leave a comment

Log in with itch.io to leave a comment.