Giter Site home page Giter Site logo

monopoly-ai's Introduction

Monai - Monopoly AI project

File structure

  • Board = Server, shows the game board and handles primary logic (Bevy)
  • Player = Human player, provides UI to interact with board (Bevy + Egui)
  • Computer = AI player, provides information on the AI and trains model (non-visual)
  • Store = Shared information between server and clients

Process

The game board is effectively a webserver, so it needs to be started first.

cd board
cargo run

By default, the board will run on the port 1095 (the sum of the ascii characters for MONAI), with a WebRTC port of 1096 for WASM. This can be configured in the file server.rs. If running clients locally, you can connect using 127.0.0.1, however it is likely that you will have to open the port 1095 in your router. The default code is MONAI, but you can change this.

For clients, the process depends on whether the player is a computer or human. For a human player, you can either use the WASM client on my website or compile and run locally. The WASM client uses wasm-bindgen and the index.html present in the human's directory. To run locally, use the same process as the server.

cd player/human
cargo run

From there, you should be able to enter a player name, the authorization code, and the address and port of the board (e.g. 127.0.0.1:1095).

If you want to use the AI, you need to supply command-line arguments. The AI is headless, so no GUI will be present while running/training. It uses a DDQN for reinforcement learning. For settings with the model itself (like the shape, epsilon, optimizer, etc), check model.rs. To run it, you have to give cargo a few arguments.

cd player/computer
cargo run -- SERVER CODE NAME NPZ

For example, cargo run -- 127.0.0.1:1095 MONAI Bot1 models/Bot1.npz would connect a bot player to our localhosted server named Bot1 using Bot1.npz. Some primitive models have been supplied in the repository. At the moment, the model is hardcoded to support a 40 tile board with 4 players, but you can expand this by changing the const values.

monopoly-ai's People

Contributors

obvgab avatar

Stargazers

Philo-Sophia avatar Paho Lurie-Gregg avatar Tim Kersey avatar Jeff L. avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

xingfanxia

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.