Road elevation is now sampled at the point on the road segment nearest the column being carved, instead of at the segment's midpoint. The old behaviour gave every column near a segment that segment's single midpoint height, so each stretch of road was one flat plank and consecutive planks stepped like a staircase wherever the road crossed a gradient. Elevation now varies continuously along the segment, and because neighbouring segments share an end point the height matches exactly at the joins. A new ROAD_GRADE_SMOOTHING constant dials between holding a straight grade (cut-and-fill) and hugging the land, per D-021. Untouched: density field, Marching Cubes, chunk dimensions, the .dat contract, and the 2D A* road network itself. Only how existing paths are carved into 3D. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
45 lines
No EOL
2.1 KiB
C#
45 lines
No EOL
2.1 KiB
C#
namespace IslaApocalypse.Core
|
|
{
|
|
public static class Constants
|
|
{
|
|
// Chunk Dimensions
|
|
public const int CHUNK_SIZE_X = 24;
|
|
public const int CHUNK_SIZE_Z = 24;
|
|
public const int CHUNK_HEIGHT = 256; // Our agreed-upon depth!
|
|
|
|
// World Generation
|
|
public const float ISO_LEVEL = 0.0f; // The threshold for Marching Cubes
|
|
public const float VOXEL_SCALE = 1.0f; // 1 Pixel = 1 Meter
|
|
|
|
// --- APPEARANCE TUNING ---------------------------------------------
|
|
// How many metres it takes for one surface material to fade into the
|
|
// next (grass -> dirt -> stone) on the rendered mesh.
|
|
//
|
|
// TUNE THIS BY EYE: bigger = softer, more gradual fade.
|
|
// 0.0 = hard switch, exactly like the old banded look
|
|
// 2.0 = default, a gentle two-metre blend
|
|
// 4.0+ = very soft, materials smear into each other
|
|
//
|
|
// Colour only. This does NOT affect terrain shape, collision, or what
|
|
// block is actually stored in a voxel.
|
|
public const float BLEND_BAND_METERS = 2.0f;
|
|
|
|
// --- ROAD GRADE TUNING ---------------------------------------------
|
|
// How much a road "holds a grade" instead of following every bump in
|
|
// the ground underneath it. Roads exist to be DRIVEN on, so this is a
|
|
// driveability setting, not a cosmetic one.
|
|
//
|
|
// 0.0 = hugs the land: the roadbed follows the terrain exactly.
|
|
// Never steps, but inherits every lump the ground has.
|
|
// 1.0 = holds a grade (default): each stretch of road is a straight
|
|
// ramp between its two path points, cutting through small
|
|
// bumps and filling small dips. Smoothest to drive.
|
|
//
|
|
// Values in between mix the two. Raise toward 1.0 for a more
|
|
// engineered road, lower toward 0.0 for a more rustic one.
|
|
//
|
|
// NOTE: this affects road ELEVATION (terrain shape under the road),
|
|
// not colour. Tune it properly once vehicles exist to drive on it.
|
|
public const float ROAD_GRADE_SMOOTHING = 1.0f;
|
|
}
|
|
} |