Log inGet started
World

Joyride Harbor: Drivable Cars, Boats and Aircraft Kit (fork)

Branchmain
Commit1c413a2a76

README.md

joyrideIsland

Joyride Island's ground, baked: a 1400 x 1000 m landscape centred on the origin, 2 m a cell. A lagoon floor at -16 m; a broad plateau rising through sea level (y = 0) to y = 5, running long east-west with gentle sand beaches all round; a dead-flat runway bed along X at z = -70 (x -225 to 225); a flat paddock at y = 5 south of it for the kart track, helipad and plaza; a graded slip down to the south-west beach for the pier; two low hills (up to about 12 m) for relief. Three surfaces: beach sand below 2.4 m (groundMaterials' beachSand), short grass on the dry crown (groundMaterials' shortGrass) and rock on slopes over 26 degrees (the kit's own vehiclesKit.textures.islandRock_albedo / islandRock_normal). No water layer: the sea is laid by vehiclesKit.build.sea.

The island scene stands it with Terrain { terrain = "vehiclesKit.island.joyrideIsland" }. It ships baked rather than as a procGraph so that no installing world's engine recompiles a graph (a recompile on a newer engine writes nodes an older pinned @builtin lacks, which broke installs and pushes in 1.2.6 and 1.2.7).

Re-baking

Write this graph to a scratch .procGraph (under /zero/source/tmp), evaluate it once (procgen.preview with target output:ref runs the write), then move the container out of its folder and back so its child textures register, and rebuild the island scene. Keep H equal to the build's H, and regenerate vehiclesKit.islandPlacements after reshaping.

local proc = require("@builtin::systems.procgen.proc")

local H = 5.0

return proc.define(function(g)
    local ground = g.terrain.source({ size = { x = 1400, z = 1000 }, resolution = 2 })
    local bed = g.terrain.flatten({ raster = ground, at = { x = 0, z = 0 }, shape = "square", radius = 700, height = -16,
        blend = "replace", falloff = 0 })
    local plateau = g.terrain.ramp({ raster = bed, from = { x = -90, z = -20 }, to = { x = 90, z = -20 },
        width = 110, falloff = 200, fromHeight = H, toHeight = H })
    local hillA = g.terrain.cone({ raster = plateau, at = { x = 215, z = 75 }, radius = 75, height = 10, falloff = 30, blend = "add" })
    local hillB = g.terrain.cone({ raster = hillA, at = { x = -30, z = -150 }, radius = 70, height = 7, falloff = 30, blend = "add" })
    local relief = g.terrain.fbm({ raster = hillB, amplitude = 1.2, featureSize = 80, octaves = 4, blend = "add" })
    local runway = g.terrain.ramp({ raster = relief, from = { x = -225, z = -70 }, to = { x = 225, z = -70 },
        width = 22, falloff = 30, fromHeight = H, toHeight = H })
    local paddock = g.terrain.ramp({ raster = runway, from = { x = -130, z = 35 }, to = { x = 130, z = 35 },
        width = 55, falloff = 30, fromHeight = H, toHeight = H })
    local slip = g.terrain.ramp({ raster = paddock, from = { x = -150, z = 92 }, to = { x = -150, z = 140 },
        width = 6, falloff = 8, fromHeight = H, toHeight = 1.0 })
    local sand = g.terrain.mask({ raster = slip, name = "sand", input = "height", max = 2.4, feather = 0.8,
        jitter = 0.5, jitterSize = 30 })
    local rock = g.terrain.mask({ raster = sand, name = "rock", input = "slope", min = 26, feather = 5 })
    local grass = g.terrain.mask({ raster = rock, name = "grass", input = "height", min = 2.4, feather = 0.8,
        jitter = 0.5, jitterSize = 30 })
    local baked = g.terrain.write({
        raster = grass,
        name = "joyrideIsland",
        dest = "/zero/source/vehiclesKit.package/island.scene/joyrideIsland.terrainData",
        layers = "sand, grass, rock",
        surfaces = {
            { name = "sand", albedo = "groundMaterials.textures.beachSand_albedo", normal = "groundMaterials.textures.beachSand_normal",
                mask = "groundMaterials.textures.beachSand_mask", tiling = 3, tint = { 1.0, 0.9, 0.72 } },
            { name = "grass", albedo = "groundMaterials.textures.shortGrass_albedo", normal = "groundMaterials.textures.shortGrass_normal",
                mask = "groundMaterials.textures.shortGrass_mask", tiling = 3 },
            { name = "rock", albedo = "vehiclesKit.textures.islandRock_albedo",
                normal = "vehiclesKit.textures.islandRock_normal", tiling = 6 },
        },
    })
    g:output("ref", baked.ref)
end)