Lightning Strike Loc Generator

Technical Design
Project Overview
The Lightning Strike Location Generator is a specialized editor utility widget created for the weather system to generate lightning strike locations.

This handy tool has been seamlessly integrated into the game engine editor, empowering designers to quickly generate lightning strike locations for new maps with customizable parameters. Furthermore, they have the flexibility to effortlessly test, add, remove, modify, or update strike locations per their requirements.
Role
Technical Level Designer
|
Brief Approach
1. Location Selection
Within the border range, the generator randomly and uniformly selects desired strike locations based on the average spacing parameter. This method ensures that the strike locationsare evenly distributed, preventing excessive clustering in any specific area and avoiding overlap between the strike locations. Designers have the option to choose a custom random seed, guaranteeing the reproducibility of the strike location distribution in the generated results.
2. Validity Checking
(1) Ensure unobstructed strike locations to avoid indoor strikes: To determine the strike locations, a downward ray is cast from above the desired locations, checking for obstacles or objects that could block the lightning strikes.
(2) Validate strike locations for player accessibility: After identifying potential strike locations, the generator examines the angle between the location's normal (perpendicular direction) and the horizontal plane. This validation ensures that the strikes occur in areas where the player might be present, increasing the possibility of player engagement.
(3) Maintain natural and plausible strikes with height limit verification: The generator offsets the strike location in four directions (up, down, left, right) perpendicular to its normal, each at a distance equal to half of the "LightningStrikeZoneDiameter." Subsequently, four rays are emitted parallel to the location's normal  to above locations. Analyzing the range of hit distances from these rays ensures that the strike location zone remains within the specified height limit, preventing unrealistic placements on locations with significant height variations.
3. Saving and Accessing Location Data
The final strike location data will be stored in the data asset called "DA_LightningLocations" within the data folder. This data asset inherits its data structure from the predefined primary data asset "PDA_LightningLocations."
Editor UI
Manual
1. Configure the customizable parameters and click "Apply."
2. Click "Generate Lightning Strike Locations" to complete the generation process. The strike data is then stored inside the data asset file called "DA_LightningStrikeLocations" in the data folder.
3. (Optional) To validate specific strike locations, place arbitrary objects above the desired locations, select them, and click "Check Valid" to verify the locations directly below the objects.
4. (Optional) To remove all debug traces generated during the processes, click "Clear Debug Traces."
Partial Parameter Tips
Raycast Length: This parameter is used for the downward detection ray, and it is essential to ensure that ("RaycastStartZ" - "RaycastLength" < scene' minimum z-coordinate).
Lightning Strike Zone Height Limit: The maximum acceptable height difference within the zone perpendicular to the strike location's normal.
Random Seed Number: If "CustomRandomSeed" is selected, this parameter serves as the seed number. Using the same seed number in the future will generate the same batch of lightning strike locations.
Usage Sample