skirmishMapBuilder
Make a skirmish map for an rtsKit strategy game from one data table. You describe the battlefield (its baked ground, where the two bases stand, mines, woods, rocks, rivers, scenery) and `build` puts it in the world and hands back the layout rtsKit plays on: bases, build spots, re…
skirmishMapBuilder
Make a skirmish map for an rtsKit strategy game from one data table. You describe the battlefield (its baked ground, where the two bases stand, mines, woods, rocks, rivers, scenery) and build puts it in the world and hands back the layout rtsKit plays on: bases, build spots, resource nodes with the same ids on every machine, bounds and centre.
local C = require("skirmishMapBuilder.builder")
local SPEC = {
id = "alpineRidge", name = "Alpine Ridge", setting = "mountains",
bounds = { 160, 120 }, center = { 0, 0 },
terrain = asset.resolve("myMaps.alpineRidgeGround", "terrainData"), -- baked with skirmishMapBuilder.terrainBake
bases = {
{ team = 1, center = { -60, 0 }, townHall = { -64, 0 }, barracks = { -53, 8 }, facing = math.pi / 2, units = { -54, -5 },
extra = { { -61, 0, -11 }, { -53, 0, -3 } } }, -- free build spots { x, y, z }
{ team = 2, center = { 60, 0 }, townHall = { 64, 0 }, barracks = { 53, -8 }, facing = -math.pi / 2, units = { 54, 5 },
extra = { { 61, 0, 11 }, { 53, 0, 3 } } },
},
mines = { ... }, groves = { ... },
waters = { { x = 0, z = -40, w = 12, d = 30, level = -0.6 } }, -- open water unless you name a material
blockers = C.segmentBlockers({ { 2, -70 }, { -3, -45 } }, 2.5, {}), -- walls the stream for pathfinding
}
local layout = C.build(SPEC, { seed = 1 })
rtsSkirmishKit's Highland Ford map (rtsSkirmishKit.maps.highlandFord) is a complete spec to copy from.
What is in it
builder(C):C.build(spec, opts), plus the helpers map authors reach for:C.segmentBlockers(points, halfWidth, out)(walls a river or ridge line at any angle with overlapping axis-aligned boxes, no gaps),C.discBlockers,C.mirror(one base from the other),C.rng,C.prop, and the materialsC.OPEN_WATER(water for any map) andC.WATER(rtsKit's River Crossing water, which reads River Crossing's own depth map and belongs to that map only).terrainBake: bakes a map's TERRAIN description (height layers and material masks) into a.terrainDatathe builder references. Tool code: run it in edit mode after changing the ground.openWatermaterial: clear teal shallows, a deep blue-green channel and soft ripples, with no depth map, so it reads right on any map.
Built outside Play, a map is temporary: it is drawn in the editor but never recorded into the scene, so previewing a map while you write it leaves nothing behind.
Learn it
The guide "Example: build a second skirmish map" in rtsSkirmishKit builds a whole map with it step by step (Highland Ford, one of Warfront's seven maps). Warfront's seven maps (rtsSkirmishKit.maps.*) are all specs for this builder.
Where it comes from
Split out of Warfront (rtsSkirmishKit, world "Warfront: Real-Time Strategy Skirmish Kit") so any rtsKit game can use it. It needs rtsKit (pathfinding and the mine art) and the five prop packs the settings draw their scenery from. rtsSkirmishKit's rtsSkirmishKit.maps.common and rtsSkirmishKit.maps.terrainBake forward here.
Scoped to this part · feeds back into the world's score.