Skip to content

A multi-agent game based on laser tag that is designed with MARS and that enables users to design agents that compete against each other in the game

License

Notifications You must be signed in to change notification settings

MARS-Group-HAW/model-mars-laser-tag-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LaserTag: A Multi-Agent Simulation Game

LaserTag is an agent-based simulation game designed for developers to implement and test agent behaviors and let agent teams with different strategies compete against each other. The game runs on the multi-agent simulation framework MARS (Multi-Agent Research and Simulation).

For project setup, game rules, agent interfaces, and more information on everything described in this README, see the PDF documentation in the directory Documentation/.

Usage

LaserTag is a C# application. To work with it, open the directory LaserTagBox/ with a .NET IDE of your choice (e.g., Visual Studio, JetBrains Rider, or VS Code).

Note: The MARS Framework integrates into LaserTag via a nuget package. If the MARS dependencies of LaserTag are not resolved properly, use the nuget package manager of your IDE to search for and install the nuget package Mars.Life.Simulations.

Game Setup

To set up a LaserTag game, follow these steps:

  1. Add your agents' implementation files to the directory LaserTagBox/Model/Mind/.

  2. In the file LaserTagBox/Program.cs, add the following line per agent type:

    description.AddAgent<MyAgentType, PlayerMindLayer>();

    Note: MyAgentType is the name of the main class of your agent type.

  3. In the file LaserTagBox/Program.cs, specify a JSON configuration file for the simulation.

    var file = File.ReadAllText("my_config_file.json");

    Note: my_config_file is the name of the JSON file that contains the game configuration.

    Note: The game is designed to be played by three of four teams. If fewer teams are specified in the file Program.cs, the remaining teams are placed in the game as "empty" agents without behavioral logic.

    Note: The default configuration files for three-player and four-player games (config_3.json and config_4.json, respectively) can be found in the directory LaserTagBox/.

  4. In the configuration file, specify the map for the game.

    ...
    "layers": [{
      ...
      "file": my_map.csv,
      ...
    }],
    ...

    Note: my_map is the name of the CSV file that contains the map encoding.

    In the directory LaserTagBox/Resources/, there are some default maps. You can generate your own maps using the following encoding:

    • 0 = empty cell (accessible)
    • 1 = Barrier (inaccessible)
    • 2 = Hill (accessible)
    • 3 = Ditch (accessible)
  5. Run Program.cs.

  6. After the simulation has finished, go to the directory Analysis/ and run the file vis.py to visualize the game. You can double-click the file in your file explorer, or run it via a terminal:

    python3 vis.py

Contact

Prof. Dr. Thomas Clemen, Berliner Tor 7, 20099 Hamburg, Germany
eMail: thomas.clemen@haw-hamburg.de
Web: www.mars-group.org

About

A multi-agent game based on laser tag that is designed with MARS and that enables users to design agents that compete against each other in the game

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •