πBiomes Settings
Last updated
Last updated
Biomes in TerraForge 2 play a crucial role in creating diverse and realistic terrains. Unlike traditional terrain generation methods that use static templates or pre-made stamps, TerraForge 2 employs biomes to define the procedural rules for terrain formation. Each biome encapsulates specific noise and erosion settings, which dictate the topographical features of the terrain, such as hills, valleys, mountains, and plains. When creating a grid of terrains, biomes ensure that each terrain cell can have distinct features, enhancing the visual diversity and realism of large terrain areas.
Create Biome Settings Asset: Right-click in the Project window and select Create > TerraForge 2 > Biome Settings
. This action creates a new BiomeSettings
asset in your specified directory.
Configuring a New Biome: To set up a new biome, first select the newly created biome file in the Project window. This will open the biome settings in the Inspector window, where you can customize it according to your requirements. Adjust the Biome Name to identify the biome, set the Terrain Height to define the elevation characteristics, and configure the Terrain Layers. Additionally, modify the Hydraulic Erosion Layer Settings to control erosion effects.
Previewing Biome: To open a preview of how the biome affects terrain generation, select the biome file in the Project window and then click the Show Preview Biome
button in the Inspector window. This action will open a special terrain prefab to view the biome, applying biome settings such as terrain height, terrain layers, and hydraulic erosion settings to the TerraForge Terrain Generator
component. The preview will be displayed within the Unity Editor, allowing you to see a real-time representation of the biome's impact on the terrain. You can also change the generation parameters in preview mode and then save them to the same biome using the Apply the changes to Biome
button in the inspector window.
Applying Biome Settings: After configuring and previewing your biome, you can use it within the TerraForgeTerrainsGridGenerator
component. The biome settings can be applied to the TerraForgeTerrainsGenerator
component via the Load Biome Settings Window
. This allows for the procedural generation of diverse and realistic terrains based on the rules defined in your custom biome settings.
ApplyingBiomeSettings
: Applies the settings to a TerraForgeTerrainGenerator
and updates the terrain game object accordingly.
ShowPreviewBiome
: Instantiates a preview of the biome using a prefab and applies the biome settings for visual inspection.
ClosePrefabView
: Closes the currently open prefab view if any.
BiomeSettingsEditor Script:
BiomeSettingsEditor.cs
Provides a custom editor for the BiomeSettings
class in Unity. It allows users to configure biome properties through a user-friendly interface.