Tutorial: your first stage
Draw three layers, pack them into an SFF, write the stage .def, test it with rugen play and --shot, then add a platform and arena rules.
This tutorial builds a small three-layer stage, “Rooftop”, tests it in rugen, then adds rugen’s platform extension. The reference for every key is Stages.
1. Draw the layers
Work at the stage’s localcoord. For a classic 320, 240 stage:
| Layer | Size | Sprite | Notes |
|---|---|---|---|
| Sky | 320 x 240 | 0,0 | Will not scroll (delta = 0) |
| City skyline | 480 x 120 | 1,0 | Far away (delta = 0.4) |
| Roof floor | 640 x 80 | 2,0 | Where the fighters stand (delta = 1) |
Save each as an indexed PNG (256 colours or fewer) with colour 0 as the
transparent background. Put the sprite axis at the top centre of each
image: rugen places a sprite so its axis lands on the element’s start.
2. Pack the SFF
Open Fighter Factory, create a new SFF v2, add the three PNGs as
sprites 0,0, 1,0 and 2,0, set each axis to the top centre, and save as
stages/Rooftop/Rooftop.sff. (Elecbyte’s sprmake2 does the same from the
command line.)
Check the result:
rugen view stages/Rooftop/Rooftop.sff
3. Write the .def
stages/Rooftop/Rooftop.def:
[Info]
name = "Rooftop"
displayname = "Rooftop"
author = "You"
[Camera]
startx = 0
boundleft = -160
boundright = 160
boundhigh = -30
boundlow = 0
tension = 50
verticalfollow = 0.2
zoomout = 1 ; keep the art pixel-exact: no zoom
[PlayerInfo]
p1startx = -70
p2startx = 70
leftbound = -1000
rightbound = 1000
[Bound]
screenleft = 15
screenright = 15
[StageInfo]
zoffset = 200
localcoord = 320, 240
[BGdef]
spr = Rooftop.sff
[BG Sky]
type = normal
spriteno = 0, 0
start = 0, 0
delta = 0, 0
[BG Skyline]
type = normal
spriteno = 1, 0
start = 0, 70
delta = 0.4, 0.2
[BG Roof]
type = normal
spriteno = 2, 0
start = 0, 190
delta = 1, 1
zoffset = 200 puts the fighters’ feet 200 px down the screen; the roof
sprite starts at y 190, so its top 10 px are the visible edge of the roof.
4. Test it
rugen list # Rooftop should appear under stages
rugen play kfm kfm --stage Rooftop
Walk both fighters into each corner and jump. A gap at an edge means a layer
is too narrow or needs tile = 1, 0. Stages are not hot-reloaded: quit and
run again after each edit.
Capture the result without playing:
rugen play kfm kfm --stage Rooftop --frames 200 --shot rooftop.png
5. Add life
Make the skyline drift and add an animated sign in front of it. Append to
the .def (sprites 3,0 to 3,2 are three frames of a blinking sign):
[BG Clouds]
type = normal
spriteno = 4, 0
start = 0, 30
delta = 0.2, 0.1
tile = 1, 0
velocity = -0.2, 0
[BG Sign]
type = anim
actionno = 10
start = 90, 110
delta = 0.7, 0.5
[Begin Action 10]
3,0, 0,0, 20
3,1, 0,0, 4
3,2, 0,0, 20
Remember that elements draw in file order: place [BG Clouds] right after
[BG Sky] if the clouds should be behind the skyline.
6. Add a platform (rugen extension)
Give the roof a raised water tank fighters can jump onto:
[Platform]
x = 60, 140 ; stage x from 60 to 140
y = -60 ; 60 px above the floor
Draw the tank so its top edge is 60 px above the floor line, as a
delta = 1, 1 element. M.U.G.E.N and Ikemen ignore [Platform], so the
stage still works there, just without the raised surface.
7. Make it an arena (optional)
Add stocks and blast zones and the stage appears in rugen’s ARENA mode:
[Arena]
blastzone = -400, -320, 400, 140
stocks = 3
walls = 0
floor = -200, 200
With walls = 0 and a floor span, fighters can be knocked off the sides
of the roof and lose a stock.
These numbers suit a small rooftop. For a full platform-fighter stage, copy
the layout of the built-in Ink Arena or examples/arena/arena.def in the
engine repository: a floor of 1280 units (floor = -640, 640), nine
platforms in three tiers, camera bounds of ±760 (boundleft = -760,
boundright = 760), zoomout = 0.25, spawns at ±160 (p1startx = -160,
p2startx = 160) and a blast zone at ±920 (blastzone = -920, -540, 920, 160). The full listing is in Stages: [Arena].
8. Ship it
Zip the folder (Rooftop/Rooftop.def, Rooftop.sff, music) and share it.
Players drop the zip into stages/. Add [Music] bgmusic = rooftop.ogg to
give it a track.
Something wrong on this page? Edit it on GitHub.