Exploring empty rooms that are just plain walls is BORING. This system and its subsystems are in place to populate the biomes with procedurally generated details.
This new system will be split into different parts for ease of customization
Here is the plan for the new systems:
General feature system
- The general prop system goes over every chunk unit in a set render distance radius and gets a grid. Then it goes to the Data table with all the features
- For each feature, it loops through all of these grid spaces and performs checks for rarity. If it succeeds (X% chance of happening), it shoots rays from the centre depending on the spawn position and spawns the prop.
- The feature is NOT stored in the level generator. It is handled by a different class - Global Feature Manager, which handles saving and loading/unloading any feature or object. To prevent generating over existing features an Array of intvectors is present that is expanded for every CU on which a given feature has been generated. Before spawning a feature it will check for the CU at which the feature will spawn in that array and abort if it finds that coordinate for the given feature
- The behaviour when there already is a structure at a given position is also configurable: [Abort spawn in filled grid spaces, Override existing grid space, Spawn alongside existing grid space]
- The feature data are stored in a data table and have lots of reconfigurability: [rarity, spawn position (floor, wall, ceiling), spawn rotation (random, random Z, 4-dir random Z, 8-dir random Z, rotate towards spawn origin) and others]
- Masked to a specific Biome only Biome generation [REFACTOR PLAN]
Zone Injector
- While the General feature system loops over a chunk unit it checks if this chunk unit is part of a designated zone
- If it is, then it checks the Zone Definition it is associated with it, which includes an array of feature definitions
- Then it injects the prop and overrides whatever was supposed to spawn in its place
Light generation system
- Simplified version of the above system dedicated specifically for light sources
- Has two radiuses - low quality light and high quality light distances
- The base light shows the low quality light at a set radius (much smaller attenuation radius and no shadows) [Can be replaced to be rather a volume shader IE fake lighting]
- When in the high quality light it sets to be the high quality light with proper shadows. Makes sure shadows are shown when needed and performance saved
Prop collections