RUGENDOCS
Creating content

Stages

The stage .def file section by section, background elements (normal, anim, parallax), deltas, tiling, windows and motion, and rugen's platforms, arenas and zoom limits, with what is and is not supported yet.

A stage is one .def file plus one .sff with the background art, and optionally a music file. The .def describes the camera, where the players start, and a stack of background elements drawn back to front.

stages/Rooftop/
├── Rooftop.def
├── Rooftop.sff
└── rooftop.ogg

A minimal stage

[Info]
name = "Rooftop"
displayname = "Rooftop at Dusk"
author = "You"

[Camera]
startx = 0
boundleft = -160
boundright = 160
boundhigh = -40
tension = 50
verticalfollow = 0.2

[PlayerInfo]
p1startx = -70
p2startx = 70
leftbound = -1000
rightbound = 1000

[Bound]
screenleft = 15
screenright = 15

[StageInfo]
zoffset = 210
localcoord = 320, 240

[Music]
bgmusic = rooftop.ogg

[BGdef]
spr = Rooftop.sff

[BG Sky]
type = normal
spriteno = 0, 0
start = 0, 0
delta = 0.1, 0.1

[BG Floor]
type = normal
spriteno = 1, 0
start = 0, 160
delta = 1, 1
tile = 1, 0

Sections and keys

Values in Not read columns are accepted and ignored: keep them if you also target M.U.G.E.N or Ikemen.

[Info]

KeyDefaultMeaning
name“Training Room”Stage name; the StageVar(info.name) trigger compares against it
displaynamenameName shown on the stage select (strip and info panel)
author""Your name, shown in the stage select’s info panel

Not read: mugenversion.

[Camera]

All values are in stage units (localcoord).

KeyDefaultMeaning
startx0Camera x at round start
boundleft, boundright-150, 150How far the camera may pan left and right
boundhigh, boundlow-25, 0How far it may move up (negative) and down
tension50Distance from the screen edge at which a player starts pushing the camera
verticalfollow0.2How much the camera follows a jumping player (0 to 1)
floortension0Height a player must reach before the camera follows up
zoomout1Smallest zoom (most zoomed out), 0.1 to 1
zoomin1Largest zoom

Not read: starty, tensionhigh, tensionlow, overdrawhigh, overdrawlow, cuthigh, cutlow.

[PlayerInfo]

KeyDefaultMeaning
p1startx, p2startx-70, 70Start x of player 1 and 2
leftbound, rightbound-1000, 1000How far players may walk in stage space

Not read: p1starty, p2starty, p1facing, p2facing, the p3 / p4 keys.

[Bound]

KeyDefaultMeaning
screenleft, screenright15, 15How close a player may get to the screen edges

[StageInfo]

KeyDefaultMeaning
zoffset210Screen y of the floor (y = 0) when the camera is at rest
localcoord320, 240Coordinate space of the stage

Not read: zoffsetlink, autoturn, resetBG, xscale, yscale.

[Shadow] and [Reflection]

Not supported yet: rugen draws no player shadows or reflections, so intensity, color, yscale, fade.range and [Reflection] intensity have no effect.

[Music]

KeyMeaning
bgmusicMusic file, relative to the rugen folder first, then to the stage folder. OGG, MP3, FLAC or WAV; it always loops from the start.

Not read: bgvolume, bgmvolume, bgmloopstart, bgmloopend.

[BGdef]

KeyMeaning
sprThe stage’s .sff (required)
bgclearcolorr, g, b colour drawn behind everything (default black)

Not read: debugbg.

Background elements

Every [BG <name>] section after [BGdef] is one element, drawn in file order: the first is the farthest back.

KeyDefaultMeaning
typenormalnormal, anim, parallax or dummy
spriteno0, 0Sprite for normal and parallax
actionnononeAnimation for type = anim, from a [Begin Action n] block inside the stage .def
layerno00 behind the players, 1 in front
start0, 0Position: x from the stage centre, y from the top of the screen
delta1, 1Scroll speed relative to the camera (see below)
tile0, 01 repeats forever on that axis; n > 1 draws n copies
tilespacing0, 0Gap between tiles
velocity0, 0Constant movement in pixels per tick (clouds)
sin.x, sin.ynoneamplitude, period, phase: swaying motion
transnoneadd, add1, addalpha, sub
alpha255, 0Source and destination weights for addalpha
windownonex1, y1, x2, y2: only draw inside this screen rectangle
scalestart1, 1Draw scale (Ikemen key; handy for 2x art)
xscale1, 1parallax only: horizontal scale at the top and bottom
widthnoneparallax only: top and bottom width, instead of xscale

Delta: depth in one number

delta says how far the element moves when the camera moves one pixel. 1 moves with the floor; 0.5 is twice as far away; 0 is pinned to the screen (a sky); above 1 is nearer than the floor (foreground posts).

[BG Mountains]
type = normal
spriteno = 2, 0
start = 0, 40
delta = 0.3, 0.6
tile = 1, 0          ; repeat sideways so panning never shows an edge

Animated elements

[BG Flag]
type = anim
actionno = 10
start = 120, 60
delta = 0.8, 0.8

[Begin Action 10]
10,0, 0,0, 6
10,1, 0,0, 6
10,2, 0,0, 6

In stage animations rugen honours horizontal flip and per-frame scale, but not the frame’s own blend, vertical flip or angle.

Parallax floors

A parallax element is meant to stretch a floor sprite so the near edge scrolls faster than the far edge.

Not supported yet

  • BGCtrl / BGCtrlDef: no background controllers (Visible, Enable, VelSet, PosSet, Anim, SinX…) run yet; their sections are skipped.
  • Element keys id, positionlink, mask (colour 0 of indexed sprites is always transparent), windowdelta, maskwindow.

rugen extensions

[Platform]

Raised surfaces fighters can land on and walk off. Add as many sections as you like:

[Platform]
x = -220, -80      ; left and right end, stage units
y = -80            ; height above the floor (negative is up)

[Platform]
x = 80, 220
y = -80

A platform can also move or drop (arena hazards, timed from the start of each fight):

[Platform]
x = -230, -90
y = -240
path = -120, 0     ; offsets visited in order, then back: a closed loop
speed = 0.8        ; stage units per tick along the path (default 1)

[Platform]
x = 90, 230
y = -240
drop = 20, 5       ; every 20 s it falls away for 5 s (after 3 s of warning)

Fighters and items standing on a moving platform ride along; a dropping one lets them fall. To move its art with it, add platform = N to the [BG] elements that draw it, N being the platform’s place among the [Platform] sections (the first is 1):

[BG platform top -160]
type = normal
spriteno = 6, 0
start = -160, -52
delta = 1, 1
platform = 8       ; follows the 8th [Platform]

Platforms are one-way: a fighter jumps up through them and lands only when coming down from above; walking past an edge falls off. Double-tap down (twice within 14 ticks) while standing on a platform to drop through it; the main floor never drops. Helpers and projectiles ignore platforms. Characters can read the surface height with the GroundY and OnPlatform triggers. Legacy characters work unchanged: landing logic is the engine’s.

[Arena]

Platform-fighter rules: stocks, blast zones and pits. The ARENA mode’s stage select lists only stages that have this section, and the stage select shows them with an ARENA RULES tag.

KeyDefaultMeaning
blastzonenoneleft, top, right, bottom: leaving this box during the fight costs a stock
stocks0Lives per round; losing the last one is a KO
walls10 removes the screen-edge walls
floornonex1, x2: the floor exists only in this span; outside it is a pit
spawn_y-120Respawn height (respawn: full life, 90 ticks unhittable)
air_jumps, air_dash, fast_fallfrom rugen.tomlOverride the player’s [game] movement assists
ledge1With a floor: fighters catch its two ends and hang (climb, roll in, jump, let go); 0 turns the ledge grab off
items01 drops pickups (a throwable, a heal, a power boost) onto the floor span and the platforms
item_every10, 20Seconds between two drops: a random time between min and max
windnoneevery, length, strength: a gust every every seconds for length seconds, pushing fighters strength units per tick (half on the ground), right then left in turn, after a 3 s warning

The built-in Ink Arena and examples/arena/arena.def share one layout, a good starting point for a wide arena:

[Camera]
boundleft = -760          ; the camera pans over the whole island
boundright = 760
boundhigh = -360
zoomout = 0.25            ; far enough to show the island and the bottom blast line

[PlayerInfo]
p1startx = -160
p2startx = 160
leftbound = -2000
rightbound = 2000

[Arena]
blastzone = -920, -540, 920, 160
stocks = 3
walls = 0
floor = -640, 640         ; a 1280-unit deck, pits beyond both ends
spawn_y = -140
air_jumps = 1
air_dash = 1
ledge = 1                 ; catch the deck's edges
items = 1                 ; pickups every 10-20 s
wind = 40, 4, 0.4         ; a gust every 40 s

; nine platforms in three tiers: four at -80, three at -160, two at -240
[Platform]
x = -540, -400
y = -80
; ... see the files for the other eight

The blast zone sits 280 units past each end of the deck, so a fighter knocked off the island has room to recover with an air jump before the side line. Remember the player’s own [camera] zoom_out (default 0.6) also caps how far the view pulls back.

Built-in stages

rugen stage-gen writes three example stages to motif/stages/: training (a wide training room with zoom), ink_dojo and ink_arena (a 1280-unit island deck with nine platforms in three tiers and an [Arena] section). Open their .def files for a working reference of every extension.

Building a background, step by step

A short walk through how a background comes together; the full workflow with testing is in Your first stage.

  1. Plan the layers. Sort your art by distance: sky, far scenery, mid scenery, floor, foreground. Each becomes one or more elements.
  2. Size the art. At localcoord = 320, 240 the screen is 320 wide; with boundleft = -160 and boundright = 160 the camera can pan 160 either way, so a layer with delta = 1 needs about 640 px of width (or tile). A layer with delta = 0.5 needs only half the extra width.
  3. Set the floor line. zoffset is where the fighters stand. Draw the floor sprite so its walking line sits at that screen y, and give it delta = 1, 1.
  4. Add depth. Give farther layers smaller deltas. Keep the y delta at or below the x delta so vertical camera motion stays subtle.
  5. Foreground last. Elements with layerno = 1 draw over the players; keep them small and near the edges.
  6. Test with the camera at its limits: walk both fighters into each corner and jump. Missing art at an edge means a layer needs tile or a wider sprite.

Original reference: elecbyte.com/mugendocs-11b1.

Something wrong on this page? Edit it on GitHub.

SEARCH !!

    ↑↓ to move, Enter to open