载入中...
搜索中...
未找到
HexMapTerrain.cpp
浏览该文件的文档.
34 settings.highRiseProbability = params.getFloat("highRiseProbability", settings.highRiseProbability);
50 settings.precipitationFactor = params.getFloat("precipitationFactor", settings.precipitationFactor);
55 settings.extraLakeProbability = params.getFloat("extraLakeProbability", settings.extraLakeProbability);
106 terrain.params.push_back(ParamDescriptor::integer("width", "Width", 20, hexmap::HexMetrics::kChunkSizeX,
108 terrain.params.push_back(ParamDescriptor::integer("height", "Height", 15, hexmap::HexMetrics::kChunkSizeZ,
110 terrain.params.push_back(ParamDescriptor::integer("landPercentage", "Land Percentage", 50, 1, 99));
112 terrain.params.push_back(ParamDescriptor::integer("riverPercentage", "River Percentage", 10, 0, 50));
117 terrain.params.push_back(ParamDescriptor::integer("erosionPercentage", "Erosion Percentage", 50, 0, 100));
119 ParamDescriptor::floating("highRiseProbability", "High Rise Probability", 0.25f, 0.f, 1.f, 0.01f));
120 terrain.params.push_back(ParamDescriptor::floating("sinkProbability", "Sink Probability", 0.2f, 0.f, 1.f, 0.01f));
124 terrain.params.push_back(ParamDescriptor::floating("windStrength", "Wind Strength", 4.f, 0.f, 16.f, 0.1f));
135 ParamDescriptor::integer("subdivision", "Subdivision", 4, 0, hexmap::kMaxHexSphereSubdivision));
136 sphere.params.push_back(ParamDescriptor::floating("radius", "Radius", 100.f, 1.f, 10000.f, 1.f));
137 sphere.params.push_back(ParamDescriptor::integer("landPercentage", "Land Percentage", 45, 1, 99));
140 sphere.params.push_back(ParamDescriptor::floating("frequency", "Frequency", 1.55f, 0.1f, 16.f, 0.05f));
163 return Result<Value>::success(hexmap::hexTerrainBakeToValue(hexmap::snapshotHexSphereTerrain(map)));
167 cls.addFunc("generateHexTerrain", [vm = cls.getHandle()](Procgen*, ScriptProcgenParams* params) -> ssq::Table {
Stable, structured diagnostics shared by engine modules.
Deterministic procedural map generation for the hex grid.
Editable hex cell grid: topology, queries, picking and authoring.
Pointy-top hex metrics, directions and vertex helpers.
Procedural terrain generator for a spherical hex map.
Editable spherical hex map over an icosahedral hex topology.
Icosahedral hex topology: twelve pentagons and hexagons on a sphere.
Terrain bake hexmap applies; procgen produces the payload.
Optional hexmap terrain bake bindings for Procgen.
The single Squirrel projection for common Result, Status and Value.
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={}, DiagnosticDetails details={}, std::string source={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.h:125
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:175
Result< void > reset(std::int32_t cellCountX, std::int32_t cellCountZ, std::uint32_t seed)
Replaces the grid with a new cellCountX * cellCountZ map.
Definition HexMap.cpp:37
Result< void > reset(std::int32_t subdivision, float radius, std::uint32_t seed)
Replaces the map with a new sphere of 10 * 4^subdivision + 2 cells.
Definition HexSphereMap.cpp:52
Registry for executable generators and their reflection metadata.
Definition GeneratorRegistry.h:23
void registerAlgorithm(const std::string &id, GeneratorFn fn)
Register an algorithm without metadata for backward compatibility.
Definition GeneratorRegistry.cpp:11
Intermediate 2D generation result. cells store semantic ids (see Semantic.h), not tile GIDs — convert...
Definition Grid2D.h:36
Procedural generation module. Phase A: runtime maps (semantic Grid2D → TileLayer)....
Definition Procgen.h:146
static eve::script::Borrowed< Params > resolve(ProcgenParamsHandleRef reference) noexcept
Resolves parameters as a non-owning observation.
Definition Procgen.cpp:403
HexTerrainBake snapshotHexSphereTerrain(const HexSphereMap &map)
Snapshot every cell of a spherical map into a bake.
Definition HexTerrainBake.cpp:96
Result< void > generateSphereMap(HexSphereMap &map, const HexSphereGeneratorSettings &settings)
Regenerates every cell of map procedurally.
Definition HexSphereGenerator.cpp:124
constexpr std::int32_t kMaxHexGridDimension
Largest grid edge, in cells, any entry point may request.
Definition HexMap.h:47
HexTerrainBake snapshotHexTerrain(const HexMap &map)
Snapshot every cell of a planar map into a bake.
Definition HexTerrainBake.cpp:81
constexpr std::int32_t kHexDirectionCount
Number of hex edges / facing directions.
Definition HexMetrics.h:62
constexpr std::int32_t kMaxHexSphereSubdivision
Largest supported subdivision level; 10 * 4^7 + 2 = 163842 cells.
Definition HexSphereTopology.h:22
Value hexTerrainBakeToValue(const HexTerrainBake &bake)
Project a bake into the script Result payload.
Definition HexTerrainBake.cpp:111
Result< void > generateHexMap(HexMap &map, const HexMapGeneratorSettings &settings)
Replaces the grid's contents with a procedurally generated map.
Definition HexMapGenerator.cpp:1221
Result< Grid2D > generate(std::string_view operation, const GenerateSettings &settings)
Generate.
Definition GridGraphAlgorithms.cpp:154
Definition EvpackPointGraphLoader.h:12
void registerHexTerrainAlgorithms(GeneratorRegistry ®istry)
Register hex.terrain / hex.sphere schemas when hexmap is present.
Definition HexMapTerrain.cpp:100
Result< Value > generateHexTerrain(const Params ¶ms)
Bake a planar hex map into the script Value hexmap applies.
Definition HexMapTerrain.cpp:146
Result< Value > generateHexSphere(const Params ¶ms)
Bake a spherical hex map into the script Value hexmap applies.
Definition HexMapTerrain.cpp:155
void exposeHexTerrain(ssq::Class &cls)
Expose generateHexTerrain / generateHexSphere on the Procgen class.
Definition HexMapTerrain.cpp:166
ssq::Table projectStatusResult(HSQUIRRELVM vm, const Status &status)
Project a checked native status that carries no payload.
Definition SquirrelBinding.cpp:454
ssq::Table projectResult(HSQUIRRELVM vm, Result< void > &&result)
Consume and project a void native Result using the common schema.
Definition SquirrelBinding.cpp:470
@ InvalidArgument
@ StaleHandle
static ParamDescriptor floating(std::string key, std::string label, float defaultValue, float minimum, float maximum, float step)
Construct a bounded floating-point descriptor.
Definition ParamSchema.cpp:33
static ParamDescriptor integer(std::string key, std::string label, int defaultValue, int minimum, int maximum, int step=1)
Construct a bounded integer descriptor.
Definition ParamSchema.cpp:19
Complete metadata and parameter schema shared by every procgen recipe family.
Definition ParamSchema.h:52
std::vector< ParamDescriptor > params
Definition ParamSchema.h:56
Internal Squirrel proxy for a module-owned Params handle.
Definition ProcgenScriptObjects.h:8