Generate terrain
terrain_heightmapBuilds open country from a seed word and writes its ground as a greyscale PNG (row 0 is north; chunk (i, j) is 128 by 128 tiles). By default the picture is one chunk at 8 bits and black is its lowest tile, white its highest; bits 16 writes it at 16 bits (65535 greys, so a 40 unit relief steps by under a thousandth of a unit and a game's terrain built from it shows no stairs), and raw (true) also returns heights.f32, every tile's exact height as little-endian float32, width by height, row 0 north. area {w, h} (each 1 to 8) makes a w by h block of chunks from (i, j) one picture on one grey scale, so a landscape is one call; range [lo, hi] fixes the grey scale in world units so separate calls tile. params sets country knobs by name (terrainAmp 0 to 40, terrainOctaves 1 to 5, slopeLimit, treeDensity, rockDensity, clumping, portWidth, padRadius, padJitter, corridorWidth, meander, palette, waterTable, ridgeHeight 0 to 400 with ridgeX0, ridgeZ0, ridgeX1, ridgeZ1 for a long hill along that line); an unknown or out-of-range knob is refused with the reason. The answer carries the height range, the grey scale used (greyFrom, greyTo, unitsPerGrey, so height is greyFrom plus grey times unitsPerGrey), the bits, wall and scenery counts and the digest. mesh (true, or {step} of 1 to 16 tiles between vertices) also returns the ground as terrain.obj, a Wavefront OBJ in world units (x east, y up, z south) with normals and UVs that runs to the area's far edge so the next area's mesh starts where it ends; by default the step is the smallest that keeps a side to 256 cells. glb (true) returns the same mesh as terrain.glb, a glTF binary with normals and UVs, at mesh's step. features (true) also returns features.json: where each tree and rock stands (x, y, z and half extents) and the scenery (kind, position, turns, scale), each listed once, with the ground's height under it. Costs 1 unit for any area.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"seed": "<seed>",
"i": "<i>",
"j": "<j>"
},
"name": "terrain_heightmap"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| i | Yes | The chunk column (east) to start from; chunks are 128 by 128 tiles. | |
| j | Yes | The chunk row (south) to start from; chunks are 128 by 128 tiles. | |
| glb | No | True to also return the mesh as terrain.glb, at the mesh step. | |
| raw | No | True to also return heights.f32, every tile's exact height as little-endian float32. | |
| area | No | A block of chunks, w by h (each 1 to 8) from (i, j), drawn as one picture on one grey scale. | |
| bits | No | Grey depth of the PNG: 8 (the default) or 16. | |
| mesh | No | True, or {step} of 1 to 16 tiles between vertices, to also return the ground as terrain.obj. | |
| seed | Yes | The seed word that makes the country; the same word, chunk and knobs give the same ground. | |
| range | No | Optional [lo, hi] in world units that fixes the grey scale, so separate calls tile on one scale. | |
| params | No | Country knobs by name (terrainAmp, terrainOctaves, slopeLimit, treeDensity, rockDensity, clumping, portWidth, padRadius, padJitter, corridorWidth, meander, palette, waterTable, ridgeHeight, ridgeX0, ridgeZ0, ridgeX1, ridgeZ1). An unknown or out-of-range knob is refused with the reason. | |
| features | No | True to also return features.json: where each tree, rock and scenery piece stands. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ms | No | Milliseconds the run took. | |
| job | Yes | The job id; the job tool reads it. | |
| verb | No | The tool that made it. | |
| files | No | Files made, each with a name, type, size and a signed URL. | |
| units | No | Units this call cost. | |
| result | No | The engine's own answer, a JSON document. | |
| status | No | queued when the job runs in the background. |