Skip to main content

The AGT Server is a python platform designed to run and implement game environments that autonomous agents can connect to and compete in.

Project description

CS1440 AGT Server

Introduction

The AGT Server is a python platform designed to run and implement game environments that autonomous agents can connect to and compete in. Presently the server only supports

  • Complete Information and Incomplete Information Matrix Games (e.g. Rock-Paper-Scissors, BotS, etc...)

However, at its core the server is also designed to be flexible so that new game environments can be easily created, modified, and adjusted.

Getting Started

Installation

Ensure that you have the latest version of pip installed

First clone the respositiory

git clone https://github.com/JohnUUU/agt-server-remastered.git

Please create a virtual environment first

python3 -m venv .venv
source .venv/bin/activate

For Users

pip install --upgrade pip
pip install agt_server

For Developers

In the root directory, install the project in an editable state

pip install --upgrade pip
pip install -e .
pip install -r requirements.txt 

Usage

From here you can start a server in src/server by running

python server.py [server_config_file] [--ip [ip_address]] [--port [port]]

Then you can run any of the example agents in src/agt_agents/test_agents by running

Usage: 
python [agent_file].py [name] [--join_server] [--ip [ip_address]] [--port [port]]

Or you can write a agent file that implements any of the src/agt_agents/base_agents and then use

agent.connect(ip, port)

Frequently Asked Questions

  • What do each of the options in the server configurations do? Here is a quick description of each of the server configuration options.

    • game_name: The name of the game being played
    • game_path: The Python import path for the game module
    • num_rounds: The number of rounds to be played in the game
    • signup_time: The duration (in seconds) allowed for players to sign up before a game starts (60 seconds tends to work best for Lab)
    • response_time: The maximum time (in seconds) allowed for each player to respond with their move
    • num_players_per_game: The number of players required in each game
    • player_types: The list of available player types in the game. This can be used to specify different permissions for each player and also can be used flexibly to change the rules for different players inside the game_path file.
    • permissions: This is a dictionary of permissions for each player type restricting the amount of information that each player will recieve at the end of each round. all means that the player will recieve all information. All other key words correspond to specific information sent each round like my_action, opp_action, my_utils, opp_utils, etc...
      If you wish to change or add more permissions please edit the corresponding game under server/games and the corresponding agent under agents/base_agents
    • type_configurations: The configuration for player type combinations, if it's all, then every combination of player types will be played for each game. Otherwise, it can be specified to be a list like [[type1, type2], [type1, type1]] for example so that player 1 will always be type 1 and play against player 2 as both type 1 and type 2.
    • invalid_move_penalty: The penalty for submitting an invalid move
    • display_results: Flag indicating whether to display/print the game results
    • save_results: Flag indicating whether to save the game results
    • save_path: If save_results is set to true, then this is the path where the game results should be saved
    • send_results: Flag indicating whether to send the game results to the agents
    • check_dev_id: Flag indicating whether to check the device ID so that each device can only connect once. This is to stop collusion bots.
  • What purpose do the local arenas serve?

    • The local arenas allow you to run the games locally and allow the user to be able to catch exceptions and invalid moves ahead of time, as well as test out their agent.
  • I cant run rps_test.sh or any of the other .sh test files

    • Unfortunately this is currently only supports Mac's terminal.app. If you are using the Mac terminal then make sure to chmod +x the shell command before running it.
    • You may also need to change the IP address of each agent to be the ip address of your computers hostname as well.
  • I am recieving an error concerning my hostname

    • Please find your ip address using ifconfig (Mac) or ipconfig (Windows) under en0 or eth0. Find your hostname using echo $HOST and then set the host in \etc\hosts. That usually fixes the problem.
    • Alternatively if that doesn't work you can just supply the ip address that you found to server.py when you run it using the optional --ip arguement.
    • This is mostly a bandaid solution by overriding the hostname locally and you'll have to do it everytime the ISP switches, if anyone has more experience with DNS resolution and wants to help please reach out!
  • What if the server hangs for some unexpected reason?

    • These things can be hard to debug but the backup solution is that the server code will catch any interrupts (^C) commands that you give it and return the currently compiled results to the best of its ability so that the agents will know who was winning at that point.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agt_server-1.8.2.tar.gz (231.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agt_server-1.8.2-py3-none-any.whl (124.2 kB view details)

Uploaded Python 3

File details

Details for the file agt_server-1.8.2.tar.gz.

File metadata

  • Download URL: agt_server-1.8.2.tar.gz
  • Upload date:
  • Size: 231.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.10

File hashes

Hashes for agt_server-1.8.2.tar.gz
Algorithm Hash digest
SHA256 9660eceddb9bc1aedba6ace6040105ffbbed7da36cdad30d5679a629f9bb5864
MD5 be2defbaa78e2d8a89e5955f127ef7e3
BLAKE2b-256 3c7c3fa43edec35b6f19b20ed78f3e1c40f42b2c89d769fc0f86e3d102a5d748

See more details on using hashes here.

File details

Details for the file agt_server-1.8.2-py3-none-any.whl.

File metadata

  • Download URL: agt_server-1.8.2-py3-none-any.whl
  • Upload date:
  • Size: 124.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.10

File hashes

Hashes for agt_server-1.8.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c3549f0ea8c7ef4643fb7950e71119c192c17d069f93bca0e3509f0d7cc640b9
MD5 5707aa902f7bd6384c115b8ce8ef1974
BLAKE2b-256 9e73b8d2a5ad1115b9a326fbdca5dff268edb35a01e45006d96bbbefe72bb265

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page