Skip to content

Map Generation

jaehughes edited this page Jun 21, 2020 · 1 revision

Map Generation

Included with the files to run this simulation is a tool allowing anyone to create procedurally generated world for the simulation to run within.

It can be found within the root directory of the project, in a folder called 'world_gen', and can be run by executing the file called 'GenerateMap.py'.

Requirements

In order to run the map generator you need to have the following installed on your computer:

  • Python 3.7 or newer
  • Pillow library for python

However in future builds a compiled copy of this generator will be included removing the need for installing other python libraries in order to use this tool.

Overview

This is the basic generator screen that will appear when you first start the tool:

Map Generator Initial Screen

There is a large slider in the centre of the left side of the window, this controls the difficulty of the map that is generated. It does this by setting the generation settings to a configuration set for each different level.

The right side of the window contains boxes that will display information about the currently generated map. When the tool is first started these will all be blank as no map has been generated yet.

At the top of the window you will see two tabs labeled 'Basic' and 'Advanced'. Currently the basic tab is selected, this tab is used for simple generation from presets.

If you click on the advanced tab it will look like this:

Map Generator Advanced Screen

From this screen each of the parameters for the map generation can be customized individually. There is a separate section for each of the parts of the map.

How To Use

In order to generate a map you first need to select the parameters that you want to determine the different properties of the map. This can either be done using the large slider on the basic tab for a straight forward setup to one of the recommended presets or using the advanced tab to choose each option manually. When you move the basic slider it will move all the advanced sliders to match the value for that selected difficulty.

In order to change an individual difficulty property you must first check the box in the top corner to allow it to be edited (this is to prevent acccidental changes), then adjust the slider as you wish. If the check boxes are off it does not mean that it will not add that element to the generation, just that you can't edit that option at the moment.

It is currently not recommended to add dynamic obstacles to maps as they dramatically impact performance and are not complete yet; they will be working in a future version.

If you want to add activities to the map you need to go to the advanced tab and select up to six manually from the drop downs. Currently no activities are generated with the basic difficulty slider alone but they are not reset when it is moved either.

Once you are happy with the settings you have selected for the map you can press the 'Generate Map' button in the bottom right. This will run a generation process with the current settings and a plan of the map, number of each item and map information will appear on the right side as shown below.

Map Generator Advanced Screen

The map shown displays the walls of the map in blue and the bases that the robots spawn and deposit in as grey squares. Below the map is a list of the humans, bases, obstacles and activities within the current map.

As you can see, the 'Save Map' button has lit up now and, if you are happy with the generated map, you can press it and a file explorer dialogue will appear allowing you to save the map file to a location on your computer.

If you would like to get a different generation or tweak the settings you can change the sliders and press 'Generate Map' again as many times as you wish.

Clone this wiki locally