Skip navigation.
Home

R's blog

CNS's Last Hurrah, Part 2 -- Named Variables

The next upcoming feature of CNS that we'll look at is named variables. A particularly tedious and error-prone characteristic of the current version of CNS is the fact that there is a fixed set of variables that can only be accessed by number. With named variables, you'll be able instead to declare your own variables and address them by name; e.g.,

$foo := 1

would set the variable named "foo" to 1.

One-dimensional arrays can also be declared. In fact, arrays are used to handle legacy accesses to Var, FVar, etc. For example, Var(12) + FVar(4) would be internally translated to $_var[12] + $_fvar[4].

Variables can be declared either as int or float, or as a flexible numeric type that takes on the type of whatever is assigned to it. Another new type of variable is the player variable. A redirection keyword, or a recursive series of redirection keywords, can be thought of as returning a pointer to some player or helper. In trigger redirection, triggers use this player pointer to determine whose values to return. Player variables will allow you to save player pointers, making it easy to refer back to the same player later on. Note, however, that player variables can go stale (e.g., due to a helper destroying itself), so you will need to check whether the player variable has become invalid before using it.

By default, variables are not visible via redirected access from unrelated players (where "unrelated" means they do not descend from the same root player). Public visibility must be explicitly enabled in the variable declaration. This allows you to expose only those variables that are necessary for signaling or communication according to a well-defined standard.

- R.

CNS's Last Hurrah, Part 1 - Recursive redirection

As previously outlined in the Roadmap for M.U.G.E.N, new CNS development will be discontinued in the eventual 2.x engine. But before then, we'll look at adding some features that help improve CNS usability for developers without being too much of a problem in terms of backward- or forward-compatibility. In the "CNS's Last Hurrah" blog post series (which may be sporadically updated), we'll take a look at CNS features that are in the planning or development stages for 1.1.

Today we'll be looking at recursive redirection. Triggers can currently be redirected once, as in

helper(<helperID-expression>), stateno

This would evaluate <helperID-expression>, find PLAYER's helper with that ID, and then get its stateno. Another example would be

enemynear(var(1)), stateno

which would get the stateno of PLAYER's var(1)'th nearest enemy. But there is currently no way in CNS to get PLAYER's helper's nearest enemy's stateno (or any other such trigger evaluation).

Recursive redirection solves the problem by allowing us to write expressions of the following form:

helper(<helperID-expression>), enemynear(var(1)), stateno

Recursive redirections can be nested to arbitrary depth (actually, a very large fixed number). The order of evaluation is left-to-right. Thus each redirection is relative to the player that was computed by the keyword binding to it on its immediate left.

Now, consider var(1) in the preceding expression. Whose var(1) is it -- PLAYER's or PLAYER's helper's? The answer is that since var(1) is not directly bound by a redirection keyword, it is evaluated in the original context, i.e., it is PLAYER's variable. To get the helper's var(1), you would have to redirect that access as well.

- R.

M.U.G.E.N 1.0 RC7 EX + alpha

This is an update of the *EXPERIMENTAL* BGM branch that began with RC3 EX + alpha.If you didn't know about the EX + alpha series, it is an alpha/testing/unstable branch of the RC series that is intended to overhaul BGM handling. It features more robust MP3 and Vorbis support, an extensible plugin architecture, and loop point specification for BGMs, as well as miscellaneous improvements to sound handling in general. You can see the original blog post for more details.

Since this is a testing release, your feedback on problems (or on lack of problems!) is appreciated. If all goes well, the EX + alpha code is planned to be folded into the stable release of M.U.G.E.N 1.0.

New in RC7 EX + alpha:

  • Ogg plugin (vorbisplug) supporting loop points and ReplayGain.
  • Engine now provides high-quality resampling services (for plugins that require it) using libresample.
  • Optional high-quality resampling for sound effects.
  • Support for WAV, MP3, and OGG removed from sdlmix plugin, since there are better alternatives.
  • Plugin API finalized.

Download here: M.U.G.E.N 1.0 RC7.01 EX + alpha (UPDATED)

Make sure to read README-ALPHA.html in the distribution archive for details and instructions. For those of you who are interested in creating plugins for your favorite file formats, an SDK will be released on this blog Sometime Soon (TM).

UPDATE NOTICE: The distribution archive has been updated to RC7.01a, which addresses wave loader incompatibilities that were reported in RC7a. If you previously downloaded RC7a, you can either redownload the full distribution using the above link, or just get the fixed executable here.

- R.

Modernized renderer

A test of the new rendering engine. (settings: kfm vs. kfm720, stage0-720, 1920x1080, windowed)


Software renderer


GL renderer

* Actual results may vary on your hardware.

- R.

Status update

The project has hit a snag and is on hold.

...Just kidding!

RC6 has been slow to develop because we've been doing some long-delayed but much-needed cleanup behind the scenes. It won't have very many user-visible effects besides fixing a few obscure bugs, but it should make future engine development easier and more robust. We have also put in some testing features that may eventually form the core of replay functionality in a future update.

- R.

RC5 EX + alpha

This is a minor update of the EX + alpha branch. It incorporates the bug fixes from RC5, and adds the following changes specific to the EX + alpha series:

  • BGM loop points can now be specified in storyboards.
  • loop = 0 mp3's now stop properly.

Download: M.U.G.E.N RC5 EX + alpha
Make sure to read README-ALPHA.html in the main directory for detailed changes and instructions.

RC4 EX + alpha

This is an update of the *EXPERIMENTAL* BGM branch that began with RC3 EX + alpha. The internal architecture has been revamped, so your feedback on problems (or on lack of problems!) will once again be appreciated. Mixer parameters are now adjustable in mugen.cfg, in case you have problems at the default settings.

If you didn't know about RC3 EX + alpha, it is an alpha/testing/unstable branch of the RC series that is intended to overhaul BGM handling. It features more robust mp3 support, a plugin architecture, and loop point specification for BGMs. You can see the original blog post for more details.

This release also contains a bugfix for the problems with the HitDefAttr and Teammode triggers that have been reported in RC4.

New in RC4 EX + alpha:

  • Sound effects can be muted when switching out of the M.U.G.E.N window.
  • BGM can be paused or muted when switching out of the M.U.G.E.N window.
  • Mixer parameters now configurable.
  • BGM buffering scheme reworked to address stuttering and dropouts.
  • Stage BGM is now guaranteed to start after the first tick, for compatibility with characters that assert NoMusic at the start of the round.
  • Upgraded to SDL_mixer 1.2.9. This fixes crashes with WAV music and enables seamless looping for non-MP3 filetypes.

New EX + alpha bug fixes:

  • Extension lists were cut off at the first semicolon. They are now comma-separated.
  • Storyboard BGMs didn't play, or hanged the application.
  • PlaySnd looping parameter didn't work.
  • System BGMs didn't always play when loop was 0.
  • mpg123 plugin sometimes left a gap with loopend = -1, even on gapless MP3s.

Download here: M.U.G.E.N RC4 EX + alpha
Make sure to read README-ALPHA.html in the distribution archive for details and instructions.

One word: beta!

Music plugins are back!

OK, you can stop cringing now. The incomplete Winamp plugin support in the 2002.04.14 M.U.G.E.N beta was justly infamous for its unreliability. Since the Winamp architecture wasn't designed with a game application in mind, plugins weren't expected to handle demands like rapid seeking or looping. In some cases, it was even difficult to get low-latency notification that a song had completed. The engine could only mash "buttons" like Stop, Rewind, and Play to try to coax the plugins to cooperate, but whether this actually worked depended on factors mostly out of our control.

Music services in the 1.0RC series are being provided by SDL_mixer. Although this is much more stable than the Winamp hack was, there are some features we wanted to have but which aren't provided by the default music players, as well as some bugs we didn't want to have which *are* provided. So we figured we should just do our own BGM system instead. We decided to go with an extensible plugin format. This should allow interested community members to improve M.U.G.E.N's handling of the multifarious game-related music filetypes.

Since this is a significant change to the BGM architecture, with significant potential for significant bugs, we wanted to put out an initial alpha build to get testing and feedback. This is a "testing/unstable/development" branch off the main 1.0RC series. If you'd like to help us out, please try it and let us know what you think!

Changes you'll see, in a nutshell (see README-ALPHA.TXT inside the distribution archive for details):

*) Better MP3 support using libmpg123
*) Extensible architecture (read: "plugins")
*) Loopstart and loopend support, for compatible plugins
*) More intuitive volume settings: Master, wave/sfx, BGM
*) Volume "offsets" replaced by volume scaling factors
*) Various BGM bugfixes
*) Probably some new bugs

Download: M.U.G.E.N RC3 EX + alpha
Please leave feedback in the forums, either by post or by private message. In particular, if you experience "hiccups" in mp3 playback, please let us know how when/how frequently they occur, and what your system specs are. Thanks!

Did you know?

M.U.G.E.N has had an undocumented -stresstest parameter since 2002. We use it to generate a lot of game activity to test stability. It also functions as a sort of Watch mode on steroids.

If you'd like to give it a try, run M.U.G.E.N with the command line

mugen -stresstest <frameskip>

where <frameskip> is either -1, or a positive integer. -1 disables frameskipping, while a positive value causes that many frames to be skipped when drawing. This speeds up the action.

Once you're in the menu, pick a game mode (such as Team Vs.) and enjoy the chaos.

- R.

X
Loading