To quickly create a voxel world, use the VoxelForgeSubsystem
class. Call its Create Level
function in Blueprints or C++.
Prerequisite: Configure global settings using Set Voxel Global Setting Override
.
Material: Use the default material Material/M_VoxelChunkInstance
from plugin content.
Texture Resource Setting:
Texture Array
parameter and disable Use Outside Directory Textures
. A sample array is provided in Material
folder.Use Outside Directory Textures
and specify path in Outside Directory Textures Path
. Example:D:\\Project\\AstralReactor\Plugins\\VoxelForge\\Resources\\DefaultTextures\\
(Use absolute path or relative path).Outside Texture Size X/Y
according to texture dimensions. Use "Nearest" filter for Minecraft-style sampling.Block Register: Use provided BP_DefaultBlockRegister
(customization explained later).
After configuration, call Create Level
with parameters:
Launch PIE to see generated world:
Actors with Voxel Player Component
gain chunk loading/unloading capabilities.
Voxel Player Component
to your player blueprintUpdate Surrounding Chunks
(no need for Tick call - smart throttling included)Template/VoxelPlayer
:Key functions:
Voxel Line Trace: Returns hit block position and ID.
Outside Pos
: When enabled, returns adjacent position for block placementSet Block Immediately: Updates block at world position. Predefined IDs:
Vanilla::Air
, Vanilla::Grass
, Vanilla::Stone
, Vanilla::Log
, Vanilla::Leaf
Create Blueprint child of Voxel Block Register
and override in global settings.
Each block requires:
Vanilla::Grass
)Block
or Air
)Texture Ordering: For external textures, name files numerically (e.g., 00001-GrassSide.png
) to ensure correct array indexing.
C++ Registration: Add built-in blocks in VoxelForgeSubsystem.cpp line:133
:
SetVoxelBlock({TEXT("Vanilla"), TEXT("Grass")}, FBlock_Grass());
SetVoxelBlock({TEXT("Vanilla"), TEXT("Stone")}, FBlock_Stone());
Remove corresponding entries from Blueprint registers after C++ implementation.
Language: 中文 | >English< Introduction This library currently includes over 60 new blueprint nodes and…