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.

Table of Contents

Variables

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.

Starting Maze Spawn Transform

images/gen-props/start_maze_trans.png

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.

Tile Width in Units

images/gen-props/tile_width.png

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.

Width

images/gen-props/width.png

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).

Height

images/gen-props/height.png

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).

Tile Data Table to Spawn

images/gen-props/tile_data_table.png

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.

images/gen-props/tile_data_table_example.png

Use Custom Seed

images/gen-props/use_custom_seed.png

If true, enables the use of the CustomSeed int for generation. If disabled, the generator uses a randomised seed. False by default.

Custom Seed

images/gen-props/custom_seed.png

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.

Imported CSV Data Table

images/gen-props/imported_csv_data_table.png

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.

images/gen-props/imported_csv_data_table_example.png

Events

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.

Generate Maze

images/gen-props/generate_maze.png

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.

Destroy Spawned Tiles

images/gen-props/destroy_spawned_tiles.png

Iterates over the references to each individual spawned actor tile and calls the Destroy Actor function. Resets generator variables upon completion.

Import Maze From CSV

images/gen-props/import_maze_from_csv.png

Iterates over the contents of Imported CSV Data Table to deserialse and save the state of a previously exported CSV file.

Save Maze as CSV

images/gen-props/save_maze_as_csv.png

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.