The first two articles covered heightmap generation and the selection and placement of POIs, Stamps, vegetation, and rocks. Part I followed height processing from regional height assignment to final R16 encoding. Part II described instance positions, support parameters, and object transforms for the same request. A standalone program initially computed these results stage by stage so that each output could be inspected. At runtime, they must also fit into the engine’s world, physics, and networking lifecycles.
The UE port first needs to generate terrain on the dedicated server: compute heights for mesh and collision from the same request, without graphics rendering, and compare them with client results. For the fixed request, upstream C++ now generates the base triangle mesh inside UE and passes it to height processing. Tiling, LOD, collision, and network repair retain their existing implementations. Visual output, height bytes, object layouts, and collision behavior are checked separately.
This article starts with the upstream C++ module, follows the CPU intermediate field between the two scene passes, and traces the triangle mesh into the terrain generation session. It then examines mesh construction, collision, and network data. Earlier algorithms are revisited where they affect these interfaces. All timings and comparisons concern the fixed request; experiments not rerun locally are attributed to their original records.
The algorithm diagrams explain interfaces and calculations. The stage heightmaps show actual outputs from the current CPU chain, and the runtime screenshots show the UE scene recorded on September 23. The later network logs were recorded on September 29; the stage data was assembled and checked on September 30. These materials come from different runs. Surface materials and Layer generation are reserved for a later article; this one examines terrain, object assembly, collision, and network data.
Outputs from Parts I and II, and Runtime Inputs
Part I takes a random seed, scene conditions, and configuration as inputs. Scene conditions and configuration determine candidates, regional structure, and height parameters; regions, subregions, and corners provide the spatial structure for a continuous surface. Distance-weighted source heights are assigned to corners, and triangles turn those discrete heights into a 4096² floating-point field. After multilevel filtering forms the broad slopes, Location support prepares the ground around locations. Natural Stamps and Location height textures then add local shapes. Outer blending and R16 encoding complete the height output. The 99.7904% figure in Part I is the per-pixel agreement rate of the final 4096² R16 encoding in an older version. It is neither the accuracy of every intermediate stage nor an average over arbitrary maps.
Part II examines resource selection and instance placement. Mission categories and tags filter POI candidates; spatial search, spacing, and resource weights determine Locations. Candidate generation, collision retries, and acceptance order determine the actual natural Stamp parent instances. Location support must query the height envelope from the new base height instead of reusing target heights from an older map. Trees, shrubs, and rocks have their own parent-resource expansion, local-to-world transforms, and ground-placement rules. In that validation batch, the captured central 2048² area had a maximum pre-encoding floating-point height error of 0.803 millimeters and an RMS error of 0.0186 millimeters. This was a different comparison from the R16 result in Part I.
The earlier outputs have distinct jobs in the engine. Requests and static configuration define candidates and rules; instance records provide positions and resource references; height fields store the computed surface. The heightmap supplies ground geometry, instance records supply object layouts, and engine components determine collision readiness. The port must deliver these data in dependency order and retain stage outputs so the actual execution path can be checked.
Generating the Triangle Mesh with Upstream C++ Inside UE
The early runtime read a pregenerated base height triangle mesh file before rasterizing, filtering, and drawing local heights on the CPU. This brought height processing into the dedicated server first, while region subdivision, Location selection, and corner height assignment remained outside the session entry point. The upstream module now extends generation into UE: the fixed request enters C++ scene-generation code compiled into UE, which produces triangle-mesh bytes for the existing height rasterizer.
Figure 1: Read the top row from left to right through the CPU intermediate field, then follow the lower row from the scene back pass toward the UE terrain generation session. The orange box represents validation and fallback, not another normal generation stage. The triangle-mesh output is connected; drawing, support, and object inputs still require separate integration.
Figure 1 passes triangle meshes, intermediate fields, instances, and height fields between modules. Each output needs a comparison, but the runtime also needs to be checked for which data it actually reads. Some newly generated upstream instances have yet to reach their runtime consumers.
| Interface | Data passed from producer to consumer | What can be checked here |
|---|---|---|
| Fixed request and static files → scene front pass | Request text, scene and mission configuration, region-space data, and resource records | File completeness and use of the same inputs |
| Scene front pass → CPU intermediate field | Bottom triangles, projection matrix, and world matrix | Triangle bytes, matrix bytes, and the 512² query mask |
| CPU intermediate field → scene back pass | 128² intermediate R8 field | Dimensions and bytewise agreement; visual similarity of grayscale images is insufficient |
| Scene back pass → terrain generation session | Height triangle records, each 48 bytes | Record count, layout, material keys, and byte-for-byte equality |
| Height session → UE world | 4096² floating-point field, 2049² vertex field, and tiled R16 | Stage height differences, field extrema, tile digests, and collision readiness |
The upstream module and height-processing core handle the first four interfaces; only the last reaches Actors, components, and networking. Each triangle record starts with nine float values for three vertices. The height rasterizer reads records with a 48-byte stride and checks their material keys. Treating them as a contiguous 36-byte vertex array would start the second triangle at the wrong offset. Record format and parser stride must agree for both modules to process the same mesh.
The Source Module and Engine Adapter
Upstream generation began as a standalone C++ program. The migration compiles its source into a separate UE module and adds an engine adapter. This gives control over the compiler, runtime library, exceptions, and floating-point settings, while keeping the standalone tool and the UE call on the same computations where possible. Linking an existing binary would introduce version and ABI differences into numerical diagnosis, making it harder to tell whether a byte mismatch came from the algorithm or the build environment.
The build rules disable PCH and unity builds for the largely STL-based source, enable exceptions, and use C++20. Disabling unity resolves conflicting definitions when translation units are merged; it does not disable optimization. Exceptions are enabled because the original entry point uses them to report invalid inputs. The UE module handles lifecycle and type adaptation, while the algorithm retains its own data structures. Height processing and runtime integration remain in two other modules: the former handles numerical fields, quantization, and tile extraction; the latter handles mesh components, levels, objects, characters, and networking.
The adapter converts FString arguments to UTF-8 string arrays, calls the original scene-generation entry point, and returns the exit code and error text to UE. During the call, it captures process-wide std::cerr so tool errors reach the engine log. The fixed request currently runs serially; concurrent calls have not been validated. Concurrent map generation would require separate log buffers and intermediate directories, together with checks for reentrancy.
The adapter retains the standalone tool’s data structures rather than rewriting each as a UObject or Unreal container. The scene module still accepts paths in the original argument order, reads binary static tables, and writes stage outputs to a working directory. The engine prepares paths, schedules the call, receives success or failure, and reads the final mesh. This preserves comparable stage outputs, but makes the filesystem a runtime dependency. Directories must be writable, files must match the request, and an interrupted run must not reuse an old intermediate file as a new result. The wrapper checks return codes, intermediate-field reads and writes, and the final mesh read, but does not yet provide a complete input-file verification and intermediate-file cleanup procedure.
Capturing std::cerr temporarily replaces a process-wide stream buffer and restores it after the call. Writes from other threads can become mixed with terrain logs during that interval. Embedded in UE, the standalone tool shares a process with editor, server, and other tasks. Concurrent calls therefore need defined limits, separate working directories, and identifiable error sources.
Front Pass: Configuration, Spatial Structure, and Bottom Triangles
A request supplies static files for the scene, missions, objectives, candidates, Location root resources, search parameters, region-space data, and routes. The upstream program first builds regional topology and ownership, selects Locations using mission conditions, and processes Location-to-region connections and route relationships. Later subregion height assignment needs the positions of Locations and routes, so this information cannot be deferred until after the heightmap is generated.
The entry point parses the request, initializes the scene, and builds a candidate pool from mission, objective, and quota tables. It then prepares Location search. Each candidate has root, group, and item identifiers plus a resource key, and must bind support geometry, influence bounds, and placement flags. The code checks candidate keys against instance records and reports missing support geometry instead of treating the candidate as a point without a radius. The region-space index supplies ownership and threshold checks for candidate poses. Only accepted instances have their positions written back. The advancing random state also affects later branches. Reproducing the result requires the candidate-generation and rejection order as well as the 54 selected Locations.
After Location selection, the program connects instances to subregions, builds height groups, adjusts distances related to low-height groups and routes, then selects subregion types and Zone ownership. Route association, region merging, and mission boundaries use these results. Position records provide XY, orientation, and ownership at this point; the final building height is still undetermined. Drawing directly from final Location coordinates could display 54 markers while omitting the regional relationships that determine triangle boundaries and height sources.
The front pass stops at a defined point to write triangles for intermediate-field computation. It takes centers and boundaries from cells belonging to low-height groups and forms triangle fans along their edges. These are geometric inputs for the next 512² query mask, not the final 4096² height field. The front pass also produces subdivision candidates and topology diagnostics, but does not execute the height stage that needs the new intermediate R8 field. This intermediate result must correspond to the front pass’s regions and random state. Substituting a intermediate R8 file from another request changes the back pass’s height inputs.
Specifically, the front pass selects subregions marked as belonging to low-height groups and traverses their cells’ ordered edges. Each triangle contains the cell center, edge start, and edge end. Each vertex is written as three 32-bit floats, making each mask-rasterization triangle 36 bytes. Its coordinates are first mapped into the query domain using 512 / map extent. The back pass writes height triangles at 48 bytes per record, including three vertices, a layer marker, and a material key. Although both files contain triangles, their coordinate systems and record contracts differ. Sending front-pass triangles directly to the final 4096² rasterizer, or parsing them with the back pass’s 48-byte stride, invalidates the input.
Regions and routes serve both as terrain-shape inputs and as Location-search constraints. Candidate positions are written back only after region ownership and spatial thresholds pass; route segments and occupied Location bounds then affect later subregion boundaries. Independently generating random points and then calculating heights would omit these dependencies. The upstream C++ port retains the standalone program’s candidate order, rejection conditions, and state advancement. UE supplies static-file paths and output directories.
Why the Intermediate CPU Bottom Field Is Required
The earlier chain still needed a GPU intermediate-field computation here. The new module replaces it with two CPU steps: rasterize a 512² R8 query mask from the front-pass triangles, projection matrix, and world matrix, then produce the 128² intermediate R8 input in the original processing order. The back pass repeats the preceding spatial steps and reads this intermediate R8 field at height assignment. The dedicated server needs neither a render window nor GPU drawing for this operation.
Coverage can look similar while differing in bytes. Instance and camera matrices transform the vertices before pixel mapping; fixed-point edge functions and shared-edge rules determine coverage. Changes to constants, matrix layout, or texture readback order can alter the final 128² file. The back pass reads this field during height assignment, so its values need comparison. A similar preview or constant image cannot replace that input.
The intermediate R8 inputs also contain two matrices of 64 bytes each. The CPU rasterizer unpacks vertices in the scene stage’s layout, exchanges coordinate components, applies the specified matrix row/column convention, then performs the homogeneous divide and 512² viewport mapping. Screen coordinates are quantized to 1/256 pixel before pixel centers enter the edge tests. Shared edges use the same top-left rule. Degenerate triangles write nothing, and bounding boxes extending beyond the image are clamped first. The output is R8 occupancy, not interpolated terrain height. A similarly shaped white area does not establish that the back pass reads the same boundary: after downsampling and distance search, a one-pixel coverage change can affect multiple 128² output samples.
After mask generation, the code performs two 2×2 maximum-value downsampling steps: 512² to 256², then to 128². If any child sample is occupied, its parent retains that state. Each 128² pixel then searches a bounded neighborhood for the nearest opposite occupancy state. Interior pixels retain a high value; exterior pixels form a transition using distance and a fixed decay coefficient. Distance evaluation, boundary clamping, constant bit patterns, and rounding into R8 are all part of this field’s contract. They do not define every visible ridge, but determine how the back pass samples the region boundary.
Distance search uses a fixed neighborhood window, with reads outside 128² clamped to the edge. For each pixel, the code checks mask membership and finds the nearest opposite state within the maximum search distance. Interior values remain 1; only exterior values decay with distance. The result is clamped to [0, 1] and quantized to 0–255. Distance evaluation preserves the specified approximate reciprocal square root and constant bit patterns. Replacing it with a general sqrt may alter rounding and bytewise agreement for the same input. Coverage, downsampling, boundary handling, and numerical rounding all affect the 128² intermediate R8 field.
The 36-byte front-pass triangles, 512² mask, and 128² intermediate R8 field can each be saved independently. If 512² already mismatches, check vertex unpacking, matrix transposition, Y direction, and shared edges before changing back-pass height parameters. If 512² agrees but 128² differs, inspect maximum-value downsampling, neighborhood search, and quantization. These intermediate checkpoints locate final height differences in a specific data transformation.
Back Pass: Voronoi Subdivision and the Height Triangle Mesh
The back pass does not resume directly from the front pass’s C++ objects. It reruns preceding steps with the same request and static files, including generating subregion candidates from region boundaries, configured spacing, and mission conditions. Parent-region boundaries constrain the candidates before Voronoi construction and clipping to valid space. The front pass can already export these topology diagnostics; the rerun back pass adds the newly generated intermediate R8 field when it reaches height assignment. Source heights, corner heights, and downhill directions are calculated on this structure before constructing the base height triangles.
Subdivision candidates are generated per parent region rather than sampled uniformly across the map. The program uses existing route associations to identify parent regions needing subdivision and assembles a closed boundary and bounding box for each. Zone configuration supplies spacing; the current branch generates candidate sites at one quarter of that value. Candidates are generated within the bounding box and individually tested against the actual polygon. Rejected points are replaced with the array’s last item before shrinking the array, so retained order depends on this removal method. Stable filtering could change site numbering and edge traversal even if it retained the same set. Saving both raw and filtered candidates distinguishes generation differences from filtering differences.
Once candidates are fixed, the Voronoi sweep produces raw cell edges. Infinite edges are extended to the query bounding box and clipped against parent-region boundaries and existing route segments. Very short edges are skipped; retained edges and clipping events form a queryable subregion topology. The original diagram, clipped edges, corners, cells, adjacency, and spatial index are saved. The visible polygons are only a representation of these relationships. Later height calculations query them directly: a corner’s parent region and an edge’s proximity to a route both affect height sources. Keeping only the visual outline would not preserve enough data for the same height algorithm.
Voronoi sites begin subdivision; parent-region, Location, and route constraints determine the final cell boundaries. Height queries depend on those relationships, and corner heights must be assigned before the triangles can be interpolated. Boundary shifts, height-assignment errors, and filtering changes can leave similar residuals in the final image. Saving candidates, clipped edges, and triangles separately distinguishes spatial errors from numerical drawing errors.
Height assignment converts the new 128² intermediate R8 field to a 0–1 floating-point texture and passes it to subregion height calculation together with Zone height curves, the scene generation configuration, and region/route relationships. Outputs include site heights, corner heights, and sources used for corner-height assignment. Location corner heights and the downhill relationships of the base and subdivided topology then enter triangle-mesh construction. This explains why a final height PNG cannot replace the front pass and intermediate R8 field: a source height depends on a sample’s identity within region, Location, and route structures as well as its grayscale value.
Final records contain nine floats for three vertices, a four-byte layer marker, and an eight-byte material key, totaling 48 bytes. The rasterizer first checks that total length is a multiple of 48, then reads material keys. The current entry point rejects unsupported blended materials. Processing stops at unknown blend rules rather than producing heights that cannot be checked. Other configurations reaching unimplemented material or subdivision branches still require separate validation.
The upstream source also includes natural Stamp scheduling, spatial domains, and obstacle queries, but the current UE drawing path does not yet consume those new instance states. It reads natural and Location draw parameters from prepared lists; existing files also supply support circles and query fields. Uncovered subregion branches report errors rather than use generic substitutes. The fixed-request base triangle mesh is integrated into UE. Complete scenes for other inputs still require validation branch by branch.
The current orchestration calls the original scene entry point once for each pass. The back pass rereads the same request and static files, plus the new intermediate R8 field, instead of continuing from all front-pass C++ objects. File-based transfer preserves the standalone program’s stage checkpoints for bytewise comparison, at the cost of repeated early work and a runtime dependency on intermediate directories. An in-memory interface could suit a long-lived service, but call order should not be changed before establishing a same-input, same-output baseline.
Rereading affects validation. After the front pass writes phase64, CPU intermediate-field processing consumes only its triangles and two binding matrices. The back pass starts another scene invocation with the same request and the new 128² R8 file. If request text, static directories, or working directories change between calls, the intermediate R8 field no longer matches the back pass’s inputs. A fixed request and serial session currently limit this risk. Concurrent level generation would require separate working directories and input packages whose content hashes remains fixed for the entire session.
The project provides a command-line validation entry point. Full mode runs the front pass, CPU intermediate-field processing, and back pass, then compares five files: front-pass result, 512² query mask, 128² intermediate R8 field, back-pass result, and height triangle mesh. Files must be readable, equal in length, and byte-identical; image similarity does not replace these checks. The tool still contains machine-specific default paths and fixed reference directories. The reported five-file pass applies to the files in the handoff record. It neither makes the test reproducible on another machine without preparing inputs nor establishes bytewise agreement for the complete UE world and objects.
The Triangle-Mesh Interface to the Height Session
Before creating a terrain session, the terrain-management Actor checks the fixed-terrain mode and upstream package path. When enabled, it synchronously generates the upstream mesh and places its bytes in the session configuration. After startup, the height-processing core prefers this array; an empty array falls back to the package’s pregenerated mesh file. Height rasterization, R16 tile extraction, and mesh creation then use the same downstream implementation for either source.
Upstream generation runs synchronously before Session->Start(), contributing to startup time. The subsequent 4096² height computation runs in a background task. If upstream generation fails, the runtime logs a warning and reads the pregenerated mesh file. Validation needs the mesh source, size, and output content hashes from the logs. In a test requiring runtime generation, pregenerated-data fallback must count as failure.
The old prepared-input path can read a 4096² height cache that checks only file length, not input content or generator version. With a nonempty generated triangle array, the new upstream branch bypasses reads and writes to that shared cache, preventing an old terrain result from being reused after a request change. However, local configuration still supplies the upstream package root, and the network generation-configuration digest does not fully include package content hashes. Cache bypass alone does not prove identical cold generation for arbitrary requests on different machines.
Runtime generation and failure fallback call the same terrain generation session and mesh-creation code. Because the prepared file belongs to the fixed request, both paths can produce the same image and even the same R16 digest. Startup logs need the upstream invocation, failure reason, mesh source, record count, and height-cache use. Independent-generation tests should disable silent fallback, clear old caches, and inspect stage outputs.
Porting Height Computation to the CPU
The upstream output consists of triangles with horizontal positions and heights, which still need height processing before UE can build collision. The height-processing core must rasterize them onto a common pixel grid, then filter and draw local heights in the same order. The following details concern the C++ migration; the earlier articles explain source-height assignment, instance selection, and support calculation in full.
Coverage Rules Before Barycentric Interpolation
Height inside a triangle can be expressed using barycentric weights:
h(P) = λ₀h₀ + λ₁h₁ + λ₂h₂
λ₀ + λ₁ + λ₂ = 1
The implementation must first assign pixel center P to a triangle. Adjacent triangles share an edge. A pixel center on that edge must be written by exactly one triangle. The CPU rasterizer constrains screen coordinates to a fixed-point grid, decides coverage with edge functions and the top-left rule, then calculates weights. Vertex winding, Y direction, and boundary tests must be handled together.
Figure 2: The 17.5-meter result on the left is a barycentric interpolation example. The right shows shared-edge pixels belonging to one triangle only. These values are not measurements from the current terrain.
The fixed request contains 87,707 base height triangles and produces a 4096² floating-point field. The stage comparison reports identical coverage decisions, a maximum height difference of about 0.0000076 meters, and matching float32 bit patterns for about 94.55% of pixels. Coverage agreement and bit-pattern agreement are separate metrics. The runtime upstream path supplies the same record format to this rasterizer rather than introducing a second implementation.
The latest materials retain six 4096² pre-encoding floating-point arrays from this CPU chain, each 67,108,864 bytes. The six actual stage images use the same world extent and a common −43.914 to 61.833-meter color scale, with axes in world meters. The 2048-meter square is the computation domain; radial outer blending later defines the transition between the main terrain and the vista.
Figure 3: Actual CPU raster output. The triangle mesh has formed the main terrain, before natural Stamps, Location textures, support, or outer processing. The common scale represents height, not error relative to the reference target.
Sampling Conventions in Multilevel Filtering
The base triangle mesh leaves boundaries, local steps, and relief at different scales. Multilevel filtering produces smoothing at several resolutions and combines them into continuous base terrain. The CPU port must preserve sampling conventions as well as the bilinear formula: texel centers, fractional-coordinate quantization, operation order, and boundary clamping all affect the output.
a = h00 + fx × (h10 − h00)
b = h01 + fx × (h11 − h01)
h = a + fy × (b − a)
Figure 4: Four illustrative heights explain one bilinear sample on the left; the right shows data passing between filtering resolutions. The 23.75-meter result is not a measurement from this map.
The CPU implementation quantizes fractional sample coordinates to the required subtexel precision and preserves the reference path’s multiply-add form. Rearranging operations at higher precision and converting to float only at the end can change the last bits even when the expression is mathematically equivalent. The recorded maximum filtering difference is about 0.00033 meters. It applies to that fixed input batch and cannot be added to other stage maxima to obtain final error.
Figure 5: Actual output after multilevel filtering. It adjusts slopes and boundary transitions in the raster result; instance height textures have not yet been drawn.
Sequential Blending in Stamp Overlap Regions
Each natural Stamp or Location draw has its own instance transform, texture, and blend state. When draws overlap, each reads the height left by the previous draw and updates it using its current rule. Instance order and blend state matter as much as resource count. Combining every draw into one additive detail image would lose this behavior.
Figure 6: The 10-, 2-, and 3-meter values illustrate overlapping writes, not actual resource height parameters.
The current runtime reads prepared natural and Location draw lists, loads their assets, and draws them sequentially on the CPU. Stage records report maximum differences of about 0.018 meters for natural Stamps and 0.165 meters for Location textures. That maximum describes the largest measured difference, not an offset shared by all Locations; write order and state must be inspected in overlap regions. Although the upstream module computes natural Stamp candidates, this runtime draw path is not yet driven by those new outputs.
Figure 7: Actual height after natural Stamp drawing. Local relief is written into the filtered field using each item’s blend rule; not every change is a positive height addition.
Figure 8: Actual height after Location texture drawing. Its input already includes natural Stamps. Location shapes are added in the current UE chain’s actual execution order.
Meter-Scale Local Residuals in Location Support
Location support computes a target height and transition on existing ground. Later placement determines the building model’s final Z. Support uses circular or other geometry, effective bounds, neighboring Locations, terrain-envelope queries, and noise. A single height write can be expressed as:
Hout = (1 − α) × Hin + α × T
Here T is the support target, while spatial bounds, adjacency, and noise determine α. The final heightmap alone cannot easily distinguish target-height error from blend-weight error. Given Hin, Hout, and T for one write, the weight can be inferred as α = (Hout − Hin)/(T − Hin). This inference is unsuitable when the denominator is near zero.
Figure 9: Support bounds produce an initial weight, then adjacency and noise modify it. The inverse calculation at the lower right diagnoses one write only.
One investigation found an intermediate neighboring-angle result missing from the subsequent calculation, causing local sector errors much larger than ordinary floating-point differences. After correction, the handoff record reports a reduction in maximum support difference from about 3.94 meters to 1.0283 meters, with a mean absolute difference of about 0.0321 meters over unequal pixels. The mean’s denominator is the number of unequal pixels, not all pixels. The roughly 92.51% agreement figure also uses floating-point numerical equality and must not be described as raw-byte-for-byte equality. The remaining local residual of about one meter prevents a claim of numerical equivalence.
A later change sorts neighbors by center distance and skips costly angle calculations when the distance term can no longer change the current result. The handoff brief and commit record report bit-identical support output before and after optimization under the same inputs, with time reduced from about 10.4 to 2.9 seconds. This checks whether optimization changed the output; it does not compare that output with the reference. The optimization comparison was not rerun for this article. Another attempt to skip neighbors earlier using geometric center-distance bounds made the result worse and was reverted. The distance calculation uses an approximate reciprocal square root whose result can cross the ideal mathematical bound. Skip conditions must hold for the numerical implementation, not just for real-number geometry. The speedup left the 1.0283-meter local residual unchanged.
Figure 10: Location support applied after both height-texture stages in the current UE chain. It continues to adjust local ground and documents the actual order; it does not establish agreement with the support order in the earlier articles.
Support and Texture Order
The validated order in Parts I and II is base height, Location support, natural Stamps, then Location height textures. The current UE entry point instead draws natural and Location textures after base height and applies support last. Some support-query inputs also come from prepared files rather than a field recalculated in the current session. Execution order and support input sources remain key unresolved differences in the combined chain.
Even if texture drawing is simplified to addition, support and drawing do not commute. Let S(H)=(1−α)H+αT and A(H)=H+d; then A(S(H))−S(A(H))=αd. With H=10, T=20, α=0.5, and d=4, support followed by drawing gives 19 meters; reversing the order gives 17 meters. Actual processing also queries heights and recalculates weights, so its differences can be more complex than this fixed-weight example.
Figure 11: A fixed support weight illustrates why the two orders produce different heights. The upper section also relates support weights to height targets.
Separate rasterization, filtering, drawing, and support comparisons do not establish that the current combined UE entry point matches the final height from Parts I and II. End-to-end validation must first align call order, support-query timing, and stage inputs, then save each output for the same request. Matching terrain digests from generated and pregenerated triangle mesh files show only that this input substitution did not change the current downstream result. They do not correct downstream ordering.
Exports also need consistent array orientation. In this capture, the raw natural Stamp and Location texture arrays use the opposite Y row order; their previews have been flipped into the same world orientation as the other stages. Subtracting file indices directly would compare heights at opposite ends of the map as if they occupied one position. Preserve raw arrays together with resolution, pixel centers, world extent, and row order before calculating adjacent-stage differences. Such differences measure how much a stage changed the height. Algorithm error requires comparison against the reference stage under the same inputs.
From the 4096² Floating-Point Field to Runtime R16
Outer blending connects the main terrain to its surroundings. Sampling and encoding then convert floating-point heights into UE vertex data. The process uses three resolutions and two outer-processing paths, each with its own coordinates and encoding conventions.
Differences in the Current Outer Blend
The runtime measures radius from the map center. It retains the main terrain within 620 meters, blends with a smooth weight between 620 and 680 meters, and uses the outer height beyond 680 meters:
t = clamp((r − 620) / 60, 0, 1)
a = t² × (3 − 2t)
Hout = (1 − a) × Hmain + a × Hvista
Figure 12: The square pixel domain and circular blend boundary are different concepts. The calculation at radius 650 meters is an illustrative example.
This entry point directly uses −43.914 meters in the floating-point result domain. The default outer path validated in Part II instead clears using a −39-meter configuration value, passes through R16 encoding, mip generation, and sampling, then blends. The current code does not reproduce that outer-texture chain, and the constants are not interchangeable. Part II’s bitwise agreement under identical inputs does not apply to this simplified path. Relating the new UE entry point to the reference requires retaining and comparing identical main-height inputs, outer textures, and encoding stages.
Figure 13: Actual height after current outer blending. The circular main area transitions to a constant outer height, while the square computation domain remains in the array. Runtime vertex sampling and R16 encoding follow.
Pixel Centers and Mesh Endpoints Are Different
The raw CPU field is 4096² over a 2048-meter extent, with a horizontal interval of 0.5 meters and samples at pixel centers. Part I also discussed a 4097² endpoint vertex grid containing both ends of the extent. The current UE session defaults to 2049² vertex heights. Changing array length alone does not give these representations the same coordinate semantics.
| Representation | Resolution | Position convention |
|---|---|---|
| Raw CPU height field | 4096² | Pixel centers within a 2048-meter extent |
| Endpoint vertex grid from Part I | 4097² | Includes both endpoints of the extent |
| Current UE vertex heights | 2049² | Map target indices into the 4096² array and select the nearest sample |
The runtime obtains a source index using round(targetIndex × 4095/(targetResolution−1)). This defines endpoint correspondence between the arrays. It is not bilinear resampling of a continuous field, nor does halving the resolution preserve all samples unchanged. Even if the raw pixels of a ridge remain unchanged, different vertex positions and sampling can change contact heights. Raw-field and UE vertex-field comparisons must therefore be retained separately.
The encoder then scans the current vertex field for global extrema zMin and zMax and quantizes each height to a 16-bit unsigned integer:
q = clamp(round((h − zMin) × 65535/(zMax − zMin)), 0, 65535)
hDecoded = zMin + q × (zMax − zMin)/65535
A constant-height field takes a separate zero-range branch to avoid division by zero. Otherwise, one encoding unit represents (zMax−zMin)/65535 meters. Since the range is calculated adaptively from the current result, equal metric heights at one position can have different q values on maps with different extrema. When sending mismatched tiles, the server must also check the range; equal integers do not guarantee equal decoded heights otherwise.
Figure 14: Resample to the runtime vertex field first, then encode using its shared extrema. The 0–50-meter range is a teaching example, not this map’s measured range.
Bringing Height Arrays into the UE World
UE constructs mesh geometry, normals, materials, and collision from the R16 height data. Numerical work runs in the session’s background task; the main thread reads ready tiles and creates components. Height completion, component creation, and collision cooking occur separately. Character movement in a multiplayer session must wait for the relevant physics state.
Tiling and LOD Share One Height Field
The session encodes the full vertex field with a common range before splitting it into 64 tiles. A tile with Q quads needs Q+1 vertex columns. The first column of the right tile and the final column of the left must index the same column in the global field. Independent sampling or quantization ranges per tile can create a seam even when boundary values differ by only one code unit.
Figure 15: With 256 quads per tile, column 256 of the left tile and column 0 of the right both refer to global column 256. Coordinates convert from meters to centimeters when UE vertices are created.
Display LOD changes the retained vertex stride within a tile. Identical R16 boundary samples do not guarantee that one long coarse edge and multiple fine edges describe the same triangle surface. The current mesh uses skirts to hide some visual gaps, while normals are calculated from full-resolution heights to keep lighting from changing with LOD. Triangle winding also matters: reversed winding can expose back faces even on flat ground, resembling a material or height-data error.
The dedicated server does not display these meshes, but still needs terrain components participating in physics. Clients can change display LOD with viewing distance; the server retains a fixed collision construction stride. Matching R16 digests therefore do not establish bitwise-identical visible triangles or all contact points across endpoints. Stability on slopes and LOD seams requires separate raycast and movement-path comparisons.
Units and coordinate systems also need explicit handling. Upstream horizontal extents and heights are measured in meters; UE components use centimeters. The height-processing core should retain its original units for numerical comparison and convert only during world-vertex construction and object placement. Multiplying by one hundred during input reads while retaining meter-based radii, support bounds, or outer thresholds could still produce visible geometry at incorrect relative positions. Shared edges must read the same global vertex indices before conversion into component-local coordinates. Adjacent bounding boxes alone do not ensure matching normals, collision surfaces, or vertices.
LOD should remain a display concern. A coarse visual mesh reduces triangle count, but must not make authoritative collision depend on each client’s camera distance. Otherwise, the same player can encounter different contact points on two machines. Separating display-mesh and server-collision sampling strides keeps collision construction independent of viewing distance. The fixed collision stride still requires boundary raycasts and character-movement regression checks.
Collision Cooking and Character Entry
Collision may still be cooking asynchronously after a dynamic mesh component is created, so a character cannot yet stand on it reliably. The terrain path attempts to connect submission, landing positions, collision readiness, and server-side Pawn replacement in order. Network acknowledgment and repair have not yet been incorporated into one strict entry state machine. The dedicated server hides terrain visuals but retains collision; omitting its terrain components would remove the physical ground that corresponds to the client display.
Figure 16: The numerical field, mesh, collision, and character have separate readiness points. The dedicated server retains authoritative collision without displaying the ground. The diagram does not establish a complete state machine covering all character-entry conditions.
Two migration issues unrelated to height values directly obstructed runtime validation. A runtime character Blueprint class held through an ordinary static reference became an invalid class pointer after garbage collection; the project explicitly retained the class object. Replacing the PlayerController also failed to carry over the template’s input mapping automatically, so characters spawned but could not move with the expected controls. The handoff materials report an engine fix for remote-character animation affected by a dynamic terrain movement base. That engine patch is outside this project’s source review, so its presence in a commit list is not evidence that its source and runtime behavior were independently checked here.
Assembling and Independently Checking Locations, Rocks, and Vegetation
The layouts calculated in Part II still require asset resolution, level or instanced-mesh creation, matrix handling, and collision in UE. The current tiled height digest covers only R16 terrain, not object agreement. Generating an upstream triangle mesh does not automatically replace every scene-placement input.
From Location to Cell: Layout Records and Level Streaming
The current entry point reads Location layouts, calculates Cell world transforms from position and orientation, queries terrain height to place level instances, and removes overlapping old platforms. Buildings and platforms come from separate Location level assets. Their loading status must be checked after terrain computation. The streaming path waits for sublevels, which may extend startup as Location counts grow.
Two heights must be distinguished. Algorithmic Location support calculates ground targets and transitions to accommodate a Location. Runtime Cell placement locates an asset using its own origin, local offsets, and ground query. Correct support does not guarantee aligned building floors, entrances, or collision. Checks should retain Location identity, world XY, orientation, support target, Cell world matrix, and the final terrain sample for the same Location. Measuring only the visible gap beneath a building cannot distinguish support, coordinate-transform, and asset-pivot errors.
The demonstration reads 54 Location records and assembles their Cells. Complete POI selection from mission conditions during UE startup has not been validated. Spawn and extraction positions near the main outpost also use fixed arrangements for this demonstration; Location selection, substructures, and interactive content require separate checks.
Figure 17: POI close-up at 8 seconds in the September 23 recording. Building components, platforms, and surrounding natural objects are present in UE. This shows assembly, not complete POI selection or validated building collision.
Rocks: Algorithm-Retained and Runtime-Assembled Counts
Rock inputs carry resource keys and transform matrices. The runtime groups them by resource key into instanced meshes, retaining matrix positions, heights, and orientations. Resource-resolution failure can skip content. Part II retained 3107 rocks on the algorithm side; the runtime record assembled 2854, leaving a difference of 253. Resource-loading failure paths exist in the source, but without a per-instance difference table, the entire discrepancy cannot be attributed to one missing resource type.
Locating this difference requires tracking the same identity through candidate generation, algorithm retention, export, resource resolution, and final instance creation. Two final counts cannot distinguish export omissions from UE assembly filtering, nor establish that every created mesh has collision usable on the server.
Vegetation: Preserve Orientation, Resample Ground Z
Vegetation is also grouped by resource key. It preserves input rotation and scale, but resamples the current R16 ground and replaces final Z. Part II’s earlier grounding and orientation errors for 1474 instances therefore cannot be treated as errors in the current UE instance matrices: height inputs, sampling, and quantization can differ. Substitute assets used when real meshes are unavailable establish visible placement only, not validation of final tree geometry, materials, or collision.
Figure 18: Terrain, Locations, rocks, and vegetation use different inputs and assembly paths. Only terrain tiles participate in the current R16 digest; other objects need separate checks of identity, transforms, assets, and collision.
Tree materials initially appeared in the editor but disappeared on instanced meshes. The fix required the instanced-mesh usage flag, resaving the assets, and including them in the packaged build. Height errors and R16 hashes contain no material state. Rocks, trees, and Locations that block characters also need server collision so authoritative movement corresponds to the client scene.
Figure 19: Buildings, rocks, and trees at 20 seconds in the same recording. The resources form the traversable scene; object identities, final matrices, and server collision still require independent checks.
Network Height Digests and Generation Paths
The dedicated server sets authoritative configuration. Clients receive it through replication, check the version, and start local terrain sessions. The shared C++ implementation reduces full-heightmap transmission in normal operation. Agreement also requires matching requests, static resources, random state, call order, caches, and quantization ranges.
The protocol checks generation configuration and content separately. The configuration digest corresponds to RecipeDigest in the code. The generation-configuration digest includes version, seed, resolution, selected parameters, and path strings for the old height package and draw directory. Equal paths do not establish equal file contents, and the new upstream package root is not yet fully represented in input-file versions and content hashes. Content digests are calculated from quantized R16 tiles and combined into a field digest. They check current runtime height samples, not the original 4096² float buffer, object matrices, resource-loading results, or collision triangulation.
Figure 20: Endpoints compare the configuration digest and R16 tile digests, then send mismatched tiles as needed. This is height-data repair, not complete scene-object synchronization.
For a mismatched tile, the client submits coordinates. The server extracts authoritative R16 samples, compresses them with zlib, and sends fragments. The client checks that the quantization range matches, assembles and decompresses the data, writes it back, and recalculates the digest. Meshes and collision must be rebuilt for that tile and neighbors affected by shared edges. With no mismatches, the full field need not be transmitted; repair can correct local differences with limited data.
Tile repair must include samples shared with neighbors. Tiles share vertex rows or columns in world space. If one side changes while the adjacent tile retains its old mesh or collision, a visual or physical seam can return. Repair completion therefore requires the relevant components to consume the new samples, not merely receipt of compressed data and a new hash. A client’s reported digest should identify the terrain version it has adopted. Without explicit state relationships among digests, component rebuilds, and character entry, digest agreement and collision readiness can occur at different times.
The early fixed-input demonstration reported zero R16 digest mismatches across 64 tiles for one server and two clients, and the video shows two characters in the same scene. The pregenerated triangle-mesh path could have used the height cache. This establishes only the height result and multiplayer presentation of that run.
The September 29 logs record upstream sources explicitly. The server generated 4,209,936 mesh bytes in 1368 milliseconds; client 1 generated the same size in 1057 milliseconds. Client 2 failed because front-pass mask-rasterization triangles or binding inputs were missing and then read the package’s pregenerated mesh file. The server received two zero-mismatch acknowledgments, with matching height digests across all three endpoints. The final R16 height-digest check passed; independent upstream generation did not pass on all three endpoints.
Fallback logs must be retained alongside success logs. Prepared and newly generated inputs can produce the same heights, while the content digest contains no generation-path information. A test of independent generation must count upstream failure as failure and check agreement of input file contents and cache use at each endpoint. The independent export metadata and network logs also contain different generation-configuration digests. Equal height digests do not make them one experimental configuration.
Figure 21: Two characters in the September 23 video at 36 seconds. It shows multiplayer scene presentation. The later September 29 height digests and upstream sources are established separately by endpoint logs.
The server currently adds a player to the acknowledged set before completing some generation-configuration checks and repairs. This order does not guarantee that all validation and collision readiness checks finish before character entry. Network acknowledgment, terrain submission, Pawn replacement, and object collision still need explicit completion conditions and state transitions.
Validation Results and Their Scope
The table collects early stage comparisons and later runtime logs, each with its own version, inputs, and measured domain. Project source, capture files, and endpoint logs were checked for this article; UE commands were not rerun locally. File sizes and SHA-256 values match the archive records, confirming which files were reviewed. Reference agreement still depends on the corresponding comparison experiment.
Four independent checkpoints are needed. Upstream byte checks hold request and static files fixed and compare the front-pass output, 512² query, 128² intermediate R8 field, and final mesh. Height-stage checks hold mesh and draw inputs fixed and compare rasterization, filtering, support, and natural/Location drawing to locate numerical and ordering differences. Runtime checks record actual input sources, cache hits, R16 range, and tile digests to determine whether UE used the newly generated result. Scene checks inspect component collision, Location levels, and natural-object identities and matrices. Passing one layer does not validate the next.
A digest compares only the bytes included in its calculation, not the generating algorithm or path. Upstream fallback, shared old caches, or different floating-point calculations quantizing to the same R16 can all produce equal digests. Conversely, similar float values on opposite sides of a quantization threshold can produce an R16 mismatch. Sampling domains, encoding domains, and input identities must be stated before interpreting a comparison.
| Comparison target | Recorded result | Supported conclusion |
|---|---|---|
| Upstream front pass, CPU intermediate-field processing, and back pass | Five files byte-identical for the fixed request; about 1042 milliseconds | Upstream C++ matches the specified baseline for those inputs, not other requests |
| Upstream mesh entering runtime | 87,707 triangles generated; final terrain digest matches the pregenerated-mesh path | This input transfer produces the same digest in the current downstream path; not all downstream inputs are newly generated |
| Base height rasterization | Coverage agrees; maximum difference about 0.0000076 meters | Raster-stage comparison with fixed triangles |
| Final multilevel filter output | Maximum difference about 0.00033 meters | Independent filtering comparison |
| Natural Stamp / Location textures | Maximum differences about 0.018 / 0.165 meters | Separate comparisons with fixed draw inputs |
| Location support | Maximum difference about 1.0283 meters; mean over unequal pixels about 0.0321 meters | Independent support comparison with a local meter-scale residual, not the current UE chain’s final error |
| Early server and two clients | Zero digest mismatches across 64 R16 tiles | Early fixed-input network record; prepared path may have used a cache |
| September 29 upstream sources | Server and client 1 generated; client 2 fell back after missing intermediate R8 inputs | Independent upstream generation did not pass on all three endpoints |
| September 29 network heights | Both clients reported zero mismatches; 64 tiles and matching field digest | R16 height check passed for that run; it does not cover objects, collision, or all upstream sources |
| Latest retained stage outputs | Six 4096² float fields plus 2049² R16 and its range | Current CPU-stage changes can be inspected; these do not replace earlier reference-error metrics |
Part I’s older 99.7904% R16 agreement, Part II’s central 2048² pre-encoding float error of 0.803 millimeters maximum and 0.0186 millimeters RMS, and Part II’s full-field bitwise Vista agreement under identical inputs remain separate experiments. They cannot establish an accuracy improvement for this UE chain. Nor can stage maxima in the table be summed, or their largest value selected, as final map error.
Performance records also come from separate runs. The early height chain took about 20 seconds. Support was later reduced from about 10.4 to 2.9 seconds, with a reported height-chain time of about 9 seconds; upstream triangle generation has a separate roughly 1-second record. The materials do not provide complete hardware, build, and stage-timing details. These times indicate workload scale, but cannot be combined into a controlled benchmark. Cached startup and cold generation also require separate measurements.
The latest outputs retain front- and back-pass intermediates, the 512² query, 128² intermediate R8 field, six 4096² stage float fields, 2049² R16, its range, and tile digests. The independently exported vertex field has a range of −43.9140015 to 51.6293335 meters. This serves R16 decoding, while the common stage color scale serves visualization. The ranges belong to different representations and their extrema cannot directly measure height error. Per-instance vegetation and rock world matrices, along with complete collision and entry-state validation, are still absent. The retained outputs now allow later diagnosis without inferring intermediate calculations from final screenshots.
The next step is to drive downstream processing from the upstream results generated inside UE: form runtime draw lists from natural and Location instances, recalculate Location support from the new base height, align ordering with the validated chain in the earlier articles, then measure final float heights and R16 under identical inputs. Networking needs input-file versions and content hashes and independent cold-generation tests on the server and two clients with pregenerated-data fallback disabled. Scene validation must explain the rock-count difference and check vegetation matrices, Cell resources, and server collision. Other seeds, biomes, complete POI selection, Scatter, and surface Layers need separate validation; one fixed tundra map cannot establish those results.
AI Collaboration Review
AI collaboration here focused on matching source interfaces to runtime inputs. Subdivision, Location, route, and natural-resource scheduling code was already present, but the terrain-management Actor’s session configuration had to be traced to identify which results reached their consumers. Comparing mesh bytes, drawing inputs, and terrain digests separated the integrated base mesh from downstream inputs still supplied by prepared files.
The main risk was confusing final results with how they were produced. Visible terrain could come from fallback, equal digests could come from an old cache, and faster support could retain the same residual. AI tools helped compare commits, locate interfaces, and organize stage records. Conclusions still depended on specific inputs, outputs, and logs, with implementation, execution, and validation recorded separately. Once upstream instances, support, and runtime objects share one chain with recorded input-file versions and content hashes, the complete request-to-scene process will need another validation run.




















