Creating content
The creator reference for rugen - what a character, stage and screenpack are made of, where the files go, the coordinate systems, and what rugen does differently from M.U.G.E.N.
This section is a complete reference for making characters, stages and screenpacks that run in rugen. It covers the same ground as the original M.U.G.E.N 1.1 documentation, rewritten for rugen, and every reference table says what rugen actually supports today, checked against the engine source.
The section at a glance
| Page | What it covers |
|---|---|
| Characters | The character .def file, file references, palettes and .act files |
| CNS: constants, states, expressions | The .cns format: constants, [Statedef], controllers, triggers, the expression language, common1 |
| State controllers | Every controller, its parameters and an example, with rugen status |
| Triggers | Every trigger, its arguments and return type, with rugen status |
| Commands (.cmd) | Input commands, buffering, [Defaults], the AI |
| Animations (.air) | Actions, elements, collision boxes, loops, flips, blending |
| Sprites and sounds | SFF v1 / v2, palettes, SND, music, and the tools |
| Stages | Stage .def sections, backgrounds, rugen’s platforms and arenas |
| Screenpacks and lifebars | system.def, fight.def, fonts, and rugen’s TOML themes |
| Your first character / stage | Step-by-step tutorials |
| Online-fair characters | What makes a character BLOCKED or UNBALANCED online |
| Debugging | Overlays, rugen check, rugen verify, common errors |
Content types
| Type | Lives in | Main file | Made of |
|---|---|---|---|
| Character | chars/ | <name>.def | .cns / .st states, .cmd commands, .air animations, .sff sprites, .snd sounds, .act palettes |
| Stage | stages/ | <name>.def | one .def with background sections, one .sff, optional music |
| Screenpack / theme | motif/themes/<name>/ (or data/) | system.def + fight.def | .sff art, .snd, fonts (.fnt or font .def + .sff), TOML screens and WebP art |
| Common files | data/ | common1.cns | shared states (walking, jumping, getting hit), fightfx.sff/.air, common.snd |
All text files are INI-like: [Section] headers, key = value lines and
; comments. Section and key names are case-insensitive; file names are
matched case-insensitively on every OS, and backslashes in paths work.
Folder layout
rugen/
├── chars/ one .rgc per character; also .zip, .rar or folders to import
│ └── originals/ imported archives, kept after conversion
├── stages/ one .rgs per stage (same rules)
├── data/ common1.cns, fightfx, common sounds, classic screenpack
├── motif/
│ ├── themes/ink/ Shonen Ink theme: system.def, fight.def, ui/*.toml
│ ├── themes/dojo/ Dojo theme
│ └── stages/ built-in stages (training, ink_dojo, ink_arena, night_festival)
├── cache/ derived data: manifests, folder conversions (safe to delete)
└── rugen.toml player settings
- Archives work as they are. Drop a
.zipor.rarintochars/; rugen converts it intochars/<id>.rgcon launch and moves the archive tochars/originals/. A folder stays where it is and is converted intocache/rgc/..7zis not scanned; repack as zip. - The id is the file name.
chars/MyHero.zipisMyHero; that is what you type inrugen play MyHero. - Finding the
.def. rugen searches the extracted folder for<id>.def, else the first.defwith a[Files] sprite =line (characters) or a[StageInfo]/[BGdef]section (stages). Name your main.defafter the folder and you never have to think about it. - Built-in stages in
motif/stages/sit next to yours; a stage instages/with the same id wins.
See Characters & stages for the player’s view.
Coordinate spaces and localcoord
Every piece of content declares the screen size it was drawn for with
localcoord = width, height:
| Where | Key | Default |
|---|---|---|
Character .def | [Info] localcoord | 320, 240 |
Stage .def | [StageInfo] localcoord | 320, 240 |
system.def / fight.def | [Info] localcoord | 320, 240 |
All positions, velocities and sizes inside that content are in its own
units. rugen scales each piece to the real window independently, so a
320, 240 character fights fine on a 1280, 720 stage.
- x grows to the right, y grows down. In a fight,
y = 0is the floor and negative y is up in the air. - Character positions (
Pos X) are measured from the centre of the screen;ScreenPosfrom the top-left corner. - In states, x is relative to facing:
VelSet x = 3moves forward whichever way the player faces. - Use
Const240p(),Const480p()andConst720p()to write a value for one resolution and have it converted to the character’s localcoord.
How rugen differs from M.U.G.E.N
rugen keeps the file formats and the behaviour, and adds a few things around them that matter to creators:
- Content files. Content is converted into one
.rgc/.rgsfile per character or stage (see Content files). A folder is converted again whenever its files change, even mid-fight;rugen exportgives you a MUGEN folder back from any content file. - Verification. Every character is loaded, inspected and run through two
3000-frame headless matches the first time it is used. A
brokenresult hides it from the select screen. Run the same check yourself withrugen verify(see Debugging). - Online fairness. Online, opponents bring their own characters. A static analysis of your CNS decides whether a pairing is FAIR, UNBALANCED or BLOCKED. Know the rules before publishing: Online-fair characters.
- Determinism. The simulation is bit-exact for rollback netcode.
Characters cannot read the clock or real randomness;
Randomis seeded per match. - Safety limits. Per tick, at most 56 helpers, 512 explods, 128
projectiles and 32 new sounds. A state loop that changes state 2500 times
in one tick is cut off. Characters that hit these limits get a
warnverdict instead of freezing the game. - Extensions. A few optional extras: stage
[Platform]and[Arena]sections, theGroundYandOnPlatformtriggers, and extrafight.defkeys. All are ignored by legacy content.
Something wrong on this page? Edit it on GitHub.