With this being an open-world environment with foraging, a ton of interactable plants need to exist with random placement. As a single developer, the most feasible method to accomplish this is to place nodes with an editor tool. This generates spawn points that are saved, and during runtime a random selection of these spawn points are used. This reduces runtime overhead, allows for sections to be loaded and unloaded, while still feeling both natural and random during game play.
This tool is meant to aid the level design process. Regions for plant spawning can be placed based off of concept art, and it provides the player an important source of information for planning their next route.
Performed as random top-down raycasts using a node radius. This acts as a cylinder instead of a sphere, but the sphere is nicer for visualization.
Determine the layer to create spawn points on for specific terrain, objects, or other prefabs.
Set the spacing between spawn points.
Set the total spawn points to create in editor.
Set the number of spawn points to use during runtime.
Preset spawn points on models. These points are manually set to provide specific creative control (such as only underneath branches).
Determine the normals of each spawn point.
Determine this type of object for the Plant Spawner to reference.
Still generating plants on a random selection of the available spawn points.
Specific spawning details are determined in the Scriptable Object for each plant. Helps remove complexity from the spawning tool itself, making it faster to use during level design.
Possible spawning locations
Upwards direction
Random scale range