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/
.
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
.
To set up a LaserTag game, follow these steps:
-
Add your agents' implementation files to the directory
LaserTagBox/Model/Mind/
. -
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. -
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
andconfig_4.json
, respectively) can be found in the directoryLaserTagBox/
. -
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)
-
Run
Program.cs
. -
After the simulation has finished, go to the directory
Analysis/
and run the filevis.py
to visualize the game. You can double-click the file in your file explorer, or run it via a terminal:python3 vis.py
Prof. Dr. Thomas Clemen, Berliner Tor 7, 20099 Hamburg, Germany
eMail: thomas.clemen@haw-hamburg.de
Web: www.mars-group.org