POPULATION OF THE MAP PHASE

Assign the “prefabs” according to design criteria in the “spawners” and “play” with their parameters until you get a map that you like. 

In the “prebab” “MapPrefabCore” there is a component called “MapGeneratorCNB” that exposes a “bool” type parameter called “SpawnFreeCellBool” with which you have to be careful because it makes real-time modifications in the UI (“MapSO”) , they will also produce a real-time spawn from the list of “Free Cell Spawners” so it can be computationally expensive and we recommend only activating it at the beginning on a not very large map in order to see if the parameters of the “spawners” ” produce the desired result especially in relation to the density of created objects, their position and their scale, then deactivate it!!. 

The map will be oriented with the Vertical axis = Y axis if the variable “Exe Y Vertical == true”, otherwise the Vertical axis will be the Z axis. 

On the same site there are 6 buttons whose functionality we will explain below.

 

The first three buttons are self-descriptive. One issues the order to make a “spawn” for each type of “Spawner” and the other eliminates the created objects, for both types of spawner lists “Free Cell Spawners” and “Collider Spawners”. 

The fourth button “Load Map From SO” orders the creation of a new map with the parameters established in “MapSO”.

If “MapSO” is configured with its “bool” parameter “Autoupdate” set to “true”, this button does not have to be used because as soon as a parameter is changed, the order to automatically create the map is sent, but if it is “false”, It is the way to send the order to generate the map. At first glance it doesn't seem very useful, but if, for example, I'm going to make a very large map of 300 the real-time map slows down so I can set “Autoupdate” to “false”, modify “width” and “height” and press this button to generate the map alone each time I press it. On small and medium maps it runs very smoothly.

 

The last one alternates between activating the “colliders” of the objects instantiated by the “spawners” “on” and “off”.       

Finally in relation to “MapGeneratorCNB”:

 

The four parameters highlighted in red activate and deactivate as well as set the height of the two gameObjects named “MapWallLimitsUp” and “MapWallLimitsDown” located in:

 

This option allows the designer to create open spaces where a beautiful “SkyBox” looks but also closed maps with walls where we can apply a material as desired.

 

In the “Map Base” “prebab” there is another component called “MeshGeneratorCNB” that exposes a “bool” type parameter called “SpawnInCollidersBool” with which you have to be careful, just as with the one previously explained (“FreeCellColliderBool”) and for the same reasons.

 

We move on to the phase of populating the map with “props” through lists of the two types of “spawners” that we propose. The two types differ in the part of the map where they operate, but they share the following design philosophies: • “Prefabs” will be assigned in the UI of our map generator, as this is the easiest way to integrate art “assets” that personalize the visual appearance of the map.• The configuration parameters of the “spawners” that we expose in the UI are, for each type of “spawner” (Free Cell or Collider type):

 

Starting from the image above we will graphically define the 4 main areas on which the “spawners” act. 

  1. Free Cell type + freecell bool parameter = true

  2. Free Cell type + freecell bool parameter = false

  3. Collider type + onTopOfTheWall = true

  4. Collider type + onTopOfTheWall = false


CONFIGURATION PARAMETERS FOR EACH TYPE OF “SPAWNER”:


FREE CELL SPAWNER TYPE

“Free Cells”: If true, yellow zone and if false, brown zone.

“Spawn Density Iteration Step”: Defines the number of instantiated units. At lower values, more units are represented in the iteration for all the possible locations, how many I skip for each one I use.

“Rotate prefab 90 Horizontal”: There are artists who orient their “assets” on the “Y” axis and others on the “Z” axis, so if the “props” appear lying down this parameter corrects the situation.

“Add Collider”: It allows adding a “meshCollider” component, initially deactivated to later be able to activate them at will.

“GO Scale”: modifies the scale of the instantiated “Game Objects”. 

“Offset Vertical”: Modify the instantiation position on the vertical axis of the map in case I want, for example, to hide the roots of the instantiated trees or so that they do not appear to be a little in the air when instantiated in areas of steep slope.

“Normal to floor”: In order to orient the “props” instantiated on the vertical axis, do so on the axis perpendicular to the ground.

“Distance Managed”: To be detected by the “Activate On Distance Manager” component (within “MapPrefabCore”) and based on a preconfigured distance to the Player (Tag = player), deactivate and activate automatically as an optimization technique.

“GOs List”: List of “prefabs” to be instantiated with equal probability.


COLLIDER SPAWNERS

“On Top Of The Wall”: If true, purple zone and if false, red zone.

“Spawn Density Iteration Step”: Defines the number of instantiated units. At lower values, more units are represented in the iteration for all the possible locations, how many I skip for each one I use.

“Rotate prefab 90 Horizontal”: There are artists who orient their “assets” on the “y” axis and others on the “z” axis, so if the “props” appear lying down this parameter corrects the situation. 

“Add Collider”: It allows adding a “meshCollider” component, initially deactivated to later be able to activate them at will.

“GO Scale”: modifies the scale of the instantiated “Game Objects”.

“Offset Vertical”: Modify the instantiation position on the vertical axis of the map in case I want, for example, to hide the roots of the instantiated trees or so that they do not appear to be a little in the air when instantiated in areas of steep slope. 

“Normal to wall”: To orient the “props” instantiated on the horizontal axis perpendicular to the wall.

“Offset normal to wall”: Brings the installation position further or closer to the vertical axis of the wall.

“Distance Managed”: To be detected by the “Activate On Distance Manager” component (within “MapPrefabCore”) and based on a preconfigured distance to the Player (Tag = player), deactivate and activate automatically, as an optimization technique.

“GOs List”: List of “prefabs” to be instantiated with equal probability.“Randomize Scale”: Allows you to randomize the vertical rotation and scale for each instantiated GO.

“Rotate prefab 90 Vertical”: Corrects the different orientations on the horizontal axis of the “prefabs” of different artists. It makes sense when “NormalToWall == true”.


“MAP GENERATOR 3D” allows you to create and individually parameterize lists of “spawners” and not a single “spawner” of each type because, in this way, we can use “prefabs from different artists” with incompatible scales or orientations (the stones of a “ third party artist", are larger than the trees of another), adjusting the scale later in each "spawner" or differentiating the density of instantiation of some types of "prefabs" with respect to others (for example, if I instantiate flowers and trees, It is normal that the density of flowers is much higher than that of trees. This approach triggers the potential for aesthetic customization of the maps to a very high level.


Crea tu propia página web con Webador