# TerraVox Ground that players dig and build in, made for multiplayer: Unreal Engine 5.6, 5.7 and 5.8, Windows and Linux. A key press digs; every client sees the same hole; it's still there after a restart. - **The server decides.** A client shows its own dig at once and the server checks it: reach, pace, tool, a quota per minute, zones nobody may touch. What it refuses is taken back on that client. Ore can be hidden from clients until it's dug up, and an operator can roll back what one player did. - **Dig into the level you have.** A surface patch makes part of your Landscape (or mesh ground) diggable; the rest of the level stays as it is. - **Or let it make the ground**: terrain from presets and heightmaps, with biomes, caves and ore, in a box of your size or with no edge at all. - **Saved by itself**, a file per volume, with a format that's checked on load and kept readable across versions. - **Blueprint or C++.** The template digs with no code of yours; everything a game needs to react to is an event. (Packaging the game needs Visual Studio, as with any code plugin: see [Limitations](#limitations).) **Platforms:** Windows x64 and Linux on UE 5.6, 5.7 and 5.8; Windows ARM64 on 5.7 and 5.8 (compiled, not yet run on ARM hardware). The Fab download is built for Windows x64; Linux and ARM64 build from source with your game (a C++ project), and Linux was run without a renderer only (a server or a test client). Not Mac, iOS, Android or consoles (see [Limitations](#limitations)). Voxels are smooth: each one stores how much of it is rock, so walls, slopes and dig marks follow the real shape instead of stepping one voxel at a time. The same voxels can be drawn three ways: smooth, in flat-shaded facets, or as blocks for a cube world, with water and lava (see [Three looks](#three-looks-smooth-faceted-or-blocks)). What you place in a level: | Actor | What it is | Typical use | |---|---|---| | **TV Interior Volume** | A private closed space of rock the player is teleported into. Not placed: the digger component makes each player's own (its **Interior Volume Class**). | Burrows, personal mines, pocket dimensions. | | **TV Voxel Block** | A solid box or ellipsoid placed in the world (or spawned), dug from outside or inside. | Rocks, walls, mounds, breakable obstacles. | | **TV Voxel Terrain** | Diggable ground from a preset (hills, mountains, canyon, islands, dunes, mesas, river valleys, flat) or an imported heightmap. | Diggable landscapes, arenas, islands. | | **TV Voxel Mesh** | Any static mesh turned into diggable voxels. | Statues, ruins, custom rocks. | | **TV Surface Patch** | Makes an area of an existing Landscape (or static mesh ground) diggable. | Dig into your own level's terrain. | | **TV Terrain World** | Ground with no edge: makes TV Voxel Terrains tile by tile around the players and lets them go behind. | Open worlds, block worlds. | And on those, as components: **TV Fluids** (water and lava on a volume), **TV Digger Component** (what a pawn digs and builds with), **TV Character Movement** (mud slows, snow slides, water floats). **Which one?** A level you already have, with a Landscape: a **TV Surface Patch** where digging should work. Ground made for digging, of a size you choose: a **TV Voxel Terrain**. Ground that never ends: a **TV Terrain World**. A rock, a wall, a boss arena's pillar: a **TV Voxel Block** or a **TV Voxel Mesh**. A mine or a burrow per player, apart from the level: a **TV Interior Volume**. **Contents:** [Quick start](#quick-start) · [Try the example first](#try-the-example-first) · [Making it yours](#making-it-yours) · [A world with no edge](#a-world-with-no-edge) · [Blueprint only](#blueprint-only) · [Three looks](#three-looks-smooth-faceted-or-blocks) · [Water and lava](#water-and-lava-tv-fluids) · [Performance](#performance) · [Networking](#networking) · [Limitations](#limitations) · [Voxel materials](#voxel-materials) · [Editing in the editor](#editing-in-the-editor) · [AI navigation](#ai-navigation) · [Sculpting](#sculpting) · [Stamps](#stamps) · [Undo and redo](#undo-and-redo) · [Dig effects](#dig-effects) · [Cave-ins](#cave-ins) · [Explosions](#explosions) · [Building](#building) · [The digger component](#the-digger-component) · [Settings shared by every volume](#settings-shared-by-every-volume) · [Interior volumes](#interior-volumes) · [Voxel blocks](#voxel-blocks) · [Voxel terrain](#voxel-terrain) · [Voxel meshes](#voxel-meshes) · [Foliage](#foliage) · [Surface patches (dig into a Landscape)](#surface-patches-dig-into-a-landscape) · [Reacting to changes (Blueprint)](#reacting-to-changes-blueprint) · [Saving](#saving) · [Blueprint nodes at a glance](#blueprint-nodes-at-a-glance) · [How do I...](#how-do-i) · [Console](#console) · [Troubleshooting](#troubleshooting) · [Tests](#tests) · [Support](#support) · [Version history](#version-history) ## Quick start **In 30 seconds:** 1. Enable the plugin (Edit > Plugins > TerraVox) and restart the editor. 2. In the Content Browser's Settings tick *Show Engine Content* and *Show Plugin Content* (Fab installs the plugin into the engine; copied into your project's Plugins folder instead, *Show Plugin Content* is enough), and open **TerraVox Content / BlueprintTemplate / Maps / TerraVoxTemplate**. 3. Press Play: left mouse digs, right mouse builds. **In your own level:** 1. World Settings > **GameMode Override**: `BP_TerraVoxTemplateGameMode`. You now play as the template's pawn, a first-person pawn with a plain cylinder for a body (so players see each other), not your own character: fine for a first look. To dig with your own character leave the GameMode alone and follow "without the template" below. 2. Drag in a **TV Voxel Terrain** from Place Actors (Window > Place Actors, or the toolbar's **+**; TerraVox has its own tab). On a level made from *Open World* there is a Landscape in the way: start from *Basic*, or see *Surface patches* to dig into the Landscape itself. It's 60 x 60 x 24 m around where you drop it; its ground lies from about 7 m below that point to half a metre above (the viewport shows it). Its sides are closed by invisible walls, so nobody walks off the edge: **Edge Walls** in its Details turns them off. 3. Keep the PlayerStart above the ground, or players start inside the rock. A *Basic* level and the Third Person template's map both come with a **Floor** actor: delete it, it covers the ground and digging there opens nothing you can see. 4. Press Play. 5. Two players: Play menu > **Number of Players** 2 and **Net Mode: Play As Listen Server**. Each sees the other's digs. Saving is on already: stop, press Play again and the holes are back. To start clean, delete `Saved/SaveGames/TerraVox_*.sav` in your project. The template is Blueprint only (see *Blueprint only*); copy it into your project to change it. Without the template, step by step: 1. Enable the **TerraVox** plugin (Edit > Plugins, search TerraVox, tick it, restart the editor; it enables Procedural Mesh Component and Enhanced Input). Its content is under *All > Engine > Plugins > TerraVox Content* in the Content Browser. 2. Add a **TV Digger Component** to your character. 3. It comes with the plugin's input already set: its actions (`IA_Dig`, `IA_Build`, `IA_EnterExit`...) and `IMC_TerraVoxDigger`, which maps them to keys (left mouse / E dig, right mouse / Q build, F paint, R sculpt, T brush, G material, Z / X undo / redo, K interior), from *TerraVox Content / Defaults / Input*. The component binds itself when the pawn is possessed; press Play and dig. Painting, sculpting, interiors and undo are off until you tick **Allow Paint**, **Allow Sculpt**, **Allow Interiors** and **Allow Undo** (pressing one that's off says so once, in the log and, in development builds, on screen). With your own input, set your own actions (Digital/bool) and context there, or clear them and call **Request Dig**, **Request Build**... yourself. **Dig Pitch Offset** (10°) lifts the aim for a camera above and behind the pawn; set it to 0 for a first-person camera, or digs land above the crosshair. Also for first person, tick **Dig At Aim**: digs land where the crosshair meets the ground (within reach) instead of starting at the pawn's body. 4. Drag a **TV Voxel Block** or **TV Voxel Terrain** into your level from Place Actors (Window > Place Actors, or the toolbar's **+**; TerraVox has its own tab), press Play and dig. Keep the PlayerStart above its ground, and delete the level's **Floor** first if it has one (a *Basic* level and Unreal's own Third and First Person template maps do: it covers the ground). For interiors, tick **Allow Interiors** and press your Enter Exit key (or run `TV.EnterExitInterior`): you are moved into your own interior 2 km above you. Press it again to come back. The component digs or builds in whichever volume is in front of the pawn: the one it stands in, or a block / terrain within reach. A new terrain looks like grass over dirt over stone out of the box (the plugin's textured sample materials); blocks, interiors and voxelized meshes are filled with their **Fill Material** (2, stone, unless you set 0 for grass or 1 for dirt; with fewer materials than that, the first one). Give them your own look with a **Palette** (see *Voxel materials*). Nothing happens when you press dig? See *Troubleshooting*. **Off until you turn it on.** Each of these does nothing with the defaults, most of them without a message: | What | Where to turn it on | |---|---| | Paint, sculpt, interiors, undo / redo | Digger component: **Allow Paint**, **Allow Sculpt**, **Allow Interiors**, **Allow Undo** | | Ore drops and pickups | A **Palette** on the volume with a **Drop Class** on the ore's entry (a volume without a palette drops nothing) | | Hard and unbreakable rock, tool tiers | The palette's **Hardness** / **Min Tool Tier**; the digger's **Tool Tier** and **Dig Power** | | Dig To Build (digging pays for building) | Digger component: **Supply Mode** | | Caves | Terrain: **Caves**, or several kinds with **Cave Layers** | | Cave-ins | Volume: **Max Unsupported Span** above 0 | | Foliage | Volume: **Foliage** list | | Ground that slows or slides the pawn | Digger component: **Surface Affects Movement**, and the palette's **Walk Speed Scale** / **Friction** | | Detail cross-fade | Volume: **Lod Fade Seconds**, with a Masked material (see *Performance*) | | Hidden veins, protected zones, quotas, operator rollback | See *Voxel materials*, *The digger component* and *Undo and redo* | | A digger on anything but a Pawn | It only works on a Pawn (it says so in the log) | ## Try the example first Open **TerraVox Content / Example / Maps / TerraVoxExample** (enable *Show Engine Content* and *Show Plugin Content* in the Content Browser) and press Play. Left mouse digs, right mouse builds, F paints, hold R to sculpt, G / T pick the material / brush, B throws a grenade, V drops a boulder, M switches the supply mode, Z / X undo and redo, K takes you to your own underground room, F3 shows debug info (frame time, the volume aimed at, its dug chunks - the 16-voxel blocks dug ground is kept in -, meshes, queued work and predictions, and `TV.Voxel.Debug`'s bounds and dig shape). Left Shift runs and H flies (the example character's **Can Fly**, which the server enforces). Tab lists every key on screen. Everything there is ordinary content you can copy into your project (paths under *TerraVox Content*): | Asset | What it shows | |---|---| | `Example/BP_TerraVoxExampleCharacter` | A first-person character with a TV Digger Component, every action set in its Details panel, and a TV Inventory that collects the gold digs drop (the HUD lists it). Its Event Graph prints the gold a dig yields (the component's **On Dug** event, when there's gold), and B / V / M call Throw, Drop Boulder and Switch Supply Mode. It allows undo to show it off: undo and redo are reported through On Built / On Dug, so a game that pays in On Dug must also charge in On Built, or turn **Allow Undo** off. | | `Defaults/BP_TerraVoxInterior` | The underground room K takes you to: a TV Interior Volume child with its own size, cavity and a gold vein (the character's digger component points at it). | | `Example/BP_TerraVoxExampleGrenade` | A grenade whose Event Graph is the whole recipe: **Delay**, then (on the server) **Explode** where it lies, then **Destroy Actor**. | | `Example/BP_TerraVoxExampleBoulder` | V drops it: its Event Graph **Stamp Shape**s a stone rock where it lands, with the boulder as **Author** (its thrower's rules apply, it never buries anyone, and the rock is reported to the thrower through On Built). In Dig To Build (the supply mode where digging earns what building spends) a boulder costs a build's supply. Where blocks come out of the inventory (a Blocks volume, the character's **Blocks Use Inventory** on) there's no boulder: its rock would be blocks for nothing. | | `Example/SM_TerraVoxExampleGrass`, `M_TerraVoxExampleGrass` | The terrain's **Foliage**: grass on the grass layer only, gone where the ground is dug. | | `Example/BP_TerraVoxExampleGameMode` | Picks that character; its HUD prints the keys, the build material, the brush and the supply. | | `Defaults/Input/IA_*`, `IMC_TerraVoxMovement`, `IMC_TerraVoxDigger` | Enhanced Input actions and the two mapping contexts (moving, with F3 for the debug panel; digging: the TV Digger Component's defaults). The example character's own keys (B throw, V boulder, M supply mode) are in `Example/Input`. | | `Defaults/PA_TerraVoxSamples` | A voxel palette: grass, dirt, stone and gold, each with its textured look, hardness and sounds. | | `Example/Maps/TerraVoxExample` | A terrain with layers, a gold vein, caves and grass, a voxel block and a voxelized mesh. M switches the digger between **Free** and **Dig To Build** (digging earns the supply building spends; the HUD shows it). | | `Example/Maps/TerraVoxExample_Biomes` | One terrain of plains, desert and marsh, snow on the heights: each biome its own layers and look, sand and mud that slow you down, slippery snow (palette `PA_TerraVoxBiomes`). See [Voxel materials](#voxel-materials). | | `Example/Maps/TerraVoxExample_World` | Ground with no edge: a TV Terrain World making tiles of the biome ground as you walk, cave-ins on, and a protected zone 20 m ahead of the start. See [A world with no edge](#a-world-with-no-edge). | | `Example/Maps/TerraVoxExample_Blocks` | The Blocks style: a terrain of 1 m cubes with pixel textures (palette `PA_TerraVoxBlocks`), trees made of blocks, lakes in the valleys, and water and lava to place (Y and U; I takes it back). Left and right mouse dig and build one block: what you dig goes into your inventory, the hotbar along the bottom shows it (1 to 9 or the wheel pick the block to build with), and a build takes one. See [Three looks](#three-looks-smooth-faceted-or-blocks) and [Water and lava](#water-and-lava-tv-fluids). | | `Example/Maps/TerraVoxExample_BlocksWorld` | The same block ground with no edge: a TV Terrain World whose tiles are `BP_TerraVoxBlocksWorldTile` (the Blocks terrain's settings, with TV Fluids on it), so the biomes, trees, ores and lakes go on as you walk and water runs across the tiles' seams. | | `Example/Maps/TerraVoxExample_Stylized` | The Stylized look: the biome ground drawn in flat-shaded facets and plain colours (palette `PA_TerraVoxStylized`, material `M_TerraVoxFlat`). | | `Example/Maps/TerraVoxExample_Custom` | Ground of your own with nothing but settings: hills, a range of ridges and gullies from three **Height Layers** over a Flat preset, oaks and huts that are **TV Voxel Structure** assets (`VS_TerraVoxExampleOak`, `VS_TerraVoxExampleHut`) beside a built-in pine, and a sand path painted by a material map. Every bit of it is a setting on the terrain actor in the map. See [Voxel terrain](#voxel-terrain). | | `Example/Maps/TerraVoxExample_Presets` | The newer presets in a row, in blocks, with their water: **River Valleys** (where you start, a river in its bed), **Archipelago** (islands in a sea, sand on the beaches and grass above), **Mesas** (a lake in the low ground between the steps) and **Dunes** (dry). Each sea is a TV Fluids **Sea Level**. Walk east from one to the next. | | `Example/Maps/TerraVoxExample_PresetsSmooth` | The same four in the smooth style (half-metre voxels, no trees). The water is drawn as a sheet here (TV Fluids' **Draw As Sheet**), so it meets the smooth shore on a clean line. | | `Example/Maps/TerraVoxExample_Shaped` | Ground shaped by hand, no C++: terraces from a Blueprint **Generator** (`BP_TerraVoxExampleTerraces`, two nodes in its Get Height), rock, snow, sand and mud laid by **Material Rules**, tunnels and caverns from **Cave Layers**, and five **TV Terrain Stamps** to move about: a hill, a quarry, the stone pad you start on, a sand causeway and a crater drawn as a **TV Ground Map** (`GM_TerraVoxExampleCrater`). | | `Example/Maps/TerraVoxExample_SurfacePatch` | Ordinary level ground made diggable in one area by a surface patch (a Landscape works the same). Its ground is a plain colour so you can see where the patch takes over; in your level, give the patch's top material the look of your ground. | **Multiplayer**: in the Play menu set *Number of Players* to 2 and *Net Mode* to *Play As Listen Server* (or Client); dig in one window and watch the other. `Net PktLag=200` in the console shows client prediction at work. **Saving**: digs are saved on their own (every **Autosave Interval**, and when play ends); stop and play again and the holes are still there. Delete `Saved/SaveGames/TerraVox_*.sav` to start fresh. Your underground room (K) is the exception in PIE: it's saved under the player's online id (Steam, EOS...), which PIE doesn't have, so it starts new each time there. ## Making it yours What ships under *TerraVox Content* is there to try things with. None of it is wired into the code beyond being a default you can change: this is where each piece is swapped for your own. | What ships | Where yours goes | |---|---| | Ground looks (the grass, dirt, stone and gold samples) | A **TV Voxel Palette** of your own, set as the volume's **Palette**: one entry per material, with your material in it. Any world-aligned or triplanar material works (`MF_TerraVoxTriplanar` is there to build one with). See [Voxel materials](#voxel-materials). | | Soft edges between materials | The volume's **Blend Material**; empty it for hard edges. | | Dig, build and explosion sounds | Each palette entry's **Sounds**; for materials with none, the palette's **Theme** (Dig Sound, Build Sound, Explosion Sound), or the same three on the volume. | | The bits of rock a dig throws | The palette's **Theme > Chip Mesh**, or the volume's **Dig Chip Mesh**. | | All of the above at once | It's all in the palette: make a second one and set it as the **Palette** of your terrains, and the ground's looks, sounds, chips and drops change together. | | What a dig drops | A palette entry's **Drop Class**: a Blueprint child of TV Pickup with your mesh. | | Water and lava | The **Material** of each of TV Fluids' fluid types. | | Trees | Tree Types > **Structure**: a TV Voxel Structure made from your meshes, or from something you built. See [Three looks](#three-looks-smooth-faceted-or-blocks). | | The shape of the ground | A preset with **Height Layers** over it, a heightmap with its **Material Masks**, a Landscape through **Copy Ground**, or **TV Terrain Stamps** placed in the level, a **Generator** of your own, in Blueprint or C++. See [Voxel terrain](#voxel-terrain). | | Grass and props on the ground | The volume's **Foliage** list. | | The character | The **TV Digger Component** on your own pawn; the example character is only a pawn that has one. | | Keys | The component's **Input Mapping Context** and its actions (Dig Action, Build Action...): point them at yours, or leave them empty and call the Request nodes from your own input. | | The underground room | The component's **Interior Volume Class**. | | Where saves go | The volume's **Storage Class**: a database, a cloud save. See [Saving](#saving). | | Who may dig what | `Can Dig In` / `Can Build In` on your pawn, protected zones, the digger's limits. | A whole world of tiles is set in one place: the tile class of the **TV Terrain World** (a Blueprint child of TV Voxel Terrain) holds all of the above for every tile it makes. ## A world with no edge **TV Terrain World** (Place Actors > TerraVox) makes square tiles of terrain around the players as they go, and saves and lets go of the ones they leave behind: walk in any direction for as long as you like. 1. Make a Blueprint child of **TV Voxel Terrain** with your world's look (preset, seed, layers, biomes, veins, palette, caves). They continue from tile to tile, sampled where each tile lies. 2. Place a TV Terrain World and set its **Tile Class** to that Blueprint, then **Tile Size**, **Tile Height**, **Voxel Size** and **Load Distance** / **Unload Distance**. 3. Press Play. The server makes the tiles (~10 ms each: the ones around the player a frame apart, then four a second; the surface built over the next frames) and clients get them like any replicated actor. - In the editor the world shows the tiles around its actor (**Editor Preview Rings**: 1 is the 3 x 3 around it, up to 3 for 7 x 7, 0 for none), so you see the ground the game will have there and can place things on it. They are a preview: not saved, not selectable, and the game makes its own tiles around the players. **Editor Preview Tile** moves the preview to another part of the world (in tile coordinates) without moving the actor, which would move the world itself. The TerraVox brush leaves the preview alone (nothing brushed would be kept): shape a world with its Tile Class's settings, and roads with a **TV Spline Carver** with Carve World Tiles ticked, which the preview shows (change something on the world actor to refresh it after moving a carver). What players dug doesn't show. - **A region drawn by hand.** Make a **TV Ground Map** (Content Browser, Miscellaneous > Data Asset > TV Ground Map), pick its **Heightmap File** (and **Material Masks**, one image per material, if you want it painted) and press **Import Heightmap** / **Import Material Masks**. Set it as the world's **Ground Map**, with **Ground Map Size**: how wide it lies, centred on the world's actor (51200 with a 1024 x 1024 image is a sample every half metre). Inside it the ground is the map's (black = the lowest ground, white = the highest the tile class's relief goes); over **Ground Map Blend** along its edge it eases into the tile class's generated ground, and past it the world goes on as generated. A TV Voxel Terrain takes a Ground Map too (it lies over the terrain's middle). Changing the map, its size or its blend changes the ground, so saves made before don't fit, as with any layout setting. From code: **Set Heights** and **Set Materials** on the asset. - Each tile saves under **Save Id Prefix** plus its coordinates. Empty (the default) is the world's path in its level, so two maps never share saves; set one in World Partition maps. - In a World Partition map the world actor is always loaded, whatever cell it sits in. - **Example / Maps / TerraVoxExample_World** is one: tiles of `BP_TerraVoxExampleWorldTile` (the biome example's plains, desert, marsh, snow and gold, with cave-ins on), and a **TV Protected Zone** 20 m ahead of the start. **Seams.** Neighbouring tiles share a band **Tile Overlap** voxels wide (16): both hold it, each draws its half, and an edit there (a dig, an explosion, a cave-in, an undo...) is copied to the other at once, or when it loads. - A player's tool edits the tile whose half of the band its point is in, so it reaches at most Tile Overlap / 2 - 1 voxels past its point (bigger is cut at the tile's edge: raise the overlap for big tools). Explosions and stamps span tiles on their own. - When two tiles disagree on a band voxel (one was away while the other changed it), the edited one wins. A voxel dug back to exactly its starting state counts as unedited, so a tile made fresh (its save lost) beside a road built by Carve World Tiles and later dug away puts that stretch of road back in the band. - Rock that reaches a tile's side is held up there (the tile can't see what's built past it): a bridge built across a seam never gets cut at it, but a ledge whose last support is dug away only across a seam can stay up. **Things to know.** - The ground ends Load Distance away (fog, or a longer distance, hides it). - The ground's height is worked out in single precision: past ~1,000 km from the world's origin it starts to show steps. - Presets with an edge (islands) are one shape around the world's first tile. - Foliage and edits made through `Carve` from C++ aren't copied across seams. **Spawning on it** (players, loot, creatures): the ground under a point is known once its tile is there. **Line Trace Voxels** straight down from above the ground (the tile's top) to below it hits the surface as it is now, dug holes included; no hit means that tile hasn't been made (or reached this client) yet: try again a moment later. **Get Tile At** gives the tile itself (on the server), **Get Biome At** on it which biome that spot is. ## Blueprint only No C++ is needed to make the game (to package it, Visual Studio is: see [Limitations](#limitations)). **TerraVox Content / BlueprintTemplate** is the core of the example (dig, build, paint, sculpt, the interior, the HUD; not its grenade, boulder and supply mode) with no C++ of its own, to copy into a Blueprint project: `BP_TerraVoxTemplateCharacter` (a Character with a camera, a TV Digger Component set up like the example's, a TV Inventory; its Event Graph adds the mapping context, creates the HUD, moves, looks, jumps, toggles F3 and keeps the digger's **On Dig Hit** for the wear bar), `WBP_TerraVoxTemplateHud` (a UMG widget: keys, material and brush, what's carried, the wear bar under the crosshair and the F3 debug panel, all read in its Event Tick), `BP_TerraVoxTemplateGameMode` and `Maps/TerraVoxTemplate`. In a Blueprint project: 1. Add a **TV Digger Component** to your character Blueprint. Its **Input** fields come set to the plugin's actions and context: keep them, set your own, or clear them and call **Request Dig**, **Request Build**, **Request Paint**, **Request Sculpt**, **Request Undo / Redo** and **Request Enter Exit** from your own input events. 2. For your UI, read **Get Supply**, **Selected Material** (set it, or call **Select Material By Name**) and **Sculpt Mode**, and bind **On Supply Changed**. 3. Volumes are placed like any actor (Place Actors has a **TerraVox** tab); you can subclass them in Blueprint. Interiors are never placed: make a Blueprint child of **TV Interior Volume** and set it as the digger component's **Interior Volume Class**. Dig shape, reach, effects and **Lod Distance** can be changed at runtime; the rest of the level-of-detail settings (Enable Lod, Max Lod Level) and the layout settings (what shapes the starting rock) are read-only once playing. The volume's **Dig Extent** is what everyone digs with in it; change it on the server and the clients are sent it, to predict with. For one player's bigger tool, tick **Own Dig Size** on their digger component and set its Dig Extent and Dig Shape. **Save To Storage** / **Load From Storage** save at a checkpoint (server). Bind **On Voxels Edited** (see *Reacting to changes*) to react to digging, and use **Line Trace With Voxels** for shots that should see dug tunnels and hit the rock exactly. **Find Dig Target** / **Find Build Target** / **Find Sculpt Target** (pawn + the component's **Get Dig Direction**) return the volume the player is aiming at, e.g. for a HUD showing **Get Material Name** of it. Recipes (Event Graph): - **A grenade** (`BP_TerraVoxExampleGrenade` is this): an actor Blueprint spawned with **Spawn Actor from Class** (Instigator = the thrower's pawn); on **Event Hit** (or after a **Delay**): **Explode** (Location = **Get Actor Location**, Radius 300, Power 1, Base Damage as you like, Damage Causer = **Self**), then **Destroy Actor**. It digs a crater in every volume it reaches and throws the loose rock as debris; call it on the server (**Has Authority**). - **Paying for what was dug**: select the TV Digger Component and add its **On Dug** event (Details → Events, the green +): **Voxels By Material** holds how many voxels of each material were dug; **Get** index 3 (gold in the example palette) and add it to your inventory. **On Built** is its counterpart (take the material a build used). Both fire on the server, for everything the player does: digs, builds, paints, sculpt strokes, their grenades and stamps (an Author or a projectile they threw), and undo / redo (undoing a dig reports the rock it puts back through On Built). **Kind** says which it was (Dig, Build, Paint, Sculpt, Stamp, Explosion, Undo, Redo): branch on it when they shouldn't all pay the same. Pay in one and charge in the other and no sequence of edits makes something from nothing. The **TV Digger** interface (Class Settings → Interfaces) gives the same **Event On Dug** / **Event On Built** plus rules (**Can Dig In**, **Can Build In**); once added, those two return false until you open each and tick its Return Value (or put your rule there), or nothing can be dug or built. Can Build In is also asked for an undo that puts rock back and for a fluid poured or taken: **Is Undoing Or Redoing** (the digger component) and **Is Asking For Fluid** (TV Fluids) tell those apart, for a rule that charges blocks. - **Reacting to any change** (a quest, AI, decals): on a volume, **Bind Event to On Voxels Edited**; the event gives the author, the world box that changed and how many voxels. The example character is a Blueprint of a small C++ class (walking, looking, the throw RPC); the keys B, V, M and the gold message are in its Event Graph. A plain `Character` Blueprint with the component works the same. ## Three looks: smooth, faceted or blocks **Surface Style** on a volume (Details > TerraVox > Rendering) picks how its voxels are drawn. The voxels themselves, the saves and what goes over the network are the same in all three; collision follows the look. | Style | What you get | |---|---| | **Realistic (smooth)** | The default: sloping ground from partial voxels, shaded smooth. | | **Stylized (faceted)** | The same shapes with one flat shade per triangle: a low-poly look. Pair it with plain colours (`Materials/Stylized/M_TerraVoxFlat`, one **Color** per instance) and bigger voxels (50 cm in the example), where the facets show. | | **Blocks** | A cube per voxel, hard edges between materials. | What changes with the style: | | Smooth | Faceted | Blocks | |---|---|---|---| | A dig, a build | The dig shape (a sphere, a box), any size | The same | The one block aimed at | | A paint | The dig shape | The same | The one block aimed at | | Sculpting | Yes | Yes | No | | Stamps, explosions, cave-ins | Yes | Yes | Yes (what's left is drawn in blocks) | | Level of detail far away | Yes | Yes | No: every piece at full detail | | Materials blending at their edges | With `M_TerraVoxTriplanar` | With `M_TerraVoxTriplanar` | No: hard edges | | See-through materials (glass, leaves) | No | No | Yes | | Trees of voxels | Yes, though drawn in blocks | Yes, though drawn in blocks | Yes | | Water and lava | Yes, as a sheet | Yes, as a sheet | Yes, in blocks | `TV.Voxel.SurfaceStyle 0/1/2` draws every volume in one style on this machine, to try a look on a level you already have (pieces built from then on; -1 gives each volume its own back). It changes what is drawn, not how digs work. **Blocks** changes the tools too, on that volume: - A dig takes the one block aimed at (from the camera: the dot in the middle of the screen); a build puts one block on the face aimed at. Always on the voxel grid: **Dig Shape**, **Dig Extent**, **Dig Offset** and the smoothing settings aren't used. **Build Reach** is how far both reach. Hardness still counts: a block of hardness 2 takes two digs. - A paint changes the one block aimed at. Stamps and explosions still work in their own shapes; what's left is drawn in blocks. Sculpting isn't for a Blocks volume (a stroke nudges how solid voxels are, and there a voxel is all rock or none): a stroke there does nothing. - **Voxel Size** is the block's size. At 100 cm (the genre's metre) a character has to jump a block: give it a **Jump Z Velocity** of 480 or more (the example character jumps 90 cm, so the example map lowers its gravity instead). - Each block face has UVs of its own, one unit per block, so a material can put a texture on a block. `Materials/Blocks/M_TerraVoxBlock` does that with a **Top**, **Side** and **Bottom** texture (grass on top, dirt on the sides) and shades each face direction a little differently, so steps of the same block show. Its instances (grass, dirt, stone, sand, sandstone, snowy ground, planks; coal, iron, gold and crystal ore; oak, birch and pine logs and leaves; cactus) use 16 x 16 textures drawn by a script; swap in your own, set to **Nearest** filtering. The triplanar materials work on blocks too. - Corners shade where blocks meet, as block games do: each face's corners carry how open they are to the air in its vertex colour (white open, black tucked into a corner), and `M_TerraVoxBlock` darkens by it (**Block Shading**, 0 = off; **Shading Floor**, how dark a closed corner gets). Your own material can read Vertex Color R the same way. A face shaded at a corner is drawn on its own, not merged with its neighbours, so its shading stays on it. - A blend material isn't used (blocks have hard edges), and Smooth Normals has nothing to smooth. - **The edge of the world**: a TV Voxel Terrain has walls nobody sees along its four sides (**Edge Walls**, on by default), so players don't walk off it and fall. For ground that never ends, as the genre has it, use a **TV Terrain World** instead: the `TerraVoxExample_BlocksWorld` map is this same ground made tile by tile as you walk (see [A world with no edge](#a-world-with-no-edge)). Tick its **Heights In Cm** to say each height on its own instead of one **Tile Height** shared out by the tile class's proportions: **Dig Depth** (rock under the lowest ground), **Ground Relief** (from the lowest ground to the highest peak: how much it goes up and down, so a few voxels of it is flat ground), **Build Height** (air kept above the highest peak) and **Sea Level** (above the lowest ground; as high as the relief, everything is sea). More room to dig or to build leaves the hills and the sea where they were. - **Things that hang in the air**: by default rock cut loose from the ground falls (**Max Floating Island Voxels**), so a tree with its trunk cut comes down. Block games usually leave it hanging: set it to 0 on the volume, as the example does. - **Level of detail is off**: far ground is drawn in the same blocks as near ground (a coarser piece would be cubes twice the size, and a tree's one-block trunk would drop out of it). Faces of one material side by side are drawn as one rectangle (a flat floor is two triangles per piece, the texture still repeating per block), so with the genre's 1 m blocks that costs little; with small blocks over a big, rough terrain, mind the triangle count. - **See Through** on a palette entry (glass, a grate, leaves with gaps): the faces of the blocks it touches are drawn too, so you see what's behind it. Without it those faces are left out as hidden and the glass is a window onto nothing. Give the entry a masked or translucent material: `M_TerraVoxBlockCutout` is the block material cut out where its Side texture is see-through, and `MI_Block_Glass` the example's. - On a terrain, set **Relief Detail** to 2: the finer layers of noise that make natural ground lumpy come out as one-block pits and bumps in blocks. **Trees of voxels** (a terrain's **Trees** settings): **Tree Spacing** above 0 stands a tree about every that many centimetres, of one of the **Tree Types**. Each type has: - a **Shape**: **Round** (a crown on top of the trunk: oak, birch), **Cone** (rings of leaves down the trunk to a point: pine) or **Column** (the trunk alone: a cactus, a dead tree); - a **Trunk Material** and a **Leaf Material**, and a **Height** (shortest and tallest trunk, in voxels); - the **Biome** it grows in, by the biome's Name (none = everywhere), and a **Weight**: where several types can grow, one of weight 2 is picked twice as often as one of weight 1. A biome no type names has no trees. **Tree Min Ground Height** keeps them off low ground: set it to a sea level and the lake beds stay bare. Trees are part of the starting ground, like the hills and the veins: the same on every machine and every tile of a terrain world, and nothing is saved or sent until someone cuts one. Cut the trunk through and the crown falls, like any rock cut loose (**Max Floating Island Voxels**). Keep **Build Headroom** taller than the tallest tree. In the other two styles they come out as lumps: they're made for Blocks. **Your own trees and structures** (a tree type's **Structure**): the three shapes above are stand-ins. Make a **TV Voxel Structure** asset (right-click in the Content Browser > Miscellaneous > Data Asset > TV Voxel Structure) and set it on a tree type: the terrain then stands that there instead, in any of the three styles, with the type's Biome and Weight (a ruin of weight 1 among trees of weight 50 is a rare find). **Random Yaw** turns each one of four ways. Three ways to fill the asset: - **From meshes**: add **Parts**, each a closed mesh and the voxel material it becomes (a trunk mesh in wood, a crown mesh in leaves; model them around the same origin, which is where it stands on the ground). It's cut into voxels of **Voxel Size** when you change it: use the terrain's voxel size, since one voxel of the asset is one voxel of the terrain. - **From something you built**: **Capture From** (Blueprint) copies a box out of any volume as it is now, edits included. Build the hut by hand in a test level, capture it, and every world gets huts. - **From your own data**: **Set Voxels**. **Sink** buries its lowest rows, and **Foundation** carries its lowest row down to the ground where a slope falls away under it (6 rows at most by default), so a hut gets a footing instead of a side hanging in the air. Up to 128 voxels a side; keep **Tree Spacing** at least a third of how far the widest one reaches from where it stands (past that its far ends are cut off, and the log says so). Like the trees, structures cost nothing to save or send until someone digs into one; changing the asset changes the ground, so saves made before are left alone rather than laid over it. **A block world to mine and craft from** is the settings a terrain already has, as the example map (`TerraVoxExample_Blocks`) uses them: - **Biomes** for the surface: plains of grass over dirt, a desert of sand over sandstone, snowy tundra, each with its trees (oak and birch, cactus, pine). - **Veins** for what's underground, each with a **Min Depth**: coal from 2 m down, iron from 6 m, gold from 12 m, crystal from 18 m, harder as they get rarer (**Hardness** 2 to 4 in the palette, or a **Min Tool Tier** to need a better pick). - A **Drop Class** on each ore's palette entry: a dig of it drops a pickup named after it, into a **TV Inventory**. What the player crafts from those counts is your game's; **Get Count** and **Remove Item** are the nodes a recipe needs. ## Voxel materials Every voxel has a material id: an index into the volume's **Voxel Materials** array (any Unreal material; use world-aligned / triplanar ones, no UVs are generated). Surfaces are split into one mesh section per material, with a hard edge where two materials meet. By default it holds the four textured samples: grass (0), dirt (1), stone (2), gold (3). **Palette** (recommended): a **TV Voxel Palette** data asset (Content Browser > Miscellaneous > Data Asset) lists each material once for the whole game: **Name**, **Material**, **Hardness**, **Min Tool Tier** and **Sounds**. Set it on each volume's **Palette** and it replaces that volume's Voxel Materials, Material Hardness, Material Tool Tiers and Material Sounds. Blueprints then use names: **Find Material Id** ("Gold" → id), **Get Material Name**, **Get Num Materials**, and the digger component's **Select Material By Name**; the editor brush lists them by name. Volumes also expose **Get Voxel Size**, **Get Bounds Extent**, **Get Grid Size**, **Get Num Chunks** (changed chunks) and **Get Palette** to Blueprints. - **Fill Material**: the starting rock (blocks, interiors; on terrain, what lies below its layers). - **Ground Layers** (terrain): bands from the ground down, e.g. grass 50 cm, dirt 3 m, then Fill Material. - **Slope Material** / **Slope Material Angle** (terrain): steep ground shows this material instead of its layers (grass on gentle slopes, rock on the cliffs). **High Material** / **High Material Height**: the top layer of high ground (snow on the peaks). Slope Material is 2 (stone, past 40°) by default (off when the terrain has no material 2, and on surface patches, which show their source's painted layers), High Material off (255); changing either changes the terrain's layout, so saves made before don't fit. - **Material Rules** (terrain): materials by rule, for what Slope Material and High Material don't cover. Each rule names a material and where it goes: between two heights (**Min / Max Height**), between two slopes (**Min / Max Slope**), between two depths under the surface (**Min / Max Depth**: 0 to 50 is a skin on top, 200 to 300 a band two metres down, 0 to 100 000 the whole column) and, with **Patch Size**, only in patches that take **Patch Coverage** of the ground. A limit left at 0 isn't one. The first rule that fits a voxel wins, so put the particular ones first: snow above 30 m, then rock where it's steeper than 40 degrees, then moss in patches. Rules go over the layers, the slope, the heights and the biome; what's painted (a material map) still comes first, and ore veins after. - **Biomes** (terrain): regions of different ground laid out by noise from the Seed, each **Biome Size** across: each has its own **Layers** (empty = Ground Layers), **Relief Scale** (0 = flat plains, 2 = twice the preset's hills) and **Height Offset**, and the ground eases from one to the next across their borders. **Get Biome At** tells your code which one a place is in (for creatures, loot, weather). Empty by default; adding biomes changes the layout. - **Veins**: ore or other pockets in the starting rock, placed by 3D noise (same on every machine): material, size, rarity (roughly the share of rock it takes) and, on terrain, a minimum depth. - **Hide Veins From Clients** (anti x-ray, multiplayer; off by default): the veins are placed from a secret only the server has, so a cheating client can't compute where the ore is, and a client is sent a vein's rock only where it touches the air (a dig exposed it); the shapes are the same everywhere. Veins then stay buried (never on the surface or a cave wall), the editor preview shows none, and a listen server's own player still sees them. The secret is made on the server's first run in `Saved/TerraVox/VeinSecret.txt`: keep it with the saves (a save made with another secret isn't loaded), or give every server the same one with `-TVVeinSecret=<number>`. In a container whose `Saved` folder is read-only or wiped on restart (Docker, most game-server hosts) pass `-TVVeinSecret`: otherwise each start makes a new secret and the saves stop loading (the log says so). It costs the server about 2 ms more per dig (measured with dense veins: 0.4 to 2.6 ms). - **Paint**: the component's **Paint Action** / `RequestPaint` repaints the rock being aimed at with its **Selected Material**, without changing its shape. A player's paint keeps the digging rules: it doesn't touch rock their Tool Tier can't dig, nor turn hard rock into a softer material (painted to dirt, it would open in one hit). The game's own **Paint Shape** paints anything. - **Build** places new rock of the **Selected Material**. - **Dig** reports what it mined: the digger component's **On Dug** event (or `OnDug` on the pawn's TV Digger interface), or `GetLastDugByMaterial()` on the volume: count per material id, e.g. to give the player ore, and the **Location** of the dig (the volume's **Get Last Edit Location** gives it for any edit). Builds, paints, sculpt strokes and undo / redo are reported the same way (**On Built** for rock added or repainted, the undo of a paint included: the rock it turns back into counts as built). - **Drops and rock put back**: ore drops once per voxel. A dug voxel drops only if the ground had that ore there from the start (a vein, a layer, the fill material, what you sculpted in the editor) and it hasn't been dug before. Ore put back into its place (an undo of the dig, a build or a paint with it) is marked as already paid, and the marks are saved with the volume: dig, undo, dig again gives one dig's drops, whoever digs and after a reload too. Ore a player builds or paints where the ground had none never drops, and neither does ore your game stamps in at runtime (hand those rewards out from **On Dug**). What leaves without being dug drops nothing: a piece cut loose that falls, the rim a dig's smoothing cuts, ore painted over. Painting over a vein and undoing it uses that ore up. Loose ore (Falls When Unsupported) that slides down keeps its drops. A game that pays for ore itself in On Dug, instead of using Drop Class, should count the volume's **Get Last Droppable By Material**, not everything dug: On Dug alone can't tell ore dug twice. - **Charging for paint**: On Built fires for a paint (the rock it became, **Kind** Paint) and again when that paint is undone (the rock it turns back into, **Kind** Undo). Charge on Paint and give back on Undo. The undo of a dig reports as built all the rock it puts back, the piece that fell with the dig included. - **Drops**: give a palette entry a **Drop Class** (`TV Pickup`, or your Blueprint subclass) and **Voxels Per Drop**, and digs drop that many pickups of it on the floor where they dug (at most 8 a dig; the rest counts towards the next). A pawn with a **TV Inventory** component collects them by touching them (server; the owning client gets the counts): **Get Count**, **Add Item**, **Remove Item**, **Get Items** and **On Inventory Changed** for the UI. Games with their own inventory handle the pickup's overlap in a subclass instead. Pickups vanish after 5 minutes (Initial Life Span). Once 8 of one item lie within 1.5 m, more ore dug there raises the **Amount** of the nearest one instead of adding actors, so a vein mined in one spot for an hour leaves a handful of pickups, not thousands. A pickup subclass of your own must give its **Amount**, not one. - **Crafting**: a **TV Crafting** component beside the TV Inventory, with a **Recipes** Data Table whose rows are **TV Craft Recipe**: **Ingredients** (item names and counts, as the inventory has them), **Result** and **Result Count**. Add a row and there's a new recipe: nothing to code. **Can Craft** says whether the pawn carries what a recipe takes and has room for what it makes, **Craft** makes it (a client asks, the server checks and does it), **Get Recipe Names** and **Get Recipe** fill a menu, **On Crafted** is for the sound. Items are just names: a Blocks palette material's name makes a block the player can build with (the example turns a log into four planks and sand and coal into glass, `DT_TerraVoxExampleRecipes`; C opens the list on the right, the wheel picks a recipe and Enter makes it). It's recipes and nothing else: no workbench, no crafting time, no tools that wear. A game that wants those builds them round Can Craft and Craft. **Ready-made look** (plugin content, Materials/Samples): `M_TerraVoxTriplanar` projects textures from the three world axes (voxel surfaces have no UVs) with Tint, Tile Size, Roughness Scale and Metallic; instances for grass, dirt, stone and gold use CC0 textures by [ambientCG](https://ambientcg.com) (Grass003, Rock030) and [Poly Haven](https://polyhaven.com) (forest_ground_04). With **Detail Maps** = 1 the roughness texture also carries ambient occlusion in G and height in B (the samples' do): crevices darken, and where two materials blend the higher one shows through (pebbles poking out of the soil at the edge of the grass, Height Blend on the blend material). **Macro Variation** shades the ground with soft noise every few tens of metres (Macro Scale), so the textures' repeat doesn't show across a field. A blend layer a pixel doesn't use isn't read there. `M_TerraVoxProcedural` is a texture-free alternative (world-space noise). **Blended edges** (**Blend Material** = `M_TerraVoxTriplanarBlend`): neighbouring materials fade into each other instead of meeting in a voxel-sized zigzag. Each surface piece draws its four most used voxel materials as layers of one material, weighted per vertex; the layers' looks are read from the Voxel Materials (instances of `M_TerraVoxTriplanar`). It's on by default, and used only while every Voxel Material is an instance of `M_TerraVoxTriplanar` (the textured samples are): with your own materials, or with Blend Material emptied, each material is its own section with hard edges, and any materials work. Falling debris keeps hard edges. **Smooth Normals** (on by default): each vertex's shading follows the rock's slope around it instead of one normal per voxel cell, which shows as faint rings in dug tunnels and terraces on gentle ground (on a sphere: 0.9 degrees from the true surface against 3.9). About 0.2 ms more per dig to read one voxel more around each piece. `TV.Voxel.SmoothNormals` 0 / 1 forces it on a machine (a graphics setting), -1 leaves it to each volume. **Behaviour** (palette, per material; all off by default): - **Falls When Unsupported**: loose rock (sand, snow, gravel) falls straight down at once when what held it is dug. - **Walk Speed Scale** (mud 0.55): pawns walk slower on it. **Friction** (snow 0.35, ice 0.1): they slide. - **Buildable** (off): the material is dug and painted with, but not built with or offered to build. Speed and grip reach the pawn in one of two ways: - **TV Character Movement** as the Character's movement component (Class Settings > **Component Class Overrides**: override CharMoveComp with TV Character Movement; or `SetDefaultSubobjectClass` in C++). It applies the ground as part of each move, on the server and the owning client alike, and never touches the Character's own values. The better way. - **Surface Affects Movement** on the digger component (a Character): it scales the Character Movement's Max Walk Speed, Ground Friction and Braking Deceleration Walking ten times a second. A game that sets those itself should set them outright, not multiply them (a sprint made as x2 then /2 drifts); online, stepping into mud can cost a small correction. The biome example (`Example/Maps/TerraVoxExample_Biomes`, palette `PA_TerraVoxBiomes`) has snow, sand and mud set up with TV Character Movement, with ready looks in Materials/Samples (`MI_Textured_Snow`, `_Sand`, `_Mud`; CC0 textures by ambientCG: Snow014, Ground054, Ground071). **Unreal Landscape materials**: voxel surfaces have no landscape weightmaps or UVs, so a Landscape material's layer blends read nothing there; give the volume ordinary (world-aligned) materials. To keep your Landscape and its painted layers, use a **Surface Patch**: the ground stays the Landscape, and only what's dug shows voxels. Its **Layer Materials** carry the painting into the holes: give each Landscape layer's layer info a **Phys Material**, and map those physical materials to voxel materials on the patch (sand layer to your sand material...); each column's top layer is then what was painted there, so a hole dug in a sandy patch has sandy walls. (The Landscape's collision keeps one physical material per vertex, its most painted layer, so the voxels follow that, not the blend.) **Hardness** (**Material Hardness**, by material id like Voxel Materials): how many digs a material takes to open, each one wearing it down (1 = one dig, 3 = three). 0 = unbreakable: never dug, painted over or built with, and it holds up what rests on it (bedrock, vault walls). A hit that only wears rock down still counts as a hit (effects, montage) but hands out nothing: `OnDug` reports voxels once they open. For hit feedback, the digger component's **On Dig Hit** fires for every dig that changed rock, with **Wear** (0..1: a third after one hit on hardness 3, 1 once it opens) and the rock's material, on the server and at once on the digging player's machine: "2 of 3" bars, cracks, a duller sound for a hit that didn't break. The volume's **Get Last Dig Wear** gives the same. The example's HUD draws a wear bar. On the digging player's machine it fires as the dig is predicted: if the server then refuses it (a quota, a zone placed that moment), **On Edit Refused** follows and the rock comes back, so a game that shows the hit should take it back there. **Tools**: the digger component's **Tool Tier** and **Dig Power** stand for the pawn's pickaxe. A material whose **Min Tool Tier** (palette, or the volume's **Material Tool Tiers**) is above the pawn's Tool Tier can't be dug or sculpted away by it ("gold only with an iron pick"); **Dig Power** divides hardness (power 3 opens hardness-3 stone in one dig). Set them on the server when the player equips a tool; the owning client gets them for its prediction. Explosions and stamps don't use a tool: they have their own power. The tool's size is the pawn's too, if you want it to be: tick **Own Dig Size** on the digger component and its **Dig Extent** and **Dig Shape** are used for that pawn's digs, builds and paints instead of each volume's (a bigger pick, a drill, a spoon). Set on the server like the rest. ## Editing in the editor Pick **TerraVox** in the level editor's mode selector and click-drag on any voxel volume. | Mode | What a stroke does | |---|---| | **Dig**, **Build** | Takes rock away; adds rock of **Material** | | **Paint** | Repaints with **Material** | | **Smooth**, **Flatten** | Evens the surface; levels it to the plane where the stroke started (drag from a floor across a mound) | | **Raise**, **Lower** | Moves the ground up or down, as a Landscape's brush does | | **Noise** | Roughens it in lumps: weathering, rubble | | **Stamp** | Puts **Stamp Mesh** down where you click, sized to the brush, turned a random way unless **Random Stamp Yaw** is off | - **Radius**, **Strength** and **Falloff** (Smooth, Linear, Sharp: how the stroke fades to its rim) shape it. Two circles show the brush's reach and its strong middle; a stamp also shows the box its mesh will fill (its size: with Random Stamp Yaw on, the mesh is turned inside it at the click). - Hold Shift while clicking for the opposite: Dig ↔ Build, Raise ↔ Lower, a stamp carves. - Keys: `[` and `]` resize the brush, `-` and `=` weaken and strengthen it, `1` to `9` pick the mode. - The cursor's colour says what a click does: red takes rock away, green adds it, orange reshapes. - When a dab is refused or changes nothing, a notification says why (a locked level, the top of the volume, a brush too big for the voxels, a material that volume doesn't have...). - The brush aims through the voxels, so the whole volume can be edited, not only the detailed part near the camera. What a stroke becomes: part of the volume's starting layout, saved with the level, and one Ctrl+Z. Every machine starts from it; player saves made before the edit no longer match and start fresh. - **Clear Editor Edits** on the volume removes them all; **Clear Edits Of Volume Under Brush** in the tool's panel does the same for the volume under the cursor (undoable). - Changing the volume's size or voxel size (a Copy Ground that resizes it too) leaves the edits out but keeps them: set the old size back and they return. Meanwhile the brush refuses with "Clear Editor Edits (or set the old size back)", and a Spline Carver's Apply In Editor drops them (a warning says so). ## AI navigation Full-detail surface meshes affect navigation, and each one tells the navigation system when its collision changes (after it finishes cooking), so the navmesh follows digs and builds. For that the project must regenerate navigation at runtime: **Project Settings > Navigation Mesh > Runtime Generation = Dynamic** (TerraVox logs a warning if it isn't), with a **Nav Mesh Bounds Volume** over the area (or navigation invokers). Coarse far-away pieces (see level of detail) have no collision and no navmesh; every pawn, AI included, keeps full detail around itself. ## Sculpting **Sculpt** / **Sculpt At** (server; in C++ `Sculpt(Sculptor, Direction, Mode, Strength)` and `SculptAt(Location, Normal, Mode, Strength)`) and the digger component's **Request Sculpt** (with **Sculpt Mode** and **Sculpt Strength**, predicted on clients like digs) shape the surface within **Sculpt Radius**, strongest in the middle: **Smooth** evens bumps out, **Flatten** pulls the surface onto the plane it was aimed at (floors, walls), **Raise** / **Lower** move the surface out or in where it was aimed, up to two voxels a stroke, **Noise** roughens it in lumps (the component's **Select Next Sculpt Mode** cycles all five). Hard rock changes slower, unbreakable rock not at all, and rock is never added into a pawn. Allowed wherever the pawn may both dig and build. A stroke is reported like a dig and a build: what it opened through **On Dug**, what it filled through **On Built** (per material), so a game that pays for ore and charges for builds covers sculpting too. ## Stamps **Stamp Mesh** (server; in C++ `StampMesh(WorldContext, Mesh, Transform, bAdd, Material)`) presses any closed static mesh, moved, turned and scaled by Transform, into every volume it reaches: carve a prefab room or a curved tunnel, or add a ramp or a pillar in rock of Material. `StampShape(WorldContext, Box | Ellipsoid, Transform, HalfSize, bAdd, Material, Author)` does the same with a plain shape (added rock must touch existing rock, like a build). Unbreakable rock stays. With an **Author** (a pawn, or a projectile whose Instigator is one) the stamp is that player's: their rules apply (Can Dig In / Can Build In, an interior only its owner may change), it never buries a pawn, it's theirs to undo, and it's reported to their digger component (On Built for the rock it adds, On Dug for what it carves). Without one it's the game's own and goes as asked. **Paint Shape** repaints the rock inside a box or ellipsoid with a material and changes nothing else: scorch marks around a blast, grass growing back, a painted trail. With an Author it follows that player's rules, is theirs to undo and is reported to their digger component (On Built), like a paint of their own. Stamping a mesh at runtime in a packaged game needs **Allow CPU Access** on it, or complex collision (see TV Voxel Mesh below); each mesh is voxelized once and reused. **TV Spline Carver** (Place Actors > TerraVox): shape its spline through the rock and press **Apply In Editor** to dig a tunnel or trench along it (Radius: half its width and height; Shape: round or square), or, with **Build**, lay a road, ramp or wall of Material. It becomes part of the volumes' starting layout (one Ctrl+Z undoes it). **Apply** does the same at runtime on the server, as the game's own edit. A **TV Terrain World**'s tiles only exist in play: tick **Carve World Tiles** and each tile the spline crosses is cut (or built) as it's first made, band and all; a tile made again from its save keeps what's there (the road, and what players did to it). The spline is followed as drawn, so place its points at the height you want the road (a tunnel through hills, a cutting, a causeway with Build). ## Undo and redo Each volume keeps its last **Max Undo Steps** edits (32; digs, builds, paints, sculpts, explosions, stamps), every changed voxel before and after. **Undo Edit** / **Redo Edit** (server; `UndoEdit(WorldContext, Author)`) undo or redo Author's latest edit (anyone's, with no Author), exactly. Refused if the voxels aren't what the edit left any more (a later edit, or an earlier one undone since: undo that one first) or if the rock it puts back would trap a pawn. With a digger component on Author, what an undo or redo takes away is reported through **On Dug** and what it puts back through **On Built**: a game that pays in On Dug and charges in On Built stays even. The component's supply isn't touched, so undo is refused in Dig To Build mode, and switching modes drops the pawn's history (**Forget Edits** does it on demand). Players: the digger component's `RequestUndo` / `RequestRedo`, only with **Allow Undo** (off by default). History isn't saved: it's gone after a restart. **Operator rollback** (griefing): set **Rollback Seconds** on the volumes (e.g. 1800) and every edit is kept that long. **Rollback Player** (server; `RollbackPlayer(WorldContext, PlayerId, Seconds)`) or the console's `TV.Rollback <name or id> [minutes]` undoes all of that player's edits in the window, newest first, even after they've left (edits are logged under `GetEditorId`: their unique net id). Voxels someone else changed since keep that change; rock never comes back into a pawn; nothing is reported to the player. Memory: ~16 bytes per voxel changed in the window, up to **Max History Megabytes** per volume (64): past it the oldest edits go even inside the window (the log says so), so a busy server with a long window may raise it - each volume (each loaded tile of a Terrain World) has its own. Kept in memory only: not saved, and gone when a Terrain World lets a tile go. An edit too big to undo (over 65 536 voxels: a huge blast or cave-in) makes the earlier edits inside its box unrecoverable; edits elsewhere in the volume stay. ## Dig effects Every dig throws **Dig Chip Count** small pieces (**Dig Chip Mesh**, a lumpy pebble by default) drawn in the dug voxel material: they fly back out of the hole, bounce, shrink and vanish after **Dig Chip Lifetime**. Explosions throw four times as many, twice as fast. Chips are local and cheap (no physics bodies, one trace per chip per frame); 0 turns them off. They're only thrown where a player on that machine is within **Dig Chip View Distance** of the dig (60 m; 0 = always): every client is told of every dig on a volume it has, and on one big terrain most of them are too far to see. **Dust**: each dig also raises a puff of dust in the dug material's colour (the palette's **Dust Color**, or the volume's **Material Dust Colors**), with grains thrown out of the hole; a build, a smaller puff where the rock settles; an explosion, a ring of dust rolling out, a column of smoke and sparks. **Dust Amount** scales all of it (0 = none), within the same view distance as the chips. It's one actor per world (`ATVDustActor`): camera-facing quads of one instanced mesh moved on the CPU, no Niagara, at most **Max Particles** (1,500) alive; its **Emit**, **Burst** and **Blast** are Blueprint callable for a game's own effects. Drawn with **Dust Material** (`M_TerraVoxDust`). **Sounds**: **Material Sounds** (by voxel material id) gives each material its own dig and build sounds, one picked at random per hit; materials without any use **Dig Sound** / **Build Sound**. The plugin ships 25 in Sounds/ (S_Grass_*, S_Dirt_*, S_Stone_*, S_Gold_*, S_Build_*, five variations each), CC0 by [Kenney](https://kenney.nl) ("Impact Sounds"), and S_Explosion (the default **Explosion Sound**), made from a CC0 firework recording by rubberduck ([OpenGameArt](https://opengameart.org/content/25-cc0-bang-firework-sfx)). For your own effects (Niagara, decals, camera shake), bind the volume's **On Dig Effects** / **On Build Effects** / **On Explosion Effects** events (from the level Blueprint, a volume subclass or any actor, in BeginPlay so every machine binds them): they fire on every machine with the voxel material id, so each material can have its own. ## Cave-ins Set **Max Unsupported Span** (cm) on a volume and rock hanging over air further than that from what holds it up (rock with rock under it, unbreakable rock, the frame) falls, a layer at a time (**Cave In Interval**, 0.15 s): a room wider than twice the span loses the middle of its roof, crumbling upwards until what's left is held; a wide overhang comes down; a piece dug out from under crumbles. The falling rock goes as debris and pays nothing. Rock inside a **TV Protected Zone** holds. Off (0) by default: only floating islands fall. ## Explosions **Explode** (server only; in C++ `ATVVoxelVolume::Explode(WorldContext, Location, Radius, Power, BaseDamage, DamageCauser)`) blows a sphere out of every volume it reaches. **Power** is how many digs it counts as against hard rock. Pieces cut loose fall as debris thrown away from the blast (**Explosion Debris Speed**); **Explosion Sound** and the **On Explosion Effects** event play on every machine. BaseDamage > 0 also applies Unreal's radial damage (voxel walls shelter what's behind them). ## Building **Build** adds material in the same shape and place a dig would remove it (the dig shape in front of the body). It fills dug holes and adds rock anywhere inside the volume's grid (e.g. mounds on terrain, walls in an interior). Three rules: it never fills a pawn (nobody gets stuck), it must touch existing rock (nothing floats), and it stays inside the grid (a box block's grid is the box, so blocks are built back, not grown past their size). ## The digger component - **Dig Action** / **Build Action** / **Paint Action** / **Enter Exit Action** / **Sculpt Action** (held) / **Undo Action** / **Redo Action** / **Next Material Action** / **Next Sculpt Mode Action** / **Input Mapping Context**, or call `RequestDig` / `RequestBuild` / `RequestPaint` / `RequestEnterExit` / `RequestSculpt` / `RequestUndo` / `RequestRedo` / `SelectNextMaterial` / `SelectNextSculptMode` from your own input. - **Selected Material**: the voxel material builds and paints use (set it from your UI). - **Interior Volume Class**: the interior Enter Exit takes the player to (a Blueprint child of TV Interior Volume). - **Dig At Aim**: digs land where the aim meets the surface instead of against the body (first-person games). **Dig Interval** (server-enforced, shared by digs and builds), **Dig Pitch Offset** (aim correction for third-person cameras; 0 in first person), **Dig Montage**. - The client only sends a direction; the server finds the target and places the dig against the pawn's body. - **Predict Edits** (on by default): a client's own digs, builds and paints show at once instead of a round trip later. They live in an overlay over the replicated voxels (which stay exactly the server's) until the server answers: a refused edit is undone, an applied one gives way to the server's voxels when they arrive. The server stays in charge; a client that pressed inside **Dig Interval** doesn't send (the server would refuse and the edit would flicker). Off, the client waits for the server's voxels, and its **On Dig Hit** comes from the server a round trip later. **Supply Mode** (on the component): - **Free** (default): dig and build without limits. - **Dig To Build**: each dig earns **Supply Per Dig**, each build needs and spends **Supply Per Build**; no supply, no build. Paints cost like builds; a sculpt stroke that adds rock costs like a build, one that only removes it (Lower) earns like a dig. **Starting Supply** and **Max Supply** (0 = no limit) set the pool. `GetSupply()` and the **On Supply Changed** event (server and owning client) drive your UI; `SetSupply` / `SetSupplyMode` change it at runtime (server). Implement **TV Digger** (interface) on your pawn to plug in your rules: `CanDigIn` / `CanBuildIn` (stamina, material, alive, team...) and `OnDug(Volume, Voxels, VoxelsByMaterial, Kind)` / `OnBuilt(Volume, Voxels, Material, Kind)` (where it happened comes with the digger component's On Dug / On Built). Voxels is how many voxels turned from rock into air or back: hand it out as dug material and charge it for building. Without the interface, digging and building are free. **On Edit Refused** (Volume, Reason) tells the player why nothing happened: *Not Allowed* (the volume's, the pawn's or the component's rules), *Protected* (a TV Protected Zone), *Quota* (Max Voxels Per Minute), *No Supply* (Dig To Build) or *Tool Too Weak* (Tool Tier below the rock's). It fires on the player's own machine (the server for AI), at most once per Dig Interval; pressing at open air isn't a refusal. **Server rules** (on the component, checked by the server: a modified client can send any request whether or not your game binds a key to it). Only what your game turns on is allowed: - **Allow Build** (on by default). **Allow Paint**, **Allow Sculpt** (a stroke needs the pawn's dig and build rules) and **Allow Interiors** (leaving one always works) are **off by default**: turn on the ones your game binds. The example character turns all three on. - **Allowed Build Materials**: material ids builds and paints may use; empty = any the volume allows. In a game that pays for digging ore, leave the ore out, or players paint rock into ore and dig it. - **TV Protected Zone** (Place Actors > TerraVox): a box where no player may dig, build, paint, sculpt, stamp or blast (their grenades included; turned, it protects the upright box round it, so keep it square to the world); the game's own edits (no author) still go through. **Enabled** turns it off and on at runtime. For a claimed base, call **Allow Player** on the zone (on the server) with the owner's player state, and their friends': they edit in it, everyone else is kept out. **Allowed Player Ids** holds the same by unique net id (so only with an online service: a name alone isn't proof), for an owner who logs out and comes back (keep it in your own save). For a team or a rank, override **Allows Edit** in a Blueprint child of the zone. - **Max Voxels Per Minute** (0 = no limit): past it, the server refuses the pawn's edits (its grenades and stamps included) until the minute's count falls back. A griefer can't flatten a base in seconds. - **Allow Undo** is refused in Dig To Build mode (undo puts the rock back but not the supply); leave it off too if `OnDug` pays rewards. - Even at **Dig Interval** 0 the server paces each pawn at 20 edits a second (bursts of 3 pass). - A player's explosion (`Explode` with a Damage Causer spawned with the player's pawn as Instigator, e.g. their grenade) obeys the same owner rule as their digs. An owned interior's voxels are sent only to its owner and to players inside it. On Iris (Unreal's newer replication system, see *Networking*) the interior actor itself still reaches other players near it, and on 5.6 the ones far from it too (Iris doesn't ask actors who they're relevant to): they can see its dig effects and falling pieces, never its voxels. And its owner, far from it (back outside), doesn't keep it: it comes again when they go in, its voxels with it. ## Settings shared by every volume - **Extent / Voxel Size**: size of the grid and dig resolution. Smaller voxels = smoother walls, more memory per dug volume. - **Dig Shape / Dig Extent / Dig Offset**: what one dig removes (X forward, Y width, Z height). - **Floor Smoothing / Wall Smoothing / Floor Smoothing Radius**: after each dig the bumps it left on the floor and the walls are cut back, so tunnels stay walkable. A dig only ever takes rock away: nothing dug before comes back while the player digs on beside it. **Smoothing Max Depth** (50 cm) is how big a bump still counts as one: what's further than that from the ground around it (a pit in the floor, a side tunnel, a pillar left standing) was dug on purpose and is left alone. **Smoothing Fills Dents** (off) also puts rock back into small dents, for a floor that ends up level instead of a little lower; it never fills what the dig itself just opened. - **Max Floating Island Voxels**: rock cut loose from its anchor falls away (collapses) if it's at most this big. - **Spawn Debris** / **Debris Lifetime**: a piece that collapses falls as a physics object with its own shape and materials, then disappears after the lifetime (default 6 s). Cosmetic: every machine simulates its own copy from the same shape, it doesn't push pawns, and dedicated servers don't spawn it. - **Dig Sound** / **Build Sound** and the **On Dig Effects** / **On Build Effects** Blueprint events: cosmetic feedback on every client (spawn particles there, any FX system). - **Storage Class / Save Id / Autosave Interval**: see Saving. Layout settings (size, shape, preset, seed, heightmap) are sent once, with the actor, and every machine builds the volume from them: set them per instance on actors **placed in a level**, or on the **Spawn Actor** node (they're exposed on spawn) for actors spawned at runtime. They can't change after spawning. ## Interior volumes - Solid rock bounded by **Shape** / **Extent**, with a starting cavity (**Initial Cavity Center / Shape / Extent**) where players arrive. - **Get Or Create For Player** (Pawn, Class, Location; server; the digger component's Enter Exit calls it for you) finds the player's interior of that class or spawns one at a free spot (straight above `Location`) and loads their saved digs (with a storage that answers later, it waits for the answer, and **Enter** lets nobody in until then; the digger component keeps trying for you). The owner is identified by the PlayerState's unique net id (Steam, EOS...); call `SetVolumeOwner` to use your own ids. - **Only Owner Digs** (default on) and **Allowed Visitor Classes** (who else may `Enter`). - `Enter` remembers where the pawn stood; `Exit` sends it back. Both fire the pawn's digger component **On Interior Teleport** (Blueprint) and `ATVInteriorVolume::OnPawnTeleported` (C++, every pawn) on the server: tell your anti-cheat there so the jump isn't flagged. - A black shell outside the walls hides the sky if the camera clips through. ## Voxel blocks A solid **Box** or **Ellipsoid** of **Extent**. Its bottom layer holds it up: cut a block in two and the loose part falls away. ## Voxel terrain - **Extent** X/Y is half the terrain's width/depth, Z half its height; the actor sits at the terrain's centre. The bottom layer never breaks; the sides show as cliffs. - **Preset**: Flat, Rolling Hills, Mountains, Canyon, Island, Archipelago, Dunes, Mesas, River Valleys, or Heightmap. Archipelago scatters islands over a sea floor wherever the terrain is, so it suits a world with no edge (Island is one island in the middle); River Valleys cuts a winding bed under Base Level, which a TV Fluids **Sea Level** at Base Level fills. **Seed** changes the generated shapes (same seed, same ground on every machine). **Base Level** = ground level before relief, **Relief Height** = how much of the height the relief uses, **Feature Size** = size of the landforms. - **Turn a Landscape into a diggable terrain**: place a Voxel Terrain (unrotated), pick your Landscape (or any actor with ground collision) as **Ground Source** and click **Copy Ground**. The terrain moves over the Landscape's area, takes its height range (plus Build Headroom) and stores its heights (up to 4097 samples a side; one per voxel on smaller ones), so its ground lands where the Landscape's was (measured within 2 cm). Then hide or delete the Landscape and set the terrain's materials. A World Partition Landscape: load its whole area in the editor first (only loaded parts are copied); a progress bar shows (and can cancel) a long copy. To keep the Landscape and dig holes in part of it instead, use a surface patch (below). - **Heightmap import**: pick **Heightmap File** (grayscale PNG, 8 or 16 bit, or RAW/R16 16-bit square) and click **Import Heightmap** in the details panel. The heights are saved with the actor. The image only gives the shape: it's stretched over the terrain's **Extent** (set that to the map's real size), and its darkest to brightest span **Relief Height** of the terrain's height (below Build Headroom) above **Base Level** - with the defaults (0.3 and 0.5) about 7.6 m of relief on the default 60 m terrain. For the map's full range, Base Level 0 and Relief Height 1, and Extent Z half the real height difference (plus Build Headroom). At runtime, `SetHeightmap` before the terrain begins play (deferred spawn); runtime heightmaps don't reach clients unless they set them too. - **Material masks** (a world made in Gaea, World Machine or World Creator, materials and all): export each layer's mask as a grayscale image, add them to **Material Masks** with the voxel material each one stands for, and click **Import Material Masks**. Each place of the ground gets the material whose mask is brightest there; where they're all near black the terrain's own Ground Layers stay. It paints the top layer (as deep as the first Ground Layer), and what's painted wins over Slope Material and High Material. The images are stretched over the terrain like the heightmap, so they needn't be its size or each other's. Saved with the actor; `SetMaterialMap` does the same from your own data before the terrain begins play. - **Copy Ground with its paint**: fill **Ground Source Layers** before clicking Copy Ground, one entry per painted layer of the Landscape: the layer's **Phys Material** (set on its Layer Info) and the voxel material it becomes. The terrain then comes out painted as the Landscape was, not just shaped like it. - **Height Layers**: more relief over the preset's, each layer its own noise from the Seed. A layer has a **Shape** (Hills, Ridges, Mounds), the **Size** of its landforms, a **Height** (times Relief Height; negative digs, so Ridges at -0.3 cut gullies), its **Detail**, and a **Patch Size** to have it only in parts of the map (mountains over there, plains here). On a Flat preset the layers are the whole ground; over a Heightmap they add the detail the image doesn't have. No code needed, and they work on a TV Terrain World's tiles like any other setting. - **Stamps**: ground placed by hand. Put a **TV Terrain Stamp** (Place Actors > TerraVox) in the level over a terrain or a TV Terrain World, and move, turn and size it; the starting ground takes its shape, and the editor's preview shows it when you let go. **Shape**: Dome (a rounded rise, or a hollow with a negative Height), Flat (level all over) or Ground Map (a TV Ground Map's heights and materials, stretched over the stamp). **Blend**: Add lays it on the ground; Replace puts the ground at the stamp's own height (a Flat stamp with Height 0 is a pad level with the actor: move the actor up and down to set it); Raise To and Lower To do that only where it raises, or lowers. **Half Size** and the actor's turn give its rectangle, **Falloff** how far in from the edge it eases into the ground around, **Material** the top layer under it (a pad's stone), **Priority** the order when several lie over the same ground (lowest first: the last has the last word). A hill, a quarry, a building plot and a causeway between them are four stamps. Stamps aren't edits: the generated ground itself is different, so they cost nothing to save or send, and they go over presets, Height Layers, a Generator and a Ground Map alike. They're read when a terrain (or a world's tile) starts, from the level: place them in the editor. One spawned while playing changes nothing online (it would be on the server alone); in a single-player game it shapes the tiles of a TV Terrain World made after it. Moving one changes the layout, so saves made before don't fit. - **Your own generator (Blueprint)**: make a Blueprint whose parent class is **TV Terrain Generator**, override **Get Height** (in the Functions list, Override) and pick the Blueprint as the terrain's **Generator**. Get Height takes a Location (cm from the terrain's corner) and the terrain's Seed and returns the ground's height: 0 is Base Level, 1 is Relief Height above it. **Seeded Noise** is the plugin's own noise for it (hills of a Size, -1 to 1, the same on every machine): `0.5 + Seeded Noise(Location, Seed, 3000)` is rolling hills; add a second one with another **Salt** and a smaller Size for detail, multiply two for hills in patches. Use only Location, Seed and the Blueprint's own variables, so every machine gets the same ground. Raise **Version** in its class defaults when a change of yours gives other ground (saves made before are then left alone). How it runs, and what that costs: a Blueprint can't run on the worker threads the ground is made on, so the terrain asks Get Height on the game thread when it starts, once every **Height Step** (2 m), and eases between the answers. It's for the lie of the land, not for detail finer than the step (Height Layers go over it for that). A 60 m terrain is about 1 000 calls when it starts. A 128 m tile of a TV Terrain World is about 5 300 (7 ms for a Get Height that only returns a number, more with nodes in it), so the world asks ahead: a millisecond and a half a frame over the frames before it makes the tile, on the server and on each client, and the frame the tile starts in asks nothing. Only the tiles round the players at the map's start, and one a player is already standing in, ask all at once. A bigger Height Step asks less (400 cm is a quarter of the calls); the C++ way below costs the game thread nothing. Heights only: caves and materials of your own are C++. - **Your own generator (C++)**: make a child of `UTVTerrainGenerator` and pick it as the terrain's **Generator**. It stands in for the preset; Height Layers and Biomes still go over it. ```cpp UCLASS() class UMyGround : public UTVTerrainGenerator { GENERATED_BODY() public: // 0 = the terrain's Base Level, 1 = Relief Height above it. Location: cm from the terrain's corner. virtual float GetHeight(const FVector2D& Location, int32 Seed) const override { return 0.5f + 0.5f * TVNoise::Perlin2D(Location / 3000.0, TVNoise::Mix(Seed)); } }; ``` Two more to override when you need them: `Carve` (your caves and hollows under the ground: it gets how far inside the ground a place is and returns that changed; set `bCarves` in the constructor) and `GetMaterial` (your veins and strata: it gets the material the layers give and returns another). `GetVersion`: bump it when you change the ground, so saves made over the old one aren't laid over the new. The plugin calls these on worker threads, on every machine, on the class's default object: read only the arguments and the class's own properties (a Blueprint child can change those), never the world. `TVNoise.h` has the plugin's seeded noise. The test generator in `Source/TerraVoxTests/Private/TVTestDiggerCharacter.h` (a ramp with a tunnel and gold under one end) is a short example of all three. - **Spawned from Blueprint**: the layout settings (Preset, Seed, levels, caves, Extent, Voxel Size) show as pins on **Spawn Actor from Class**; they can't change once the terrain plays (every machine builds the same layout from them). **Caves** (**Caves** on the terrain): winding tunnels through the ground, the same on every machine for the same Seed. **Cave Scale** = how far a tunnel runs before it bends, **Cave Radius** = its rough width, **Cave Min Depth** = none shallower than this (0 = tunnels open at the surface). Ore veins show on their walls. Tunnels add surface to build: a 120 m terrain takes about twice the work to start (still spread over frames). **Cave Layers**: several kinds of cave in one terrain, each an entry. **Shape** is Tunnels (as above) or Caverns (wide, irregular rooms); **Scale** how far apart they run, **Size** a tunnel's radius or how far a cavern grows; **Min Depth** and **Max Depth** the band under the surface they keep to (tunnels from 3 to 15 m down, caverns from 20 m on); **Patch Size** puts them under about half the ground, in regions that wide, instead of everywhere. They add to what Caves makes if that's on too. ## Voxel meshes - Set **Source Mesh** (and **Mesh Scale**; the actor itself stays unscaled). The actor sits at the mesh's bounds centre and its box follows the mesh; **Voxel Size** sets the detail. - The mesh must be closed (watertight): inside and outside are found by counting surface crossings. - Placed in a level, the mesh is voxelized in the editor and saved with the level: no runtime cost. Spawned at runtime (`SpawnActorDeferred`, `SetSourceMesh`, `FinishSpawning`), it's voxelized on spawn on every machine. In a packaged game that is from the mesh's complex collision, which every machine has (a dedicated server's cook strips the render triangles), so server, clients and saves agree; the render mesh is only used when there is no complex collision, and then needs **Allow CPU Access**. Collision is the same shape as long as the mesh keeps its default collision complexity and collides with its LOD 0; a mesh set to *Use Simple Collision As Complex* can't be spawned or stamped on a dedicated server. The editor and PIE still read the render mesh, so a mesh whose collision isn't its LOD 0 (LOD For Collision, a Complex Collision Mesh, a section with collision off) gets another shape only in the packaged game: check those there. - **Anchor Bottom** (on): the lowest layer holds the shape up. - The whole shape uses **Fill Material**. ## Foliage **Foliage** (any volume): meshes scattered over the rendered surface, each type with a **Density** (per m²), the voxel material it grows on (**On Material**, e.g. grass but not the dirt a dig exposes), **Max Slope**, scale range, upright or **Align To Surface**, **Sink Depth**, **Cull Distance**, **Collision** (trees, boulders) and the coarsest level of detail it's placed on. Placement follows the surface (the same on every machine, **Foliage Seed**) and is redone with it, so foliage vanishes where the ground is dug away. Dedicated servers only place the types with collision. ## Water and lava (TV Fluids) Add a **TV Fluids** component to a voxel terrain or block (select it in the level, **Add**, TV Fluids) and list its **Fluids**: for each a name, a material, how fast it flows and how far. - A **source** (**Place Fluid**, with the fluid's index in the list; **Pour Fluid** lets it down first onto whatever is under the point, so one aimed at the open air lands instead of hanging there) stays until it's taken out (**Remove Fluid**, or **Remove Fluid Along** a line for a bucket). Give those nodes the player as **Author** and the player's rules apply, as for a build: the volume's Can Build, TV Protected Zones, the voxel quota. With no Author it's the game's own. From it the fluid falls, and where it lands it spreads over flat ground one level thinner each block: 7 blocks for water (**Reach**), 3 for lava. Take the source away and it dries up. - **Levels Out** (per fluid, off by default): poured into a pit, a basin or a dug room, it fills from the bottom up, a layer a step, level to the brim, like water in a well; over the brim and on open ground it runs and thins as above. What it fills stays when the source is taken away. A space bigger than **Pool Limit** cells (4096) counts as open ground, so a source on a hill doesn't flood the valley. - Dig a wall and it runs through; build into it and it makes way. It never enters rock. - **Refills** (water): a gap with a source on two of its sides, on a floor, becomes a source too, so a pond two blocks wide never runs dry however many buckets are taken from it. - Two different fluids meeting leave rock of **Mix Material** where the one flowing in arrives (water on lava: stone). 255 = they don't mix. That rock is an edit like the game's stamps (undo history, saved), and never sets around a pawn standing there. - Fluid doesn't run into a **TV Protected Zone** from outside (lava poured at the edge of a town stops at it); what the game places inside one flows there as anywhere. - **Damage Per Second** hurts pawns whose middle or feet are in it (Apply Damage, from the volume): lava. - **Embers** (per fluid, a second per m² of open surface; the examples' lava 1.2): glowing embers drift up off it, and where it touches a fluid without embers (water against lava, before Mix Material sets) it steams. Drawn with the volume's dust (see Dig effects), near a player on the machine. - Looks: on smooth ground `M_TerraVoxWater` is Single Layer Water (clear in the shallows, coloured with depth, foam at the shore and white where it runs down a slope, the ripples carried downhill) and `M_TerraVoxLava` a dark crust with glowing cracks that open where it runs; the Blocks examples keep their pixel water and lava. - The sea levels out: whatever is dug open beside it, at its level or under, fills to the brim (a channel from a lake fills level with the lake, a mine dug under it floods), and a bucket taken from it is no loss. Water from a source you place flows and thins instead. - The sea is filled over the first frames, a couple of milliseconds each (`TV.Fluid.SeaFillMs`): a world's tiles come one after the other as it's walked, and a whole tile's sea in one frame showed as a hitch. A sea nothing has touched isn't saved either: the same ground gives the same sea. - **Sea Level** (cm above the volume's bottom): the first time the game starts, the air at or below it that's open to the sky, and everything joined to that (under an overhang, a cave that opens into the lake), is filled with **Sea Fluid**. Lakes in the valleys and a sea around an island; a sealed cave stays dry. - **Get Fluid At** a point (index and level: 8 a source, 7 to 1 as it thins) and **Get Fluid Around** an actor, for sounds, a tint on the screen, your own swimming. - A character with **TV Character Movement** moves at **Fluid Speed Scale** (0.6) in a fluid and floats up to the surface, steering as on the ground (**Float In Fluids**; off, it walks on the bottom). **On Fluid Changed** (and **Get Current Fluid**) on the movement component says when it goes in or out of one: hang your splash there. The example's HUD tints the screen while the camera is under (blue, or orange in a fluid that burns). A press of jump while afloat is a leap, enough to climb out onto the bank. It swims where it looks: forward with the view tipped down dives, tipped up comes back up. - The server runs the flow; clients are sent the cells and draw them. It's saved beside the volume's own save, with the same storage and save slot. - On a Smooth or Faceted volume the fluid is drawn as one sheet (**Draw As Sheet**, on): level where it stands, a slope where it runs, and meeting the ground along the ground's own line, because it's drawn a voxel into the rock and the ground hides the rest; where it has run out over the ground it thins to nothing along a smooth outline. Turn it off for blocks; a Blocks volume's fluid is always in blocks. Only the drawing changes: the flow, swimming and the save go by the cells either way. Either way it has a UV per block like a Blocks face. `Materials/M_TerraVoxWater` is water for a sheet: see-through, rippled, fading out at the shore (**Colour**, **Opacity**, **Shore Fade**, **Ripple Size**, **Ripple Strength**). `Materials/Blocks/M_TerraVoxFluid` is a see-through, optionally glowing block texture (**Opacity**, **Glow**); `MI_Fluid_Water` and `MI_Fluid_Lava` are the example's. **In a TV Terrain World** put the component on the world's Tile Class (a Blueprint of TV Voxel Terrain with TV Fluids added). Water then runs from one tile into the next: each tile works out its half of the ground it shares with a neighbour and tells the other. Where the neighbouring tile isn't loaded the flow waits at the tile's edge, and goes on when that tile comes; each tile's fluid is saved with the tile. Limits: at most 7 fluids per volume; between two separate volumes that merely touch (not tiles of one world) fluid doesn't pass; and a sea of many thousands of blocks is sent to each client as it changes, a chunk at a time, which is fine for lakes and heavy for an ocean that's always moving. ## Surface patches (dig into a Landscape) A runtime Landscape can't be changed, so a patch copies an area of it into voxels and stands in for it there. 1. Place a **TV Surface Patch** over the area (unrotated) and set **Surface Source** to the Landscape (or a ground actor with static mesh collision). **Extent** Z must cover the ground's height range inside the patch. 2. In the source's material: add the function **MF_TerraVoxSurfaceMask** (plugin content, Materials), plug its output into **Opacity Mask**, and set **Blend Mode** to **Masked**. `M_TerraVoxExampleGround` is an example. Without this the ground still works but the source's surface keeps drawing over dug holes. On a Landscape also tick **Use Dynamic Material Instance** (Details, Landscape category): the engine only lets a Landscape's material change at runtime with it. Left off, the patch turns it on by itself as the game starts (and says so in the log), which costs a moment at startup, and on a World Partition Landscape again for each part that streams in: tick it yourself there. A material that already uses Opacity Mask (Landscape Visibility Mask): multiply the two. 3. Play. The patch starts once the source's collision exists, traces its height column by column and only draws what differs (holes, builds, paint). Pawns inside the patch walk on the voxel copy instead of the source. - **Edge Margin** (150 cm): a band along the sides that can't be dug, where pawns switch between the two grounds. - Spawning a patch at runtime: `SpawnActorDeferred`, `SetSurfaceSource`, then `FinishSpawning`. - Physics debris is off by default on patches: the pieces would land on the source's collision still spanning the hole. ## How do I... Short answers; each names the nodes and settings, described in their own sections. - **A pickaxe that gets better.** One digger component, three numbers on it: **Tool Tier** (which rock it can open at all, against the palette's **Min Tool Tier**), **Dig Power** (how fast hard rock wears) and **Dig Interval** (swings per second). Set them on the server when the player equips or upgrades. **On Dig Hit** tells the UI how worn the rock is; **On Edit Refused** with *Tool Too Weak* is the "you need a better pickaxe" message. - **A wider tool for one player.** Tick **Own Dig Size** on that pawn's digger component and give it its own Dig Extent and Dig Shape: predicted like any dig. For a one-off shape (a blast, a drill bit of its own form) call **Stamp Shape** (carve) at the tool's tip with the player as **Author**: their rules, their undo, their On Dug; that one isn't predicted, so it shows a ping later. Their rules are their zones, interiors, quota and Can Dig In, not their tool: a stamp or a blast with an Author doesn't ask the pawn's Tool Tier or Dig Power (a blast has its own Power). - **A drill vehicle.** Each tick or every few frames while it drills: **Stamp Shape** (box or ellipsoid, carve) ahead of it, Author = the driver. Give the vehicle **Add Collision Interest** so the ground has collision around it far from walking pawns, and **Remove Collision Interest** when it's parked. - **AI that digs.** Put a digger component on the AI's pawn and call **Request Dig** / **Request Build** on the server (it aims where the pawn's control rotation points). Set its **Dig Pitch Offset** to 0: the default 10° is for a camera behind a player and makes an AI dig above where it looks. Navigation follows the holes (see *AI navigation*). - **A mining loop.** Palette entry for the ore with **Drop Class** `TV Pickup` and **Voxels Per Drop**; veins on the terrain; **TV Inventory** on the pawn. **On Inventory Changed** drives the UI, **Remove Item** spends it. Keep the inventory in your own save (see *Saving*). - **New Game, Continue, save slots.** **Set Save Slot** / **Does Save Slot Exist** / **Delete Save Slot** in the menu, before opening the level (see *Saving*). - **A loading screen.** On the player's own machine, a few times a second until all three hold: **Find Containing** (the pawn) returns a volume, that volume **Has Voxels Started**, and a short **Line Trace With Voxels** down from the pawn hits ground. That works on clients, on a terrain world too (its **Get Tile At** only answers on the server). **On Voxels Ready** saves the polling only if you check Has Voxels Started first: a volume usually starts in its own Begin Play, before a widget or a level Blueprint gets to bind. - **Things that live on a tile of an endless world.** **On Tile Started** / **On Tile Leaving** on the TV Terrain World (see below). - **Show where the dig or build will land.** **Find Dig Target** (or **Find Build Target**) with the pawn and the digger's **Get Dig Direction** gives the volume, and that volume's **Get Dig Location** / **Get Build Location** the point: put a decal or a ghost mesh there each frame, on the owning client. **Can Dig** / **Can Build** tell whether to draw it red. They answer for the volume's rules; what the digger component adds (Allow Build, its allowed materials, the minute's quota) is checked when the edit is asked for, and **On Edit Refused** says why. - **Explosives.** **Explode** (every volume in reach, with damage); its Damage Causer is the grenade, spawned with the thrower as Instigator (as in the recipe above), so the crater is theirs (their rules, their undo, protected zones respected). - **Footsteps and impact effects by ground type.** Voxel materials carry no Physical Material. Use **Line Trace Voxels** (down from the foot, or along the shot): it returns the rock's material id, and **Get Material Name** turns that into the palette's name ("Grass", "Stone") for a switch that picks the sound or the particles. - **How deep can players dig?** A volume is as deep as its **Extent** Z; a terrain world's tiles are **Tile Height** tall (48 m by default) and don't stack: under the bottom there is nothing. Size them for the depth you want. - **A multiplayer session.** Nothing special: host and join the way any Unreal game does (Steam, EOS, a dedicated server, the Advanced Sessions plugin...). TerraVox replicates over whatever connection the game has. ## Reacting to changes (Blueprint) **On Voxels Ready** fires once on each machine when a volume's voxels have started (on the server, with its save loaded): from there it can be dug, traced and asked about. The ground under the players is built by then and the rest follows over the next frames; on a client, digs made before it joined arrive from the server after it. A volume usually starts inside its own Begin Play, so check **Has Voxels Started** before binding: by the time a widget binds, the event has often fired already. A **TV Terrain World** has **On Tile Started** (server: a tile's ground is there and final, with its save, the roads that cross it and its neighbours' edits at the seams) and **On Tile Leaving** (server: the players walked off; it's saved and destroyed in a moment), both with the tile and its coordinates, which are the same every time the players return. Each fires once per stay, in that order: spawn what lives on a tile in the first and remove it in the second. **On Voxels Edited** (server) fires after every edit that changed voxels (digs, builds, paints, sculpts, explosions, stamps, undo and redo), with the volume, who made it (empty for the game's own stamps and explosions), the world box it touched and how many voxels changed: bind it to update quests, AI, decals or anything that depends on the ground. **Is Solid At** tells whether a point is inside rock right now and which material (clients too). ## Saving **When.** Digs are saved 60 s after a dig (**Autosave Interval**), when an interior's owner exits, and when the volume is destroyed or the server stops. The autosave (and an interior's exit) encodes on a worker thread: the game thread only copies the packed chunks (measured on a 1 km terrain: 11 ms with 1.5k dug chunks, 40 ms with 50k, against 56 ms and 2.4 s done on the game thread). **Save In Background** does the same from Blueprint; **Save To Storage** writes at once (a checkpoint), and a background save that finishes after it is dropped. When the storage doesn't write a save (a full disk, a database that's down) the edits stay unsaved, the autosave tries again and the volume fires **On Save Failed** on the server: bind it to warn the players. **Under which key.** - An interior: owner id + class. Without an owner id (e.g. PIE with no Steam/EOS) it isn't saved. - Blocks and terrain: **Save Id**, or their actor path when empty. The path is stable for level-placed actors; set Save Id on spawned ones, on the Spawn Actor node, or with `SetSaveId` before `FinishSpawning` in C++ (the save loads as the volume begins play). - In World Partition the key is the map and the volume's name when Save Id is empty (the streaming cell it was put in isn't part of it, so changing the grid or moving the volume keeps its save). In Level Instances set **Save Id** on the volumes inside: every instance of the level has the same names. **Where.** The default storage writes `Saved/SaveGames/TerraVox_*.sav` in the project folder in the editor; a packaged Windows game under `%LOCALAPPDATA%/<Project>/Saved/SaveGames`; online, only on the server. The files are named by a hash of the key (`TerraVox_<hash>.sav`, or `TerraVox_<slot>_<hash>.sav` in a named save slot), so a file can't be told from its name: the log lines about a save give its key and slot. **A save that doesn't fit is never overwritten silently.** - Made before Extent or Voxel Size changed, or for another layout: ignored with a warning and kept under key `<key>.rejected`. - Some chunks unreadable: it loads without them and is kept there too. - A slot the default storage can't read at all (the game stopped mid-write): moved to `<slot>_unreadable` (an earlier one is never overwritten: `_unreadable2`...). - A slot another program holds open: not saved over for the session. Keep a palette's order when you add materials (add new ones at the end): saves store material ids. **Save slots, New Game.** With the default storage, from Blueprint (the *TV Save Game Storage* nodes): - **Set Save Slot** ("Slot1", "Slot2"...): a level plays in the slot that is current when its first volume begins play, and stays in it. Call it before the level opens: in your menu level, then Open Level (or in the Game Instance's Init, or the Game Mode's Init Game). From the level's own Begin Play, or a menu drawn over the game level, it is too late for that level: it keeps the slot it started with and stops saving (a warning says so, on screen in development builds) until the level is opened again. Empty is the default slot. **Get Save Slot** reads it back. Switching from a pause menu and then opening the level is safe: what the level hadn't saved yet goes to its own slot first. In the editor every play session starts on the default slot. The slot isn't remembered between runs: keep the player's last one in your own settings. Letters, digits, `-` and `_` name a slot, capitals or not ("Mine" and "mine" are one slot); a name with anything else (another alphabet, spaces) still gets a slot of its own. - **Does Save Slot Exist**: whether to offer "Continue". - **Delete Save Slot**: a "New Game" over an old one. From the menu too: volumes playing in that slot would write theirs again as they end. - **Reset To Starting Layout** (on a volume, server): puts that one volume back as it started, on every machine, and deletes its save, without reloading the level. Its TV Fluids too: what was poured goes, the sea comes back. Move pawns out of the holes first: the rock comes back around them. It rebuilds everything that was dug at once (a pause on a well-dug volume). Not for one tile of a terrain world: its neighbours and its roads would bring edits back. A new game there is Delete Save Slot and opening the level again. A storage of your own gets the reset through `DeleteVolume(Key)`; slots are yours to design there. What the plugin does not save: the **TV Inventory** and the digger's **Supply**. Both live on the pawn, so they're also gone after a respawn. Keep **Get Items** and **Get Supply** in your own save game (or on the PlayerState) and give them back with **Set Items** and **Set Supply**. **Compatibility promise**: a save made with TerraVox 1.0 or later loads in every later 1.x version and every engine version it supports, voxel for voxel. A test pins it (`TerraVox.Saves.Version1SavesLoadForever`): a real 1.0 save must load unchanged, and the starting ground each setting generates must stay the same (a save only holds what changed, so other ground under it would break it). A future change to how ground is generated comes as a new setting whose default keeps the old result. What does change the layout, and so sets a save aside as `.rejected`, is your own edit to a volume's settings (size, voxel size, seed, preset, veins...) or to the level's baked edits. Saves are written in a binary format (text-safe, so any storage keeps them); older JSON saves still load. A newer save doesn't load in an older version. Custom backend: subclass **TV Voxel Storage** (C++ or Blueprint), implement `SaveVolume(Key, Payload)` / `LoadVolume(Key)`, and set it as the volume's **Storage Class**. Volumes call it on the class's default object, so it has no state of its own and no world: reach your save system through the game instance or a subsystem. `SaveToString` / `LoadFromString` are also public. A backend that answers later (a database, a cloud save) overrides `SaveVolumeAsync` / `LoadVolumeAsync` in C++ and calls their `Done` on the game thread: the autosave writes through it without blocking, and a starting volume waits for its save before it builds (**Has Voxels Started** says when it's ready). Writes for one key must land in the order they're made. Keep the plain `SaveVolume` / `LoadVolume` working too: a volume that ends (the server stopping, a level unloading) saves through `SaveVolume` on the spot, and a save set aside as `.rejected` is read and written through them. And when a save exists but can't be read (the backend is down), don't answer "not found": the volume would start empty and write over it. Keep it from being overwritten (refuse that key's next save), as the default storage does. ## Blueprint nodes at a glance Where each node lives and where it runs. *Server* nodes do nothing on a client; *anywhere* ones answer from that machine's copy of the voxels. The sections above explain them. **TV Digger Component** (on the pawn) | Node | Runs | What it does | |---|---|---| | Request Dig / Build / Paint / Sculpt | owning client or server | The player's (or an AI's) edit where the pawn aims; predicted on the client, checked by the server | | Request Undo / Request Redo | owning client or server | Takes back or repeats that pawn's last edit (**Allow Undo**) | | Request Enter Exit | owning client or server | In and out of the pawn's own interior (**Allow Interiors**) | | Select Material By Name / Select Next Material / Select Next Sculpt Mode | owning client (server for an AI) | What the next build, paint or sculpt uses | | Is Build Material Allowed | anywhere | Whether this pawn may build with a material | | Get Dig Direction | owning client and server | The aim a dig would use now | | Get Supply / Get Supply Mode | server and owner | Dig To Build's counter and mode | | Set Supply / Set Supply Mode | server | Give or restore supply; switch mode | | On Dug, On Built, On Dig Hit, On Edit Refused, On Supply Changed, On Interior Teleport | see *The digger component* | What happened to this pawn's edits | **Any TV Voxel Volume** (block, terrain, interior, mesh, surface patch) | Node | Runs | What it does | |---|---|---| | Dig / Build / Paint / Sculpt / Sculpt At | server | The same edits without a digger component (your own tools) | | Stamp Mesh / Stamp Shape / Paint Shape / Explode | server (static) | Edits by world position in every volume they reach | | Undo Edit / Redo Edit / Forget Edits / Rollback Player, Get Editor Id | server (static) | A player's history; the id Rollback Player takes | | Line Trace Voxels / Line Trace With Voxels | anywhere (static) | Traces that hit the ground at any distance | | Is Solid At, Find Material Id, Get Material Name, Get Num Materials | anywhere | What is at a point; material ids and names | | Get Material Hardness / Tool Tier / Walk Speed Scale / Friction, Is Material Loose / Buildable | anywhere | A material's rules | | Can Dig / Can Build, Get Dig Location / Get Build Location | anywhere | Whether and where a pawn's edit would land | | Find Containing / Find Dig Target / Find Build Target / Find Paint Target / Find Sculpt Target | anywhere (static) | Which volume a pawn is in or would edit | | Get Last Dug By Material / Get Last Built By Material / Get Last Edit Location / Did Last Dig Change Voxels / Get Last Dig Wear | server | Details of the edit just made (inside On Dug / On Built) | | Add Collision Interest / Remove Collision Interest / Refresh Around Pawns | each machine (static) | Collision around things that aren't walking pawns; after a teleport | | Has Voxels Started, On Voxels Ready | anywhere | When the volume can be used | | On Voxels Edited | server | Every change, with who and where | | On Save Failed | server | The storage didn't write the save; the autosave will try again | | On Layout Mismatch | client | This machine's starting ground isn't the server's (another version of the game) | | Save To Storage / Save In Background / Load From Storage / Save To String / Load From String / Reset To Starting Layout | server | Saving by hand, checkpoints, a reset | | Get Grid Size, Get Voxel Size, Get Bounds Extent, Get Num Chunks, Get Num Chunks To Build, Get Palette | anywhere | Size and state | **The rest** | Node | On | Runs | What it does | |---|---|---|---| | Enter / Exit, Get Or Create For Player, Set Volume Owner, Is Owned By, Can Enter, Get Entry Location | TV Interior Volume | server (the last three anywhere) | A player's own interior, by hand | | Update Tiles, Get Tile At, Get Num Tiles, Get Tile Spacing, Get Tile Coord, On Tile Started, On Tile Leaving | TV Terrain World | server | The endless world's tiles | | Get Biome At, Sample Height, Set Heightmap | TV Voxel Terrain | anywhere; Set Heightmap before the terrain begins play (in Blueprint: its Construction Script) | The ground's shape | | Set Source Mesh / Set Surface Source | TV Voxel Mesh / TV Surface Patch | before Finish Spawning (C++), or a Blueprint child's Construction Script; a mesh also has spawn pins | Runtime spawns | | Apply | TV Spline Carver | server | Carves its spline at runtime | | Add Item / Remove Item / Set Items, Get Count / Get Items, On Inventory Changed | TV Inventory | server; the getters also on the owner | Counts of named items | | Give To, On Picked Up | TV Pickup | server | Handing a pickup to a pawn yourself | | Set Save Slot / Get Save Slot / Does Save Slot Exist / Delete Save Slot | TV Save Game Storage (static) | the machine that saves | Save games | | Can Dig In / Can Build In / On Dug / On Built | TV Digger interface, on the pawn | server | Your own permission rules and rewards | ## Console | Command | | |---|---| | `TV.EnterExitInterior` | Enter/leave your interior (not in Shipping). Works on remote clients. | | `TV.Voxel.Debug 1` | Shows volume bounds and the dig shape where it will land; logs every dig request and why the server refuses one. | | `TV.Voxel.Stats` | Logs each volume's dug chunks, chunk meshes, chunks still to build and predicted voxels. | | `TV.Voxel.StressDig [Count] [Seed]` | Server: digs Count random holes in every volume, to try joining, bandwidth and saves with a lot dug. | | `TV.Net.ChunkBytesPerSecond` | Voxel data sent to each client per second at most (default 60000). | | `TV.MaxEditVoxels` | Largest box of voxels one edit may cover (default 16M: a box about 250 voxels across, 50 m at 20 cm voxels); bigger stamps and blasts are refused with a warning. | | `TV.Rollback <name or id> [minutes]` | Server: undoes that player's edits in the window (see *Undo and redo*, Operator rollback). | | `TV.MaxWarmChunks` | Dug chunks kept unpacked per volume before the oldest keep only their compressed copy (default 8192; see *Performance*). | | `TV.Net.StreamToSpectators` | Send voxels to players with no pawn and no server-set view target too (off; see *Networking*). | | `TV.Voxel.SmoothNormals -1/0/1` | This machine's Smooth Normals: each volume's own (-1), off everywhere (0), on everywhere (1). | | `TV.Voxel.SurfaceStyle -1/0/1/2` | This machine's look: each volume's own Surface Style (-1), or smooth (0), faceted (1), blocks (2) everywhere. Drawing only. | | `TV.Voxel.SampleOnWorkers` | Sample pieces over untouched ground on worker threads (1, default) or on the game thread (0). | | `TV.Voxel.CollisionOnly` | Build volumes like a dedicated server: collision near pawns only, nothing drawn. | | `TV.Voxel.DistanceFields` | Give each piece of ground a distance field made from its voxels (1, default), so Lumen, distance field shadows and ambient occlusion see it; 0: none. Only in projects with Generate Mesh Distance Fields. See [Lumen](#lumen). | | `TV.Voxel.StaticDraw` | Draw the ground's pieces as static geometry (1, default: the renderer keeps their draw commands and the shadows of ground that didn't change) or as the engine's procedural meshes (0). With hardware ray tracing on it's always the engine's. Applies to pieces built from then on. | | `TV.Voxel.LogSlowMs <ms>` | Logs every step of the plugin's own game-thread work that took longer than this (which step, on which actor, how long): what a hitch is made of. 0, the default, is off. | | `TV.Fluid.SeaFillMs` | Server: milliseconds a frame all the TV Fluids together spend filling their seas when they first start (default 2). | | `TV.Fluid.MeshMs` | Milliseconds a frame all the TV Fluids together spend drawing fluid that changed (default 1.5). | | `TV.Fluid.NetBatchBytes` | Server: bytes of fluid one network actor carries before the next chunk goes to another (default 16384). | | `-TVVeinSecret=<number>` | Command line, server: the secret hidden veins are placed from (see *Voxel materials*). | `TV.Voxel.Stats`, `TV.Voxel.StressDig` and `TV.EnterExitInterior` aren't in Shipping builds. To keep a setting, put it in your project's `Config/DefaultEngine.ini` under `[ConsoleVariables]` (e.g. `TV.Net.ChunkBytesPerSecond=120000`); on a server, in that server's ini or its command line (`-ini:Engine:[ConsoleVariables]:TV.Net.ChunkBytesPerSecond=120000`). ## Performance ### Numbers Measured with the benchmark that comes with the tests (`TerraVoxPerf.Benchmark`, in the TerraVoxTests module: see *Tests* to turn it on; 150 digs, 15 cm voxels, 40 × 40 × 10 m interior): ~2.4 ms per dig on the server (~0.9 ms with Floor Smoothing at 0), ~1 ms of game-thread work per dig on every machine to redraw what changed (reading the voxels 0.6, putting the new meshes in 0.4; building them runs on worker threads), ~0.6 KB of replication per dig (changed chunks go as compressed differences from the client's version). Dig cost grows with how much is dug, not with the volume's size. (All the numbers in this section: a Ryzen 9 3900X and an RTX 2070 Super, Development editor builds on Windows.) Server load: 48 pawns digging over a 54 m terrain as fast as their dig interval lets them (about 19 digs a second, now and then a blast), 6 real clients each in its own process on the same PC (over loopback: no real network between them): the server's game thread works 8 to 16 ms a frame on average, depending on the run (99th percentile 13 to 33 ms; with one client about 6 ms and 15 ms), each client is sent about 4.5 KB/s of voxels, and the test passes only when every client ends with exactly the server's voxels. The starting ground is generated the same by the Windows (MSVC) and Linux (clang) builds: the same rock and materials in every voxel (how solid a voxel is may differ by a hair, which the test allows). Memory: a changed chunk takes about 8 KB while in use. Past **TV.MaxWarmChunks** (8192 per volume) the ones used longest ago keep only their compressed copy (about 430 bytes) and are unpacked again when something reads them: 50,000 dug chunks take roughly 85 MB instead of 430 MB, on the server and on every client that has them. ### Starting up The settings below are in the volume's **Performance** category in the Details panel (some behind its **Advanced** arrow). Starting surface: a volume spends **Startup Build Seconds** (0.25 s) of its first frame building the ground under the players (pawns, player starts), with collision, then builds the rest over the next frames within **Chunk Build Budget Ms** (3 ms per frame): the ground around every pawn first, then the whole horizon in coarse pieces, then finer detail. A volume that starts in the middle of play (spawned later, or back in a client's reach) skips that budget: the pieces right under pawns are built at once and the rest follows over the next frames; and only a few such volumes start a frame (any one a player is in at once), so a client getting many again (Iris, back from far away) doesn't hitch. Crossing a terrain world, the slowest client frame measured 54-60 ms. A terrain's heights are computed where they're needed, not for its whole area up front. Default terrain settings, 25 cm voxels, level of detail on: | Terrain | Start (first frame) | Rest built | Pieces | Triangles | |---|---|---|---|---| | 240 × 240 m | 0.26 s | ~0.6 s | 1 023 | 0.7 M | | 1 × 1 km | 0.27 s | ~0.8 s | 1 611 | 1.2 M | | 2 × 2 km | 0.28 s | ~0.8 s | 1 922 | 1.4 M | | 8 × 8 km | 0.73 s | ~1.3 s | 2 501 | 1.9 M | Every piece over untouched ground is sampled on worker threads, the ground around the players (with its collision) included: identical surfaces to the game thread's (`TV.Voxel.SampleOnWorkers 0` turns it off), so the game thread only applies meshes. **C++ subclasses of the voxel terrain** inherit this: their `GetInitialSolid`, `GetBaseMaterial` and `IsOutsideSolid` must only read settings (no shared caches, no world queries), or return false from `CanSampleInitialOffGameThread` - otherwise the very ground players walk on is read from several threads at once. The ground around players (full detail within **Lod Distance**, where they have collision) is built first, from its own budget (**Edit Build Budget Ms**), and while any volume has some still on the way the others hold their far pieces: right after Play the ground within 30 m of a player has its collision in 0.5-1 s, with every tile of a terrain world up. A **TV Terrain World** tile costs ~10-13 ms of game thread to make; the ones next to a player's are made a frame apart, the farther ones four a second (**Tiles Per Update** each time). Rendered (1280 × 720, flying a player over the terrain): a 4 km terrain is fully drawn within the first second; flying over it at 30 m/s runs at ~195 fps (game thread ~2.3 ms, render ~5 ms, GPU ~4 ms). A dedicated server with the same 8 km terrain uses the memory of an empty one. (Dates: the dig figures, the server load and this paragraph were measured on the 1.0 code on 15 October 2026, 5.8, with nothing else running; the startup tables and the 195 fps flight are from September 2026 builds. Flying the example maps at 20 m/s in 1080p for two and a half minutes, the frame stays at 5 to 9 ms (game thread 2 to 5 ms, GPU 5 to 7 ms) over the endless world and the block world alike, with every piece under the player in place. Memory holds still, except the endless world's first minute, which climbs while the tiles around the flight path fill in and then levels off.) ### Level of detail **Level of detail** (**Enable Lod**, on): full detail and collision within **Lod Distance** (40 m) of any player (pawns with a player's PlayerState, and cameras) and within **Other Pawn Detail Distance** (10 m) of other pawns (AI, vehicles, collision interests), so hundreds of AI stay cheap; beyond it the surface is drawn in coarser pieces, half the detail each time the distance doubles, up to **Max Lod Level** (8 = 1/256, only used kilometres away), without collision. Pieces follow the players as they move, and a strip hanging from each coarse piece's border hides the cracks where levels meet. With a player in the middle, 25 cm voxels: | Terrain | Without LOD | With LOD | |---|---|---| | 240 × 240 m | 2.5 M triangles, 4742 meshes | 0.66 M triangles, 992 meshes | | 480 × 480 m | — | 0.9 M triangles, 1262 meshes | **Lod Fade Seconds** (off by default): detail changes cross-fade (the new piece dithers in where the old one dithers out) instead of popping. It needs materials that read it: **MF_TerraVoxLodFade** in the **Opacity Mask** (clip 0.5) of a **Masked** material. The sample materials have it wired but stay Opaque (masked costs rendering for nothing when nothing fades); use their **_Fade** instances (Masked override: MI_Textured_*_Fade, MI_Procedural_*_Fade) with it. With the default **Blend Material** (blended edges, the surface is drawn with it), Lod Fade on uses its _Fade instance (MI_TerraVoxTriplanarBlend_Fade) by itself; a Blend Material of your own must be Masked with MF_TerraVoxLodFade too. Plain opaque materials: leave it off. ### Lumen A mesh made at runtime normally has no place in Lumen's scene: Lumen traces mesh distance fields, and the engine only makes those for static meshes, when they're imported. TerraVox makes one for each piece of ground from the voxels themselves, on the worker that builds the piece's mesh, along with the cards Lumen keeps its lighting on. So the ground bounces light and blocks it like a static mesh would, a dug tunnel fills with the daylight that comes in at its mouth, reflections show the walls, and a new hole is in Lumen's scene as soon as it's drawn. Distance field shadows and distance field ambient occlusion see the ground the same way. What the project needs is what Lumen itself needs, and a new Unreal project has it on: **Generate Mesh Distance Fields** (Project Settings > Rendering), **Dynamic Global Illumination Method** = Lumen, and DirectX 12 with **SM6** among the targeted shader formats (Lumen doesn't run on SM5 on Windows). Without mesh distance fields in the project nothing is made and nothing is paid for it; `TV.Voxel.DistanceFields 0` turns them off by hand. Check what Lumen sees with the engine's own views: *Show > Visualize > Mesh Distance Fields* and *View Mode > Lumen > Lumen Scene*. The example maps are lit by Lumen once your project has all three on. With hardware ray tracing on in the project, the pieces give the rays their triangles as well, so Lumen's hardware mode and ray traced shadows see the ground too (checked on 5.8 with Lumen's Surface Cache Coverage view). What it costs, measured flying over the endless example world at 15 m/s (1080p, RTX 2070 Super, Ryzen 3900X, in the editor's game mode): the distance fields alone, with no global illumination, take a frame from 4.6 to 5.6 ms. With Lumen the frame is 10.9 ms, against 7.6 ms for Lumen with nothing in its scene (the fields turned off): most of the difference is the render thread adding and dropping cards as pieces of ground come and go. The game thread is the same in all four, and memory goes up by 100 to 120 MB. ### Dedicated servers and far collision Level of detail is off on surface patches. **Dedicated servers** draw nothing: they build only full-detail collision within Lod Distance of every pawn (players and AI; under a pawn that appears it's built at once), so a 1 km terrain costs the server what's around its pawns (measured: idle, ~700 pieces around the start) instead of all ~250 000 surface pieces. Far from every pawn there's no collision, on clients and servers alike. For that: - **Long-range shots**: **Line Trace With Voxels** (a normal trace on your channel plus a trace through the voxels, nearer hit wins) or **Line Trace Voxels** (voxels only, with the rock's material) hit the ground at any distance, where the drawn surface is, and see digs at once. Open air is skipped a chunk at a time: a 900 m shot fired down from 100 m up costs ~0.03 ms; a shot grazing the ground the whole way ~0.7 ms per 800 m. - **Physics objects and non-pawn vehicles** far from players: **Add Collision Interest** (actor) gives them full-detail collision around themselves like a pawn; **Remove Collision Interest** when they no longer need it. - **Projectiles that fly** (an arrow, a grenade, a rocket): trace each tick's step, from where it was to where it is, with **Line Trace With Voxels**, and stop it at the hit: that works at any speed, with no collision near. Collision Interest is for things that stay or move slowly: the ground is built 10 m around the actor (Other Pawn Detail Distance) as it goes, and a fast one gets there first. Measured on an idle machine with a ball diving from 25 m: it landed at up to 50 m/s whatever the angle, and at 80 m/s went through the ground on dives of 45 degrees and steeper. A busy server has less to spare. A pawn that spawns (a respawn, an AI) or is taken in or out of an interior gets the ground under it at once. After teleporting a player yourself, call **Refresh Around Pawns** so it doesn't wait for the next update. `TV.Voxel.CollisionOnly 1` makes any machine build like a server. Set it on headless clients too (bots, a load test with `-nullrhi`): without a renderer a client still builds everything it would draw. Set it before the level loads (`-ini:Engine:[ConsoleVariables]:TV.Voxel.CollisionOnly=1` on the command line, or under `[ConsoleVariables]` in the project's DefaultEngine.ini): volumes already playing keep what they started with. ### Big edits **Big edits** (explosions, stamps) are redrawn within **Edit Build Budget Ms** a frame (6 ms): a 12 m explosion next to the player measured a 63 ms frame drawn all at once, and 14 ms at worst spread over five frames. 0 draws everything in one frame. ## Networking The server owns the voxels. Each client gets them from its own `ATVVoxelStreamer` (spawned by the plugin for every remote player): the chunks that differ from the starting layout, nearest the player first, in small batches at up to `TV.Net.ChunkBytesPerSecond`. A player joining a well-dug world gets the ground around them first and the rest in the following seconds (587 dug chunks: ~5 s). The volume actor itself only carries dig effects and debris. Layout settings are sent only with the actor (a volume spawned at runtime with its own Seed or size gets them on every client); every machine then builds the starting layout itself. A client whose layout still differs from the server's (a setting changed on the server only after spawning) logs an error saying so, shows it on screen outside Shipping, and fires the volume's **On Layout Mismatch** event: bind it to tell the player or leave the session. - **Who gets a volume.** A client has a volume only within **Net Relevancy Distance** (300 m) of its box: far terrain costs it nothing, and what changes meanwhile arrives when it comes near. Distance is measured from the player's pawn (or the view target the server set), not from the camera position the client reports, which a modified client could fake. - **What an edit costs.** Each changed chunk goes as the difference from the version the client already has (usually a hundred bytes or so), or whole (a few hundred bytes to about 1.5 KB) when the client doesn't have the one before. A dig averages about 0.6 KB. A 12 m explosion is about 100 chunks, a few tens of KB per nearby client: well under a second at the default `TV.Net.ChunkBytesPerSecond` (60 KB/s), and the digger's own prediction shows it at once. - **Bandwidth.** Raise `TV.Net.ChunkBytesPerSecond` on a server with bandwidth to spare (in `[ConsoleVariables]`, see *Console*; the connection's own rate, `net.MaxClientRate`, still caps what it carries), or keep explosions smaller in games with many players. Falling debris is sent outside this budget (to every nearby client, unreliable, at most 128K voxels a piece). - **Joining a dug map.** A client is sent only the dug chunks within **Chunk Stream Distance** (250 m) of its pawn; farther ones follow as it comes near, and until then it sees the starting layout there (0 sends every chunk). Chunks dug while a client catches up share the budget with its backlog, half each, so digging nearby never stops a joining player's ground from arriving; with several volumes (world tiles, interiors) the one the player stands in goes first. - **Spectators.** A player with no pawn and no view target the server set (spectating, dead) is sent nothing, since only the camera its client reports places it: turn on `TV.Net.StreamToSpectators` for games whose spectators should see tunnels. - **Iris.** Both replication systems work, the classic one and Iris (tested with `-UseIrisReplication=1`). Iris needs `net.SubObjects.DefaultUseSubObjectReplicationList=1` under `[ConsoleVariables]` in your DefaultEngine.ini, as it asks of any project. Iris sends an actor to every player unless it has a filter: in a big world give the volumes and their fluid a spatial one, under `[/Script/IrisCore.ObjectReplicationBridgeConfig]`: `+FilterConfigs=(ClassName=/Script/TerraVox.TVVoxelVolume, DynamicFilterName=Spatial)` and `+FilterConfigs=(ClassName=/Script/TerraVox.TVFluidNet, DynamicFilterName=Spatial)`. They then reach players within their Net Cull Distance (the volume sets its own from its size; its fluid takes the same). - **Interiors.** They trust the player's online id (Steam, EOS...): with a subsystem that doesn't authenticate it on the server (Null), a client could claim someone else's id. An interior whose owner has left the game and that nobody is inside is saved and removed (it comes back from the save when they return). **Dedicated server checklist**: - What was and wasn't run: dedicated servers from the editor's binaries on 5.6, 5.7 and 5.8, with real clients over lag and packet loss; a packaged dedicated server never (see below for what it needs). Test yours before you ship. - Try it in the editor: Play menu > **Net Mode: Play As Client** runs a dedicated server behind the clients. - A packaged dedicated server needs a **Server target** (`<Project>Server.Target.cs`), built from a source build of the engine (the launcher's engine has no server binaries), so a C++ project. - Saves (`Saved/SaveGames/TerraVox_*.sav`) and, with hidden veins, `Saved/TerraVox/VeinSecret.txt` live on the server: back them up there (clients keep nothing). Containers: see *Hide Veins From Clients*. - Server settings (`TV.Net.ChunkBytesPerSecond`, `TV.Rollback`, the Iris line above) go in the server's console or its `DefaultEngine.ini` under `[ConsoleVariables]` (see *Console*). ## Troubleshooting - **Pressing dig does nothing.** Run `TV.Voxel.Debug 1`: a line shows where the dig goes and the log says why one is refused. Usual causes: the pawn's **TV Digger** interface answers **Can Dig In** with false (tick its Return Value); the input mapping context isn't added (set **Input Mapping Context** on the component); the pawn isn't possessed; the aim misses the volume (first person: **Dig Pitch Offset** 0 and **Dig At Aim** on); an interior only its owner may dig. - **The ground is a grey checkerboard.** A Voxel Materials slot (or a palette entry's Material) is empty, or its material doesn't compile: use the samples or a Palette. (A material without *Used with Instanced Static Meshes* only loses its dig chips, and the log says so.) - **Holes close again on a client after a moment.** The server refused the dig (rules above) and the client's prediction was undone; `TV.Voxel.Debug 1` on the server logs the reason. - **Saved digs don't come back.** Look for "save was made for another starting layout" in the log: a setting that shapes the ground changed. The old save is kept as `<key>.rejected`. - **I start inside the rock, or fall through the ground.** The PlayerStart is below the terrain's surface (the editor viewport shows it), or the volume moved or was scaled after it began play. After teleporting a player yourself, call **Refresh Around Pawns**. - **K (my interior) does nothing.** **Allow Interiors** is off on the digger component (the log says so once). In PIE without Steam / EOS the interior works but isn't saved. - **My own keys stopped working, or the plugin's don't.** Both mapping contexts are active; the plugin's is added at priority -1, so yours wins for a key both map. Remap one, or clear the component's Input fields and call **Request Dig** / **Request Build** from your events. - **Z / X don't undo.** **Allow Undo** is off by default, and undo is refused in Dig To Build mode. - **Packaging fails in a Blueprint-only project.** Unreal builds a code plugin with your game: install Visual Studio with *Desktop development with C++*, or add any C++ class to the project once. - **AI doesn't walk into tunnels.** Project Settings > Navigation Mesh > Runtime Generation must be **Dynamic**, with a Nav Mesh Bounds Volume over the area. - **The hole in my Landscape doesn't show** (the pawn walks down into it, but the grass stays). The Landscape's material needs **MF_TerraVoxSurfaceMask** in its **Opacity Mask** and **Blend Mode: Masked** (*Surface patches*, step 2); on a material instance, the parent material is the one to change. At most four patches per Landscape. - **A client sees other ground than the server.** The log has "this client's layout differs": a setting that shapes the ground was changed on the server only (set it on the placed actor or the Spawn Actor node, never after). - **I can't find the plugin's content.** Content Browser > Settings: tick *Show Engine Content* and *Show Plugin Content*; it's under *All > Engine > Plugins > TerraVox Content*. - **A physics object far from every player falls through the ground.** Collision exists only near pawns: give it **Add Collision Interest**. ## Limitations What TerraVox doesn't do, so nobody finds out after buying: | | | |---|---| | Half blocks, stairs, rotated blocks | No: in the Blocks style a voxel is a whole cube or air. | | Air to run out of, drowning, swimming animations | No: TV Character Movement floats, dives and leaps out, and tells you when it goes under (**On Fluid Changed**); the rest is your game. | | Waves, a smooth water surface, things that float | No waves, and physics bodies sink through it. The surface is a flat sheet on Smooth and Faceted volumes (blocks on Blocks) with a water material you can swap. | | Your own terrain generator in Blueprint | Yes, for the ground's height: a Blueprint child of **TV Terrain Generator** with **Get Height** (see [Voxel terrain](#voxel-terrain)). It's asked on the game thread every Height Step (a world asks ahead of each tile, a little a frame), so it sets the lie of the land, not fine detail. Caves and materials of your own are C++. | | Blended edges with any material | Only with instances of `M_TerraVoxTriplanar`; your own materials meet in hard edges. | | Iris (Unreal's newer replication) | Works, with differences: an interior actor reaches players near it who aren't its owner (on 5.6 all of them), who see its effects but never its voxels. The network tests run with Iris too, on 5.6, 5.7 and 5.8 (more of them on 5.8); on 5.6 a terrain's edge walls and an interior's shell waiting for their settings have no test of their own. | | A packaged dedicated server | Not run by the author: it needs a source build of the engine. Dedicated servers were run from the editor's binaries; packaged games (a listen host and a client) on 5.8 only, Windows and Linux. | | Collision everywhere | Only near pawns (Lod Distance, 40 m) and actors given **Add Collision Interest**. | | A sculpt brush per player | **Sculpt Radius** belongs to the volume (the dig's size can be the pawn's: **Own Dig Size**). | | Nanite, baked lighting | No: the ground is made at runtime. Lumen does see it (each piece carries its own distance field, see [Lumen](#lumen)). | | A heightmap or material map on a TV Terrain World | Yes, as a **TV Ground Map** asset on the world: a region drawn by hand, easing into the generated ground at its edge (see [A world with no edge](#a-world-with-no-edge)). A terrain's own Import Heightmap and Material Masks stay that one terrain's. | | A world with no top or bottom | No: a TV Terrain World has no edge sideways; its height is what you give it (Tile Height, or Dig Depth + Ground Relief + Build Height). | | Landscape grass and painted foliage over a surface patch | They stay where they are, floating over a hole: the mask only hides the Landscape's own surface. Keep grass types and foliage out of the patch's area. | | A Physical Material per voxel material | No: traces return the material id (see *How do I...*, footsteps). | | Gamepad | The default mapping context has keyboard and mouse only; add your own keys to it. | | Materials per volume | 254. | | Mac, iOS, Android, consoles | Not built or tested. | | Packaging a Blueprint-only project without Visual Studio | No (Unreal builds code plugins with the game). | - Windows x64 and Linux on 5.6, 5.7 and 5.8, Windows ARM64 on 5.7 and 5.8: the runtime compiles on each (checked with Development and Shipping builds, Epic's Linux toolchain for Linux, no warnings; ARM64 hasn't been run on ARM hardware); the editor tools are tested on Windows x64. Run as packaged games on 5.8: Windows, and Linux (under WSL2, without a renderer), each a listen host and a client through the terrain world network test; both end with the server's voxels, and the blasted tiles are the same on Linux and Windows, the same rock and materials in every voxel (packaged runs of 13 October 2026; ARM64 compiled on 14 October). A packaged dedicated server hasn't been run (it needs a source build of the engine). The Fab download comes built for Windows x64; for ARM64 (and Linux) the plugin builds from its source along with your game, which needs a C++ project (add any C++ class once). - Packaging a Blueprint-only project: Unreal may build a temporary C++ target for a code plugin, and that needs Visual Studio with *Desktop development with C++* (or add any C++ class to the project once). - A volume must not move or scale after BeginPlay. - Replays (Demo Net Driver) aren't supported: the dug ground reaches each player through its own chunk stream, which a replay doesn't record, so a replay shows the starting ground. - Up to four surface patches per Landscape (or mesh ground), one per slot of MF_TerraVoxSurfaceMask; a fifth logs an error and shows no holes. Make patches bigger rather than more. - Walls are procedural meshes made at runtime: no baked lighting, no Nanite. Light them dynamically. - Surface patches: the source's own collision stays under holes for everything except pawns (traces for aiming ignore it too). Other physics objects dropped into a hole rest on the original surface. - Very large loose pieces (over Max Floating Island Voxels) stay up, to bound the cost per dig. - Online split-screen: each local player gets its own chunk stream, so a split-screen client receives the voxels once per player (a 2-player client, twice the bandwidth). Local split-screen and one player per machine aren't affected. - The example (`TerraVoxExample` module and `Example` content) ships with the plugin, so its classes are there to build on (a Blueprint made from the example character keeps working in a packaged game). To keep its maps and assets out of your packaged game, add `/TerraVox/Example` to **Project Settings > Packaging > Directories to never cook** (or list your own maps in **List of maps to include**); don't cook it if anything of yours derives from it. The Blueprint template and the TV Digger Component's default input use `/TerraVox/Defaults` (actions, mapping contexts, the samples' palette, the interior), which isn't part of it and is never excluded: what your game references from it is cooked. Its code (a few hundred KB) is linked like any module: to drop it too, copy the plugin from the engine's Marketplace folder into your project's `Plugins` folder, then delete `Source/TerraVoxExample`, the `Example` folder and its entry in TerraVox.uplugin (the plugin then builds again with your project: Visual Studio, as for packaging). Nothing else needs them (the tests that look at the example skip). ## Tests The plugin's own automation tests (`TerraVox.*`, over a hundred and fifty) ship as source in `Source/TerraVoxTests`, but the module isn't built: it would add seventeen thousand lines to every editor build of yours. To run them, add it back to `TerraVox.uplugin`'s `Modules` list (plugin copied into your project's Plugins folder) and rebuild (Visual Studio): ```json { "Name": "TerraVoxTests", "Type": "Editor", "LoadingPhase": "Default", "PlatformAllowList": [ "Win64", "Linux" ] } ``` Then Session Frontend → Automation, or `UnrealEditor-Cmd <project> -ExecCmds="Automation RunTests TerraVox.; Quit" -unattended -nullrhi`. Changing the plugin itself? `ARCHITECTURE.md` explains where things live and the rules the code relies on (level of detail, mesh versions, worker sampling, cross-fades). `TerraVoxPerf.*` (kept out of that run) are measurements, not checks: they log costs (a terrain from 240 m to 8 km, many pawns, a teleport, saves and big edits) and never fail. The tests write a few save slots under `Saved/` and delete them when they finish, and the editor brush tests clear the editor's undo history: run them in a session you aren't working in. ## Support E-mail **contato@tessaroapps.com** (English or Portuguese). To get an answer in one go, send: - the engine version and TerraVox version (Edit > Plugins shows it), and Windows or Linux; - what you did, what you expected and what happened instead (a short video helps); - the Output Log around the problem, with `TV.Voxel.Debug 1` on if it's about digging; - for a crash, the crash report folder (`Saved/Crashes`) or its call stack. ## Version history - **1.1** (October 2026): a new look for the ground (detail maps, height blend between layers, macro variation), water and lava (Single Layer Water with shore foam and flow, glowing lava with embers and steam), dust, smoke and sparks from digs and blasts, and corner shading on blocks. Blocks sections now carry a vertex colour: a material of your own that reads Vertex Color on a Blocks volume now finds the shading in its R channel. Plus the fixes of a full bug hunt. - **1.0** (October 2026): first release.