RUGENDOCS
Creating content

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

PageWhat it covers
CharactersThe character .def file, file references, palettes and .act files
CNS: constants, states, expressionsThe .cns format: constants, [Statedef], controllers, triggers, the expression language, common1
State controllersEvery controller, its parameters and an example, with rugen status
TriggersEvery 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 soundsSFF v1 / v2, palettes, SND, music, and the tools
StagesStage .def sections, backgrounds, rugen’s platforms and arenas
Screenpacks and lifebarssystem.def, fight.def, fonts, and rugen’s TOML themes
Your first character / stageStep-by-step tutorials
Online-fair charactersWhat makes a character BLOCKED or UNBALANCED online
DebuggingOverlays, rugen check, rugen verify, common errors

Content types

TypeLives inMain fileMade of
Characterchars/<name>.def.cns / .st states, .cmd commands, .air animations, .sff sprites, .snd sounds, .act palettes
Stagestages/<name>.defone .def with background sections, one .sff, optional music
Screenpack / thememotif/themes/<name>/ (or data/)system.def + fight.def.sff art, .snd, fonts (.fnt or font .def + .sff), TOML screens and WebP art
Common filesdata/common1.cnsshared 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 .zip or .rar into chars/; rugen converts it into chars/<id>.rgc on launch and moves the archive to chars/originals/. A folder stays where it is and is converted into cache/rgc/. .7z is not scanned; repack as zip.
  • The id is the file name. chars/MyHero.zip is MyHero; that is what you type in rugen play MyHero.
  • Finding the .def. rugen searches the extracted folder for <id>.def, else the first .def with a [Files] sprite = line (characters) or a [StageInfo] / [BGdef] section (stages). Name your main .def after the folder and you never have to think about it.
  • Built-in stages in motif/stages/ sit next to yours; a stage in stages/ 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:

WhereKeyDefault
Character .def[Info] localcoord320, 240
Stage .def[StageInfo] localcoord320, 240
system.def / fight.def[Info] localcoord320, 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 = 0 is the floor and negative y is up in the air.
  • Character positions (Pos X) are measured from the centre of the screen; ScreenPos from the top-left corner.
  • In states, x is relative to facing: VelSet x = 3 moves forward whichever way the player faces.
  • Use Const240p(), Const480p() and Const720p() 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 / .rgs file per character or stage (see Content files). A folder is converted again whenever its files change, even mid-fight; rugen export gives 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 broken result hides it from the select screen. Run the same check yourself with rugen 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; Random is 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 warn verdict instead of freezing the game.
  • Extensions. A few optional extras: stage [Platform] and [Arena] sections, the GroundY and OnPlatform triggers, and extra fight.def keys. All are ignored by legacy content.

Something wrong on this page? Edit it on GitHub.

SEARCH !!

    ↑↓ to move, Enter to open