Generation Properties - frasergeorgeking/UE4_BP_MazeGen_MIT GitHub Wiki
This section has been divided into two catagories - Variables and Events. Each category itemises the key properties of a given variable/event and provides screenshots where applicable.
The individual names of each variable/event are based on how they are defined within the BP_MazeController
class - different names or summaries may be used elsewhere in the project, such as within the Editor Utility Widget interface.
Please find itemised documentation on the public variables of the generator below - these properties drastically affect the output of the generator. Please refer to the in-code Blueprint comments for documentation on private variables and generator functions.
Controls the spawn location of cell 0 of the maze (the bottom-left cell). As each maze is built from cell 0 outwards (moving from left-to-right, bottom-to-top), cell 0 can be considered as the 'starting' transform for spawning geometry.
Defines the width of each tile in Unreal Units. As maze cells are 'square', width should also equal height. Value must be manually entered and is dependent upon geometry of tiles. Default provided tiles are all 500 units squared (1cm = 1 Unreal Unit/UU). Used to calculate spawning distances between tiles.
The length/width of tiles in Unreal units. Default provided tiles are all 500 units squared (1 cm = 1 unreal unit). Used to calculate spawning distances between tiles.
Controls the horizontal number of cells to spawn. Minimum value of 3, maximum value manually clamped to 50 for performance reasons (can be manually overriden by removing value/ slider ranges).
Controls the vertical number of cells to spawn. Minimum value of 3, maximum value manually clamped to 50 for performance reasons (can be manually overriden by removing value/ slider ranges).
A reference to the tile data table to spawn. Tile data table holds references to each tile blueprint class, as well as each corresponding wall and rotation value. If importing custom tile assets, a custom tile data table must be created. Please see below for an example tile data table.
If true, enables the use of the CustomSeed int for generation. If disabled, the generator uses a randomised seed. False by default.
The custom seed used for generation - value passed through to Random Stream . Repeatedly using the same integer will reproduce the same maze (provided other properties, such as Width and Height remain constant). Requires 'bUseCustomSeed?' to be true.
A reference to a previously exported maze CSV. Reference used when calling Import Maze From CSV. Please see below for an example of an imported CSV data table.
Please find intemised documentation on the public events of the maze controller below - these events are used to execute the core functionality of the generator.
Called when spawning maze. Performs checks on requisite variables (e.g. Tile Data Table), destroys any spawned actor tiles and resets all generator variables before running Sidewinder Algorithm and spawning resulting actor tiles. Uses properties determined by the variables above.
Iterates over the references to each individual spawned actor tile and calls the Destroy Actor function. Resets generator variables upon completion.
Iterates over the contents of Imported CSV Data Table to deserialse and save the state of a previously exported CSV file.
Passes through the bAllowFileOverwriting?
and CSVFileSaveName
parameters to SaveGeneratedMazeAsCSV
function which then serialises the state of the generator to the %ProjectRoot%/MazeCSVExports
directory. bAllowOverwriting?
set to false by default - if true will overwrite any file with the same name. If CSVFileName
string is empty, a file name will be automatically generated based upon the current time and date.