The ManualA short description of what ProD does and how it does it.
What do these scripts do?
This package supplies you with several scripts that help you create procedurally generated maps using a grid system. Here’s a short overview of what the scripts do:
BaseGenerator.cs – This is the mother script to all generator scripts. It holds common methods other generator scripts use.
CameraManager.cs – This is an additional script that may be place on a camera. It will tweak an ortographic camera to cover all of the map upon request. It is referenced and used by Generator scripts. You may furhter expand this script to suit your project’s needs or disable it completely if you don’t want the camera to resize.
CavernGenerator.cs – This is an extra script that comes with the package. It allows you create cavern formations. In case you wish to have a cavern map to play in, you may use this script.
Cell.cs – This is a script that is placed on every cell. It contains information about its own properties such as its address, type and material. There is already a designated prefab for this script in Assets/Resources folder. This prefab is used by Generator scripts for tiling the map.
CellManager.cs – This is a script that holds all cell types and their material types.
DirectionManager.cs – This script gives an object 4 directions and ability to alter them for navigation. These directions are used by the generator maps and especially by maze algorithms for traversing the map.
DungeonGenerator.cs – This is the main script that contains all algorithms for creating a dungeon map. It will create a 2-D array that contains all map information. This array has references to Cell.cs scripts that make up the rooms, corridors, doors, stairs and all other types of cells. During the execution of this script, it will materialize the map and create game objects in world space using the cell prefab in resources. All information on the map is stored in a mapArray and available for use outside this script.
MazeGenerator.cs – This is an isolated part of DungeonGenerator.cs. This script will create a maze that connects every odd tile to one another in the map. In case you wish to have only a maze and not a dungeon with rooms, you may use this script.
PlayerMovement.cs – This is an extra template script for you to be able to move a player in the map.
PlayerStats.cs – This is an extra template script for assigning attributes to your player.
VisualGenerator.cs – This script is another version of DungeonGenerator.cs. The script is made up of co-routines that will run the map generation by using yield statements. This way developers may observe the creation of the map in real-time.
How do I use this package in my project?
1 - First and foremost, we recommend that you open the TestScene and press Play. You may initiate a map by pressing the Generate Dungeon button on DungeonGenerator game object only when you are in Play mode. We advise you to play with the values in DungeonGenerator.cs script attached to the DungeonGenerator game object.
2 - To integrate this system to your own project you may set new variables by calling SetMapProperty() and then call the InitDungeon() method to materialize the map. You may also use the Get methods for mapArray and/or mapArrayInString variables for your own materialization script you may wish to use. At the moment we supply you with the map generation only, however we hope to expand on this package and bring you more on future updates.