Code Monkey home page Code Monkey logo

gis81507's Introduction

GIS81507 - Artificial Intelligence in Games

Requirements

Game: v6.1

Python 3.11 and the following dependencies:

# AI Module
uvicorn
fastapi
pyftg
pydantic
# Twitch Module
twitchio==2.8.2
python-dotenv==1.0.0
httpx==0.25.1
requests
python-dotenv

Install instructions

  1. Create a new Python environment with requirements
  2. Run the game
  3. Open new terminal and open game server
cd AIModule
python game_server.py

In the game, Player should show DemoAI_2 (Visual AI) 4. Open command server

cd AIModule
python command_server.py
  1. Open new terminal and GUI. Specify a new path so that the GUI will read from this file. It does not have to be exist for now.
cd AIModule
python view.py --json_path <path_to_game_stat_file>
  1. In TwitchAPI folder, configure the bot by copying .env.example to .env. Then, modify the .env file using your credentials.
  2. In TwitchAPI/config.py, set STATUS_JSON_ADDRESS to the path specified in step 5.
  3. Open new terminal and run the bot
cd TwitchAPI
python main.py
  1. In the game, make sure that both are GRPC and characters are Zen.
  2. Start the match

API design

Side choosing

Player API

  • Start game
{
    game_id: string,
    start: bool,
}
  • Command handler
{
  player_1:
  {
    actions: [action_1, ..., action_n]
  },
  player_2:
  {
    actions: [action_1, ..., action_n]
  }
}
  • Game status
{
    game_status: string,
    character_1:
    {
        hp: float,
        energy: float
    },
    character_2:
    {
        hp:float,
        energy: float
    }
}

Better API

Twitch server received Game status message and perform betting logic.

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.