scmJS docs

Making a map

A blank map#

scmjs map new ridge.scx writes the map File ▸ New makes: flat ground, eight open slots and nothing else, 128 × 128 Badlands unless you say otherwise.

$ scmjs map new maps/ridge.scx --size 96x64 --tileset jungle --players 2
✔ maps/ridge.scx: 96 × 64 · Jungle World · Brood War 1.04 · 2 start locations · 3.0 KB
Option What it sets
--size Width and height, each 64, 96, 128, 192 or 256, as the New dialog offers them
--tileset badlands, platform, install, ashworld, jungle, desert, ice or twilight
--name, --description The map's name (the file's name without its extension by default) and description
--players 2 Start locations for players 1 and 2, placed in a ring as Tools ▸ Auto-place does, with the other slots closed, so the map passes Check Map as it is. --layout corners puts them in the corners
--revision remastered A Remastered map
--force Writes over a file that is already there; without it the command refuses

A name ending in .chk writes the bare scenario. Without the game's graphics the ground is written by its terrain ids, as the editor does when it has no game data; the map opens as it should and the editor fills in the tiles' looks when it saves. The same arguments always give the same file, byte for byte, so a map made in a build step is the same map every time.

A melee map from a seed#

scmjs map generate makes a melee map ready to play. Each player gets a main on high ground with one ramp down to a natural expansion; there are free bases where there is room, and a middle of low ground broken up by mesas, lakes and patches of the tileset's other ground. Every player's bases are copies of one another, and the command walks the map before writing it to check that they are as far apart as they should be.

scmjs map generate "(2)Jungle Duel.scx" --seed 1207
scmjs map generate "(4)Crossing.scx" --players 4 --tileset desert --seed 2026
✔ (4)Crossing.scx: 128 × 128 · Desert · 4 players · seed 2026 · 29 KB
  Laid out   mirrored both ways · open · 4 ramps · 2 free bases
  Balance    walks the symmetry makes equal differ by 1.5% start to start, 5.0% to the free bases
  Check Map  no errors or warnings
  Layout     layout 2 of the 2 tried · StarCraft: Remastered 1.23.10.13515

    Player  Main                  Natural               Minerals  Gas     To the middle
    1       9 × 1,500 + 1 geyser  7 × 1,500 + 1 geyser  24,000    10,000  70 tiles
    2       9 × 1,500 + 1 geyser  7 × 1,500 + 1 geyser  24,000    10,000  71 tiles
    3       9 × 1,500 + 1 geyser  7 × 1,500 + 1 geyser  24,000    10,000  71 tiles
    4       9 × 1,500 + 1 geyser  7 × 1,500 + 1 geyser  24,000    10,000  70 tiles

  Ground distance start to start, in tiles (a straight line in brackets)
        P1         P2         P3         P4
    P1  –          141 (119)  93 (88)    123 (80)
    P2  141 (119)  –          124 (80)   92 (88)
    P3  93 (88)    124 (80)   –          141 (119)
    P4  123 (80)   92 (88)    141 (119)  –

The four-player desert map made from seed 2026, drawn by map preview

(4)Crossing.scx from the command above, drawn with scmjs map preview --out.

It needs your copy of StarCraft, Remastered or 1.16.1. The ground is painted with the editor's isometric brush, which needs the tileset's terrain table to know which tile joins which, and the ramps are the tileset's own. Without a copy the command says so and writes nothing.

Option What it does
--players 2, 3, 4, 6 or 8 (2 by default). Three players get the four-player layout with the fourth main and natural left without a start location, for anyone to take
--size 128 × 128 by default, 192 × 192 for eight players. Each side is 96, 128, 192 or 256, and at least 96 for two players, 128 for three to six and 192 for eight: the bases are a fixed size, so a small map runs out of room
--tileset jungle by default, or badlands, platform, ashworld, desert, ice or twilight. Installation is not offered, since none of its ground can be built on
--symmetry How the players' halves or quarters relate. rotational turns the map half round its centre; it is the default on a square map, and mirror-x on one that is not. mirror-x mirrors left to right, mirror-y top to bottom, and diagonal (two players on a square map) across the diagonal. Four and eight players are always mirrored both ways. Six players are three a side; mirror-y puts the sides at the top and bottom, which needs a map 192 wide or more
--style open (the default) keeps the ways out of the naturals clear; chokes lays more and bigger mesas, two of them either side of each natural's way out
--seed The number the map is made from. The same seed and options with the same copy of the game give the same file, byte for byte. Without --seed the command picks one and prints it, so you can make a map you like again
--rush Also walks an SCV between the starts in the game itself, as map rush does; this needs the game engine
--name The map's name, the file's name without its extension by default
--force Writes over a file that is already there
--json The summary as JSON

- as the file name writes the map to standard output.

What a generated map has#

Each main is a plateau with the start location, nine mineral fields of 1,500 and a geyser of 5,000 behind the town hall, away from the ramp. The ramp leads down to the natural: seven fields and a geyser, placed so the mineral line is out of the way up the ramp and the way to the middle. Free bases have six fields and a geyser. Resources are placed the way the Melee Wizard plugin places them: each field three tiles from the town hall, the closest the game allows, the line wrapping round the hall's corners and the geyser past one end. Cliffs and shores are drawn as StarEdit draws them, and each ramp goes where StarEdit's own rule places it, and is kept only if a unit can walk up it.

What it does not place: trees, rocks and other doodads besides the ramps, a third level of ground, bridges, neutral buildings and critters. Open the map in scmJS to add them, and look at it first with scmjs map preview:

scmjs map preview "(4)Crossing.scx" --out crossing.png --scale 8

How a generated map is balanced#

StarCraft's ramps all lead down to the south: no tileset has a ramp up a north-facing cliff. So a player's bases are never turned upside down with the map. A player at the bottom has their main above their ramp, like a player at the top, and the foot of the ramp is where the symmetry puts it. Every walk out of a main goes down its ramp, so the walks from the mains match to within a few percent start to start. The walks to the free bases match less closely, because a bottom player's main lies between its ramp and the ground above it. The summary gives both numbers.

Before the file is written, the map must pass Check Map, and every start location is walked to every other and to every free base, over the ground a unit can walk, with mineral fields and geysers in the way. Walks that the symmetry makes equal are compared: a pair of starts against its mirror image, and each player's walks to the free bases against those of the player it mirrors. A layout that fails is thrown away and the next one tried, twelve at most. When none is within 8%, the closest is written, its balance is marked "unbalanced" and the first line has a warning instead of a tick. When no layout passes, nothing is written and the command exits with 1.

The distances in the summary are the command's own walk, in tiles: to the middle of the map for each player, and start to start beside the straight line.

scmJS 0.12.1 · Generated from the repository. The source is under the MIT license, which does not cover what ATTRIBUTION.md lists. StarCraft and Brood War are trademarks of Blizzard Entertainment; this project ships none of their data.