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]
| Key | Default | Meaning |
|---|---|---|
name | “Training Room” | Stage name; the StageVar(info.name) trigger compares against it |
displayname | name | Name 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).
| Key | Default | Meaning |
|---|---|---|
startx | 0 | Camera x at round start |
boundleft, boundright | -150, 150 | How far the camera may pan left and right |
boundhigh, boundlow | -25, 0 | How far it may move up (negative) and down |
tension | 50 | Distance from the screen edge at which a player starts pushing the camera |
verticalfollow | 0.2 | How much the camera follows a jumping player (0 to 1) |
floortension | 0 | Height a player must reach before the camera follows up |
zoomout | 1 | Smallest zoom (most zoomed out), 0.1 to 1 |
zoomin | 1 | Largest zoom |
Not read: starty, tensionhigh, tensionlow, overdrawhigh,
overdrawlow, cuthigh, cutlow.
[PlayerInfo]
| Key | Default | Meaning |
|---|---|---|
p1startx, p2startx | -70, 70 | Start x of player 1 and 2 |
leftbound, rightbound | -1000, 1000 | How far players may walk in stage space |
Not read: p1starty, p2starty, p1facing, p2facing, the p3 / p4 keys.
[Bound]
| Key | Default | Meaning |
|---|---|---|
screenleft, screenright | 15, 15 | How close a player may get to the screen edges |
[StageInfo]
| Key | Default | Meaning |
|---|---|---|
zoffset | 210 | Screen y of the floor (y = 0) when the camera is at rest |
localcoord | 320, 240 | Coordinate 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]
| Key | Meaning |
|---|---|
bgmusic | Music 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]
| Key | Meaning |
|---|---|
spr | The stage’s .sff (required) |
bgclearcolor | r, 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.
| Key | Default | Meaning |
|---|---|---|
type | normal | normal, anim, parallax or dummy |
spriteno | 0, 0 | Sprite for normal and parallax |
actionno | none | Animation for type = anim, from a [Begin Action n] block inside the stage .def |
layerno | 0 | 0 behind the players, 1 in front |
start | 0, 0 | Position: x from the stage centre, y from the top of the screen |
delta | 1, 1 | Scroll speed relative to the camera (see below) |
tile | 0, 0 | 1 repeats forever on that axis; n > 1 draws n copies |
tilespacing | 0, 0 | Gap between tiles |
velocity | 0, 0 | Constant movement in pixels per tick (clouds) |
sin.x, sin.y | none | amplitude, period, phase: swaying motion |
trans | none | add, add1, addalpha, sub |
alpha | 255, 0 | Source and destination weights for addalpha |
window | none | x1, y1, x2, y2: only draw inside this screen rectangle |
scalestart | 1, 1 | Draw scale (Ikemen key; handy for 2x art) |
xscale | 1, 1 | parallax only: horizontal scale at the top and bottom |
width | none | parallax 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.
| Key | Default | Meaning |
|---|---|---|
blastzone | none | left, top, right, bottom: leaving this box during the fight costs a stock |
stocks | 0 | Lives per round; losing the last one is a KO |
walls | 1 | 0 removes the screen-edge walls |
floor | none | x1, x2: the floor exists only in this span; outside it is a pit |
spawn_y | -120 | Respawn height (respawn: full life, 90 ticks unhittable) |
air_jumps, air_dash, fast_fall | from rugen.toml | Override the player’s [game] movement assists |
ledge | 1 | With a floor: fighters catch its two ends and hang (climb, roll in, jump, let go); 0 turns the ledge grab off |
items | 0 | 1 drops pickups (a throwable, a heal, a power boost) onto the floor span and the platforms |
item_every | 10, 20 | Seconds between two drops: a random time between min and max |
wind | none | every, 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.
- Plan the layers. Sort your art by distance: sky, far scenery, mid scenery, floor, foreground. Each becomes one or more elements.
- Size the art. At
localcoord = 320, 240the screen is 320 wide; withboundleft = -160andboundright = 160the camera can pan 160 either way, so a layer withdelta = 1needs about 640 px of width (ortile). A layer withdelta = 0.5needs only half the extra width. - Set the floor line.
zoffsetis where the fighters stand. Draw the floor sprite so its walking line sits at that screen y, and give itdelta = 1, 1. - Add depth. Give farther layers smaller deltas. Keep the y delta at or below the x delta so vertical camera motion stays subtle.
- Foreground last. Elements with
layerno = 1draw over the players; keep them small and near the edges. - Test with the camera at its limits: walk both fighters into each
corner and jump. Missing art at an edge means a layer needs
tileor a wider sprite.
Original reference: elecbyte.com/mugendocs-11b1.
Something wrong on this page? Edit it on GitHub.