Skip to main content

Planet Generation

Overview

This documentation introduces the related features of the planet generation and shows how to create it in the Flexi Engine.

Planet Data Structure

Generated planet data structure:

image-20230217104139022

Planet Generation Tools

Five tools are included:

  • Voxel Material
  • Voxel Object
  • Voxel Object Generator
  • Voxel Ecology
  • Voxel Terrain

Voxel Material

Creating Materials

Create surface materials for the planet with the Voxel Material tool.

Right-click on the blank space of the Resource Preview window to open the Shortcut Menu. Click Create Res -> Voxel -> Voxel Material, and then enter a name in the pop-up window. Click OK to complete the creation of the Voxel Material file (.vmtl).

image-20230307155123637

image-20230307154946128

The created Voxel Material file:

image-20230307155100142

Double-click the file to open its editing window.

2023-07-04_162408

Material Properties

The related properties of the material can be edited in the Edit Material panel of the material editing window.

image-20230307155624952

PropertyDescription
ShaderThe rendering level used by this material (The larger the value, the higher the rendering accuracy).
UV ScaleEqual scaled texture UV.
HardnessThe hardness of the material, which is related to the mining feature in the game.
DiffuseDiffuse color.
Diffuse MapThe original color and reflection information of the material surface.
Enable Normal MapEnable normal maps.
Normal IntensityTexture details of the material (The larger the value, the higher the LODs).
Normal MapThe map created by the high poly model, which is used to present more level details of surface bump on the bottom mold.
Detail UV ScaleControl the size scaling of close detailed material UVs.
Detail Diffuse MapThe original color and reflection information of the close detailed material surface.
Detail Normal MapThe map created by high poly model, which is used to present more level details of surface bump in the close detailed bottom mold.
MetallicSpecular reflection and diffuse reflection light ratio with the value range from 0-1. The closer the value is to 1, the more similar it is to metal.
Detail Metallic MapBlend map that affects close detailed Metallic, Roughness and Specular.
RoughnessThe roughness of the material surface with the value range from 0-1. The smaller the value, the more obvious the diffuse reflection of the material, and the smoother the surface.
Specular LevelSpecular intensity (The higher the value, the more obvious the light reflected by the material).
Enable Relief MapEnable relief map.
Detail Relief MapThe map with height information in the channel, which defines the height of the model surface in pixels.
Relief Map Height ScaleThe larger the value, the greater the height change.
Enable Relief Map Self-ShadowThe shadow produced by generating height after enabling the relief map in the scene of the level.
Enable Relief Map Depth CorrectEnable depth correction for relief maps in the scene of the level.
Material CategoryMaterial category.
Box Side MaterialThe side material of the box voxel.
Box Bottom MaterialThe bottom material of the box voxel.

Editing Materials

Drag the map file (.tif/.dds/.basis/.png/.veco/.ico) from the Project panel into the Diffuse Map slot in the Edit Material panel.

image-20230703151900932

Continue to add Detail Diffuse Map in the same way as above.

image-20230703151852225

Modify the UV Scale and Detail UV Scale values. Choose the value that has been set in the drop-down box, or enter the value manually.

Note: The value of UV Scale cannot exceed 1. The calculation method of planet UV is different from that of object UV. The calculation methods of planet material UV are 1/8, 1/16, 1/64, 1/128, 1/256. These UV Scale values can be quickly selected in the drop-down box.

image-20230307155815235

The effect is as shown below:

image-20230703142523715

Add a bump effect. Add a Normal Map in the same way as adding a Diffuse Map, and then check Enable Normal Map.

image-20230703142636039

Add a Detail Metallic Map. Adjust the Metallic and Roughness values to change the metallicity and smoothness of the surface material.

2023-03-01_111510

Add bump details. Add a Detail Relief Map in the same way as adding a Diffuse Map, and then check Enable Relief Map. Adjusting the value of the Relief Map Height Scale can change the relief intensity.

image-20230703142717129

Click the image-20230217170005306 button to save the currently edited material.

Voxel Object

The Voxel Object can be used when creating the Voxel Object Generator, and the created Voxel Objects will be automatically saved in the Object Library. Currently, the Flexi Engine provides two ways to create voxel objects.

Converting XMOD Files to Voxel Object Files

Find the XMOD file in the Project panel, right-click it to open the Shortcut Menu, then select Convert To Voxel Object With The Same Name, and a Voxel Object file (.vobj) will be generated.

image-20230306155011707

image-20230306163525055

Double-click the Voxel Object file (.vobj) to open its editing window.

image-20230306163543767

Creating Objects

Objects can also be created directly in the Resource Preview window. Right-click on the blank space here to open the Shortcut Menu. Click Create Res -> Voxel -> Voxel Object, and then enter a name in the pop-up window. Click OK to complete the creation of the Voxel Object file (.vobj).

image-20230703162149253

image-20230703162157419

After creation:

image-20230703162223255

Double-click the Voxel Object file to open the Object Editor.

image-20230703162345527

Drag the .xmod file from the Project panel to the Resource slot of the Object Editor and click Save to finish the creation.

image-20230703162647667

Editing Tags

In the Edit Object panel of the Voxel Object editing window, click the image-20230217183853532 button to select a tag or click the "+" button to add a new tag to assign to the object. With the tag, you can subsequently filter all the objects under the tag in the Object Library.

image-20230220142405536

Tag related operations:

image-20230220142644800

No.Description
1Cancel the tag.
2Delete the tag.
3Confirm to delete the tag.

Object Properties

image-20230217184758645

Setting ItemPropertyDescription
Internal PropertyResourceSelect the resource.
Clip RadiusClip radius.
MassMass.
Scale XScaling in the X-axis direction.
Scale YScaling in the Y-axis direction.
Scale ZScaling in the Z-axis direction.
Scale Disturb MinThe threshold for minimum volume change of the object after random generation.
Scale Disturb MAXThe threshold for maximum volume change of the object after random generation.
Normal DirectionDetermine the extent to which the model grows along the normal direction of the ground at its location.
Angle Range MinThe threshold for the minimum angle change of the object after random generation.
Angle Range MaxThe threshold for the maximum angle change of the object after random generation.
VoxelsVoxel occupancy point.
Physics TypeSelect the physics type of the object.
No ShadowCancel the display of the object's shadow effect.
Vertex ColorVertex color.
Need CallbackWhether to receive callbacks or not. Used to implement logic features such as creating NPC triggers.
Server OnlyOnly read by the Server. Used to implement Server logic features.
Custom PropertyActionAdd custom properties about the action to the data block.

Voxel Object Generator

Creating Object Generators

Add objects (such as foliage) whose distribution can be customized to the planet with the Voxel Object Generator tool.

Right-click on the blank space of the Resource Preview window to open the Shortcut Menu. Click Create Res -> Voxel -> Voxel Object Generator, and then enter a name in the pop-up window. Click OK to complete the creation of the Voxel Object Generator file (.vog).

Note: If the name of the created Voxel Object Generator is the same name as that of the Voxel Material, and both are in the same directory, the objects in the Object Generator will be automatically generated on the surface material.

2023-03-01_113455

image-20230703110514109

The created Voxel Object Generator file:

image-20230703134616228

Double-click the file to open its editing window.

image-20230703144542701

Editing Object Generators

image-20230703144703611

No.NameDescription
1Menu BarProvide features including Save, Layout, Open Directory and Debug LOD.
2Tool BarUsed to return to the main window of the Object Generator, save and generate object generators, and generate thumbnails of the object generator files.
3Preview WindowUsed to view the effect of object generation distribution.
4Object LibraryUsed to select objects to be added from the Object Library.
5Edit Object Generator Panel
Edit Template Panel
Used to add objects in different Distribution Templates and set their distribution ratios.
Used to control the density and LODs of the generated objects.
Edit Template Panel

There are five editable default Distribution Templates provided initially by the Engine. New templates can continue to be added.

image-20230703144653179

Click the image-20230217142052575 button to add new templates and set the related properties in the pop-up window. Then click OK to complete.

image-20230703144742452

Template properties:

PropertyDescription
Template NameName of the template.
LODThe maximum range level randomly generated by the mesh (The number at the end of the name should be consistent with the LOD level).
Spawn RangeSpawn range of the Distribution Template.
FrequencySpawn frequency.

Click Tool -> Debug LOD to view the LOD distribution.

image-20230703143814097

The LOD distribution effect is as shown below:

2023-03-02_111543

No.Description
1LOD0
2LOD1
3LOD2
4LOD3
5LOD4

The Display Range and Area Ratio of LOD are as follows:

2023-03-02LOD

Filtering Objects

Objects can also be filtered according to tags in the Object Library of the Object Generator. Click the image-20230220145313730 button to select a tag to filter all the objects under the tag in the Object Library, so that you can find the desired object and add it later.

image-20230703143949249

Object Generation

Drag the Voxel Material into the MtlRef in the Preview panel from the Project panel. Click the Generate button to assign the surface material. This material is only for effect reference and has no effect on the object generator itself.

image-20230703141926358

Drag the object into the Distribution Template in the Edit Object Generator panel from the Object Library.

If there are no needed objects in the Object Library, you can create Voxel Objects by yourself. For related content and operations, please refer to Voxel Object in this document.

image-20230703144300585

The generation ratio of the object can be set in the Distribution Template. Click the Generate button after setting and the effect will be displayed in the Preview window.

image-20230703144417387

Voxel Ecology

Creating Ecologies

Create ecologies for the planet with the Voxel Ecology tool.

Right-click on the blank space of the Resource Preview window to open the Shortcut Menu. Click Create Res -> Voxel -> Voxel Ecology, and then enter a name in the pop-up window. Click OK to complete the creation of the Voxel Ecology file (.veco).

Note: If the name of the created Voxel Ecology is the same name as those of the Voxel Material and the Voxel Object Generator, and all of them are in the same directory, the ecology will automatically match and use the material and object generator.

image-20230703110900281

image-20230703111048814

The created Voxel Ecology file:

image-20230703111243400

Double-click the file to open its editing window.

2023-07-05_143351

Editing Ecologies

2023-07-05_143352

No.NameDescription
1Menu BarProvide features including Refresh and Layout.
2Tool BarUsed to return to the main window of the Ecology Editor, save and generate ecologies, generate thumbnails of ecology files, and dig down the surface.
3Preview WindowUsed to view the effect of ecology.
4Manage Material Panel
Manage Object Generator Panel
Used to display all Voxel Material files.
Used to display all Voxel Object Generator files.
5Edit Ecology PanelUsed to edit the related properties of ecology.
Ecology Properties

2023-07-05_143353

PropertyDescription
Material ReferenceSelect the surface material of the ecology.
Foliage ReferenceSelect the object generator of the ecology.
Soil InfertilityControl the proportion of this ecology in this area according to the area on the planet that matches the selected Humidity and Temperature.
TemperatureFilter materials and object generators based on Temperature.
HumidityFilter materials and object generators based on Humidity.
Underground Ecology Start PositionThe start position of the underground ecology.
Underground Ecology BlendAffect the blend relation between the original surface ecology and the underground ecology.
Underground Ecology End PositionThe end position of the underground ecology.
Underground Ecology NameThe name of the underground ecology.

The material and object generators of the ecology can be modified under the Material Reference and Foliage Reference in the Edit Ecology panel. Or replace them by dragging the material and object generators from Manage Material and Manage Object Generator to the corresponding slots.

image-20230703113000586

Double-click the slots under Material Reference and Foliage Reference to directly enter the corresponding material or object generator editing interface.

image-20230703113049066

The surface can be dug down or filled up in the Ecology. Select an object generator in the Manage Object Generator panel and drag it into the Underground Ecology Name slot in the Edit Ecology panel. The related properties including Underground Ecology Start Position, Underground Ecology Blend, and Underground Ecology End Position can be modified as needed. Click the Generate button after modification to take effect. Then click the image-20230217160623644 button in the Tool Bar to dig down the surface (reduce voxel) by Left-click, or fill up the surface (add voxel) by Ctrl + Left-click. Click Save after confirming.

2023-07-05_143354

Voxel Terrain

Creating Voxel Terrains

Create a planet and edit its surface and ecology with the Voxel Terrain tool. Planet types are Sphere, Flat Terrain, Cube, Planetary Ring and Math Expression.

Right-click on the blank space of the Resource Preview window to open the Shortcut Menu. Click Create Res -> Voxel -> Voxel Terrain, then select Init Data Type and Mesh Data Type, and enter Terrain Name in the pop-up window. Click OK to complete the creation of the Voxel Terrain file (.vter).

image-20230703152712302

image-20230306173951614

The created Voxel Terrain file:

image-20230703152805883

Double-click the file to open the Gen Planet window.

2023-03-06_154106

No.NameDescription
1Menu BarProvide features including Save, Layout and etc.
2Tool BarSee the Tool Bar section for details.
3Preview WindowUsed to preview effects of the edited surface and ecology of the planet.
4Surface Panel
Ecology Panel
Used to edit properties of the planet's surface.
Used to add ecologies to the planet.

Tool Bar

image-20230217165757328

IconDescription
image-20230217165836668Create a Voxel Terrain.
image-20230217165905788Open a Voxel Terrain.
image-20230217165932968Save.
image-20230217170005306Save as.
image-20230217170026852Generate a terrain.
Click the button after modifying properties, and the planet will change accordingly. The effect after each generation can be viewed in the Preview window.
image-20230217170117124Used to view the profile information of the planet.
image-20230217170134759Generate a planet randomly.
image-20230217170153854Generate a Voxel Terrain file thumbnail.

Surface Panel

Properties related to the planet's surface can be edited in the Surface panel.

image-20230307131850900

Setting ItemPropertyDescription
Voxel ConfigPlanet RadiusPlanet radius.
AmplitudeThe relief of the terrain.
Noise FrequencyThe density of mountains within a certain range.
Enable The SeaWhether the planet has seas.
Sea HeightSea height.
Ocean StatisticsOcean-to-land ratio.
Distant Sea ColorSea color in a distant view.
AdvancedTopography TypeControl the planet's topographical features.
Max LOD LevelMaximum number of LOD levels.
Geological Ecology TypeGeological ecology type (e.g. Cube is a cube generated from 3 dimensions, Soil Infertility, Temperature and Humidity).
Plate TypePlate type.
Plate CountPlate count.
Plate Random SeedThe location of each plate control point used to generate.
Init Data TypeVoxel scene type.
Mesh Data TypeMesh data type.
Freezing Point TemperatureControl whether ecologies, mountains or sea water, etc. are frozen (e.g. If the temperature of the sea is below this value, then it will become a glacier).

Ecology Panel

You can add ecology to the planet in the Ecology panel. According to the set Soil Infertility, Temperature and Humidity ranges of the ecology, the Engine will automatically complete the distribution of the ecology on the planet.

image-20230703150637354

No.NameDescription
1Filtering EcologyBy selecting Soil Infertility, Temperature and Humidity levels, the eligible ecologies are filtered in the Ecology Library below.
2Ecology LibraryDisplay all self-built ecologies and default ecologies in the project.
3Planetary Ecology PanelDisplay all ecologies used by the current planet with the default ecologies in red.
4Ecology PanelSet Soil Infertility, Temperature and Humidity ranges of the planet's ecology.

Replacing Default Ecologies

Check the Show Engine Resource button to show the 53 Engine default ecologies. The default ecologies which are displayed in red will be automatically distributed on the planet according to the parameters when creating the planet. They are located in the Engine Directory and cannot be deleted, but can be replaced with other self-built ecologies.

image-20230703150647851

Drag the ecology in the project to a default ecology in red to replace it. After selecting the default ecology, its ecology path can be viewed in the GeoName in the Ecology interface below.

image-20230630160214372

Adding Ecologies

Drag the Voxel Material to be added to the planet into the Planetary Ecology panel.

image-20230703113839018

After dragging:

image-20230703113954793

Or directly right-click the needed ecology and select Add Ecology to finish adding.

image-20230703151101503

Set Soil Infertility, Temperature, and Humidity ranges for the ecology in the Ecology panel. For example, the newly added Test ecology has more unfertile soil, more moderate temperature, and higher humidity.

image-20230703131356910

Click the Generate button when settings are done.

image-20230703151307293

The effect of multiple ecologies:

image-20230703151204268

To delete an unwanted ecology from the planet, right-click the ecology to be deleted in the Planetary Ecology panel, select Delete Ecology, and click the Generate button.

image-20230703151415040

How to Create Planets

Creating Planetary Rings

Create a Planetary Ring Voxel Terrain in the same way as creating a planet by using the Voxel Terrain tool. Select Planetary Ring in Init Data Type and select Smooth in Mesh Data Type.

image-20230220131048922

After creating:

image-20230217205419178

Double-click the Voxel Terrain file to open its editing interface. The radius of the Planetary Ring should be larger than that of the planet. You can increase the values of Elliptical Torus Radius X and Elliptical Torus Radius Z as well as Elliptical Torus Pipe Radius X and Elliptical Torus Pipe Radius Z. Click the Generate button and the Save button. You can add ecologies to the Planetary Ring in the Ecology panel.

image-20230703151541444

Placing Planets and Planetary Rings in the Level

In the Component Editor, click File -> New Level From Template, then select the planet_template in the pop-up Open Level window, and double-click it to enter the level.

image-20230307130529944

image-20230217211605511

In the Resource Preview window, find the created terrain file (planet) and drag voxel_manager.vter into the Level panel.

2023-03-01_165820

After dragging, the planet can be seen in the Level panel and a Voxel Terrain Object and a Planet Atmosphere Object will appear in the Hierarchy panel.

2023-03-01_171754

Drag the Planetary Ring into the Level panel in the same way, select the Planetary Ring Voxel Terrain Object in the Hierarchy panel, then in the Transform property of the Inspector panel, set the Position of the Planetary Ring to match the planet.

2023-03-01_173749

Zoom in to see details of the planet's ecology.

image-20230220131716652