What it does
A map is a list of sectors. Each is a polygon seen from above with a floor height, a ceiling height, light and textures. The pack works out the rest: where two sectors' edges touch it makes an opening (a step when the floors differ, a lintel when the ceilings do), where an edge touches nothing it makes a wall, and where one sector is drawn inside another it cuts it out, so a pit, a raised dais or a pillar is just another shape. There are no line lists or side definitions to keep in step, which is what makes the format pleasant to edit and safe for a tool to write.
The moving parts are settings on sectors: a door drawn at its open height that shuts at the start and opens on use, a lift drawn at its top that lowers when stepped on, a crusher, a platform, a slime floor that hurts, a secret, a light that flickers. A jump pad throws whoever stands on it, either up and ahead or on an arc worked out to land on a ledge the map names, whatever the game's gravity. A sector can have its own gravity, so a low-gravity room is one number, and a conveyor or a wind can push what stands or flies in it. Lamps, torches and glows are points on the map with a colour, a reach and a flicker, which a game turns into real lights. Triggers are data too: entering a sector, using or shooting a wall, crossing a line or killing a tagged group can open doors, move floors, change light, switch lamps, play sounds, spawn enemies, teleport the player or end the level.
The world can live. Fixtures are things a player opens or breaks: a toilet stall's door or a gate on a hinge that swings and stops a body, a locker or filing cabinet whose contents come out when it opens, a pane of glass that stops shots until enough of them break it. Signs carry room numbers and warnings; screens show scrolling terminals, video, a hologram turning in the air, the level's plan or a security camera's view; flyers follow paths through the sky (a ship, birds, a blimp, a searchlight sweeping a yard). Floors, ceilings and walls can scroll, animate and carry a renderer's effect (rippling slime, a glowing computer wall). Triggers lock and unlock, break glass and change what signs and screens say. The map keeps all of it in its saved state, and hands a presenter what to draw.
Two shortcuts write the same format. Kit-bashing snaps prefab pieces together by named sockets at any angle: rooms, corridors, stairs and doors, and the pieces of real architecture, an octagonal hub, bends, window walls (zig-zag too), balconies, curved and spiral stairs, a courtyard with a walkway, a slime canal with a bridge, a computer room, a toilet block, an office and a lift to a ledge, each sized by its options. A grid paints a level as rows of characters, each a kind of floor, a window, a stall door or a locker, and merges them into sectors.
Features
- Polygons with heights — openings, walls, steps and lintels worked out from where edges touch; inner shapes cut out.
- Movers — doors that never close on a body, keyed doors, lifts, crushers and platforms, with sounds.
- Jump pads — up and ahead, or aimed at a point to land on, worked out for any gravity, with a sound.
- Gravity and pushes — a share of the game's gravity per sector, conveyors under the feet and winds through the air.
- Lights as data — lamps, torches, glows and spots placed on the map, switched on and off by triggers.
- Fixtures — hinged doors and gates, cabinets and lockers with contents, breakable and frosted glass.
- Signs, screens and flyers — text on walls, terminals, holograms, camera views and things crossing the sky.
- Moving surfaces — scrolling, animated and shimmering floors, ceilings and walls, and railings.
- Triggers as data — on enter, leave, use, cross, shoot, start and kill; open, close, move, light, lamp, sound, spawn, teleport, message, exit.
- Kit-bash pieces — a standard kit and made-to-measure pieces with sockets that snap together at any angle.
- Character grids — a level painted as rows, each character a floor, a door, slime or a secret.
- A checker for editors — every problem in a map as a sentence, before it is built, down to a jump pad aimed outside the map or above a ceiling.
- Collision, sight, shots and hearing — steps, headroom, drops, line of sight through openings, hitscan rays and sound through open doors.
- Routes — shared flow fields for crowds, doors and hinged doors named on the way, keys counted, glass respected.
- Meshes — floors, ceilings and walls with world-sized texture repeats, rebuilt only where something moved.
Good for
- A shooter in the style of the 1993 classics —
sector-shooterplays on it. - A level editor on the web — a format a tool can write without bookkeeping, and a checker to show what is wrong.
- Procedural levels — generate pieces and snap them, or generate a grid.
- A first-person adventure — doors, lifts, switches and triggers without a line of game code.
Make it yours
Every sector, edge, mover, fixture, sign, screen, flyer, trigger and thing is data, and every piece is sized by its options. A hand-drawn map of polygons with a crusher and a red door is one use; a refinery kit-bashed from an octagonal hub, a canal and a zig-zag window wall with hand-drawn yards around them is another; an office block of stall doors, lockers, terminals and camera screens painted as a character grid is a third. All come out the same.
A quick look
Snap pieces together and build the map.
const data = sectorMap.assembleMap({ place: [
{ id: 'start', piece: 'room-small', things: [{ type: 'start', x: 0, z: 2 }] },
{ id: 'hall', piece: 'corridor', join: { socket: 's', to: 'start.n' } },
{ id: 'up', piece: 'stairs', join: { socket: 'bottom', to: 'hall.n' } },
] }, sectorMap.standardKit());
const map = sectorMap.createSectorMap(data);
Works with
sector-shooter— a whole shooter on it.fps-enemiesandfps-bosses— enemies and bosses that walk it, throughenemyWorld().world-3d— draws the meshes it builds.cell-dungeon— for levels on one floor height in square cells.
Good to know
- One floor and one ceiling per sector: no rooms above rooms, no slopes.
- A jump pad's arc is worked out from the gravity where it starts; a path through other gravity or a wind lands elsewhere.
- Sectors touch along edges or nest inside one another; partly overlapping shapes are not supported.
- It draws nothing itself;
buildMesheshands any renderer the triangles and how each surface moves, and fixtures, signs, screens and flyers come as data to draw. - Fixtures are flat: a leaf is a line, a cabinet a box nobody stands on, a window one pane per edge.






