Package: agt-server
CS1440 AGT ServerIntroductionTheAGT Serveris a python platform designed to run and implement game environments that autonomous agents can connect to and compete in. Presently the server only supportsComplete 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 StartedInstallationEnsure that you have the latest version of pip installedFirst clone the respositiorygit clone https://github.com/JohnUUU/agt-server-remastered.gitPlease create a virtual environment firstpython3 -m venv .venv
source .venv/bin/activateFor Userspipinstall--upgradepip
pipinstallagt_serverFor DevelopersIn the root directory, install the project in an editable statepipinstall--upgradepip
pipinstall-e.
pipinstall-rrequirements.txtUsageFrom here you can start a server insrc/serverby runningpython server.py [server_config_file] [--ip [ip_address]] [--port [port]]Then you can run any of the example agents insrc/agt_agents/test_agentsby runningUsage: 
python [agent_file].py [name] [--join_server] [--ip [ip_address]] [--port [port]]Or you can write a agent file that implements any of thesrc/agt_agents/base_agentsand then useagent.connect(ip, port)Frequently Asked QuestionsWhat 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 playedgame_path: The Python import path for the game modulenum_rounds: The number of rounds to be played in the gamesignup_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 movenum_players_per_game: The number of players required in each gameplayer_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.allmeans that the player will recieve all information. All other key words correspond to specific information sent each round likemy_action,opp_action,my_utils,opp_utils, etc...If you wish to change or add more permissions please edit the corresponding game underserver/gamesand the corresponding agent underagents/base_agentstype_configurations: The configuration for player type combinations, if it'sall, 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 movedisplay_results: Flag indicating whether to display/print the game resultssave_results: Flag indicating whether to save the game resultssave_path: Ifsave_resultsis set to true, then this is the path where the game results should be savedsend_results:  Flag indicating whether to send the game results to the agentscheck_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 filesUnfortunately this is currently only supports Mac'sterminal.app. If you are using the Mac terminal then make sure tochmod +xthe 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 hostnamePlease find your ip address usingifconfig(Mac) oripconfig(Windows) underen0oreth0. Find your hostname usingecho $HOSTand 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--iparguement.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.