Background features - ikemen-engine/Ikemen-GO GitHub Wiki

Changes to Background Parameters

Some background parameters are carried over from MUGEN, but with their functionality altered.

[BG] (shared parameters)

zoomdelta

zoomdelta = dzoom_x, dzoom_y (float, float)
Specifies the amount that the camera zoom affects the scale of the element. Defaults to 1,1.

The second item of zoomdelta is not read in MUGEN 1.1, but here it is processed as Y direction zoomdelta. If omitted, the same value as the first item is entered and the same processing as MUGEN 1.1 is performed.

layerno (nightly build only)

layerno = layer_number (int)
Specifies the stage layer on which the element will be drawn

In addition to 0 and 1, this parameter now also accepts -1.
Elements in layer -1 will be drawn behind layer 0. While this does not alter stage functionality itself, it can allow characters to be drawn between the elements in those two layers.

Note: For the sake of backwards compatibility, currently this feature only works in stages with ikemenversion.

[BGCtrl] (controllers)

SinX and SinY

MUGEN 1.1 has a bug where SinX and SinY of a BGCtrl ignore the parent BGCtrlDef looptime. Therefore, in Ikemen GO, the movement of SinX and SinY of a stage created with MUGEN 1.1 in mind may look strange.
This can be solved by matching the looptime of BGCtrlDef and the period (2nd value) of SinX and SinY.

New Background Parameters

Below are new parameters exclusive to Ikemen GO.

[BGDef] (definition)

RoundPos

RoundPos = round_flag (bool)
Set to 1 to round the position of background elements to floor, emulating older MUGEN behavior.

Defaults to 1 if mugenversion is below 1.0 and ikemenversion is 0 (older stages). Otherwise defaults to 1.
This parameter can also be used in an individual background element ([BG] block).

Model (nightly build only)

Model = model_file (string)
Filename of a 3D model file. Supported: gltf, glb.

It is recommended to use PNG/JPEG/embedded image formats for textures. Compressed DDS textures are not supported.
Make sure the world origin of the model is at the camera starting point.

[BG] (type = video) (nightly build only)

Ikemen GO adds a video background type that plays media as a BG element. It uses the usual [BG ...] block and participates in draw order like other BG types.

Media support

  • Containers: WebM (.webm), Matroska (.mkv)
  • Video codecs: VP8, VP9
  • Audio codecs: Opus, Vorbis

Audio plays if present in the media.

Coordinate system & base pivot

  • Stages: base pivot is the center of the screen.
  • Motifs & storyboards: base pivot is the top-left of the screen.

Parameters (video-specific)

type = video (string, required)
Must be set to video.

path = filepath (string, required)
Path to the media file. By default resolves relative to the engine’s video directory (absolute paths also supported).

volume = volume (int, optional)
Audio playback volume. Defaults to 100.

loop = loop_flag (boolean int, optional)
Set to 1 to loop the video. Defaults to 0.

scalemode = mode (string, optional)
How the video frame is sized into the window. Defaults to none.
none (no scaling) · fit (uniform fit, letter/pillar-box if needed) · fitwidth (match width; crop/pad height) · fitheight (match height; crop/pad width) · zoomfill (uniform cover; center-crop overflow) · stretch (non-uniform fill; may distort).

scalefilter = filter (string, optional)
Scaling filter. Defaults to fastbilinear. Options: lanczos, fastbilinear, bilinear, bicubic, experimental, neighbor, area, bicublin, gauss, sinc, spline.

Note: Element-level transforms like scalestart/scaledelta and camera zoom (zoomdelta, zoomscaledelta) are applied in addition to the size implied by scalemode.

Standard background parameters

The following work with video the same as for normal/anim elements unless noted:
layerno, start, delta, positionlink, id, velocity, sin.x, sin.y, scalestart, scaledelta, zoomdelta, zoomscaledelta, maskwindow, window, windowdelta, roundpos, angle, xangle, yangle, projection, focallength, xshear.

Untested

trans, alpha, palfx.

[BG] (shared parameters)

Angle (nightly build only)

Angle = angle (int)
Specifies the rotation angle of the BG element. Defaults to 0.

XAngle (nightly build only)

XAngle = xangle (int)
Specifies the X-axis rotation of the BG element. Defaults to 0.

YAngle (nightly build only)

YAngle = yangle (int)
Specifies the Y-axis rotation of the BG element. Defaults to 0.

AutoResizeParallax

AutoResizeParallax = resize_flag (boolean)
Set to 1 to auto-correct parallax size when zooming out. Defaults to 0.

Specifies whether to automatically adjust the size of parallax elements when zooming out. By setting this to 0 and specifying ZoomDelta, you can reproduce the same behavior as when parallax zooms out in MUGEN 1.1.

XBottomZoomDelta

XBottomZoomDelta = xzoom (float)
Specifies the X scale reduction rate of the bottom edge of the image when zooming out. Omitted by default.

Countermeasure for stages using parallax where the X scale on the bottom surface becomes abnormally small / freezes at severe zoom-out (by design). Works only if AutoResizeParallax is set to 1.

projection (nightly build only)

Projection = projection (string)
perspective: distortion relative to the center of the screen
perspective2: distortion relative to the sprite
orthographic: no distortion
Defaults to orthographic.

FocalLength (nightly build only)

FocalLength = focallength (float)
Focal length for perspective projections. Has no effect unless projection is perspective or perspective2.

XShear (nightly build only)

XShear = xshear (float)
Specifies horizontal shearing to apply to the BG element. Defaults to 0.

ZoomScaleDelta

ZoomScaleDelta = zscale_dx, zscale_dy (float, float)
Reverse-correction of ZoomDelta. Defaults to 0,0.

Applies an inverse correction to ZoomDelta, mainly to correct image ratio distortion when zooming out. Reads two values for X and Y; you may apply the correction to just one axis by omitting the other.

[BGCtrl] (controllers)

PalFX

Works like character PalFX, but for background elements. The effect is applied permanently (due to how BGCtrls work). To reset it, declare PalFX again with empty parameters (all are optional). Using BGPalFX in a character will temporarily override all PalFX BGCtrl.

Example syntax:

; Example only — actual parameters mirror char PalFX
[BGCtrl pal_example]
type = PalFX
time = 0, 60
; add = r,g,b
; mul = r,g,b
; sinadd = r,g,b, period, offset

RemapPal

Remaps a palette from the stage SFF file to another palette from the same file. This can be used to perform static palette changes without duplicating sprites, and to remap palettes dynamically using ModifyBGCtrl.

Example syntax:

[BGCtrl 1]
type = RemapPal
time = 200
source = 0,0
dest = 2,5

SctrlId

sctrlid = ID (int)
Specifies an ID number to refer to this background controller block by.

Used so a character’s ModifyBGCtrl can target specific stage background controllers. Different controllers may share the same ID if necessary.