I made two little tools:
- the first tool, Zoomer, tries to automatically convert a 4:3 stage to a widescreen (e.g. 16:9) stage, by adding zoom to a stage (or alternatively it can generally add zoom support to a stage); other parameters (such as deltas) are also automatically adjusted to avoid artifacts,
- the second tool, Scaler, allows to resize the whole stage by using the xscale and yscale parameters; the horizontal deltas, vertical offsets of backgrounds and the left, right and upper camera bounds are also adjusted accordingly.
These tools are Python scripts, so you need to have Python installed to use it. It also most probably requires at least Python 3.10 (as this is what I have installed).
If you are on Windows, look at this: https://www.wikihow.com/Use-Windows-Command-Prompt-to-Run-a-Python-File. A crutial part from the article above is: Part 2 Point 5. At this point you can provide additional command line arguments (like the path to the DEF file).
The script is currently only hosted on ideone.com:
You can just download them and save e.g. as files named stage-zoomer.py and stage-scaler.py. I have not put it on Github, because I am not sure that I currently have the time and motivation to deal with MRs and what not. Anyways, enjoy if you find it useful.
A detailed Zoomer description/usage:
Spoiler, click to toggle visibilty
usage: stage-zoomer [-h] [-r RATIO] [-z ZOOM] [-n ZOOM_IN] [-t ZOOM_OUT] [-m CB_MODE] [-p] [-d] [-o OUT_PATH] [--no-backup] [--version] DEF_FILE [DEF_FILE ...]
A stage DEF file converter for M.U.G.E.N/Ikemen that allows e.g. to adjust a zoom-less 4:3 stage
to support a widescreen aspect ratio, by adjusting zoom, horizontal deltas and other parameters.
Alternatively, this tool can also adjust a zoom-less stage to support a target zoom level.
When using this tool to enable widescreen support, then the resulting stage is meant to
be displayed with the `StageFit` parameter (from the `mugen.cfg` config file) set to `0`.
This converter works by setting the `zoomin` and `zoomout` values and then calculating and adjusting
the `boundleft` and `boundright` parameters, as well as the horizontal `delta` values of backgrounds,
including the old-style `parallax` type backgrounds using the `xscale` parameter.
The players' starting position values of `p1startx` and `p2startx` are also adjusted appropriately.
The camera's vertical bounding parameters are also tweaked, depending on the target engine.
Unfortunately, this part is mostly guesswork, so manual follow-up adjustments will be necessary,
however it should still be much easier than editing the whole stage completely by hand. To adjust
the vertical camera bounds after conversion, use e.g. `boundhigh`, `cutlow` and similar parameters.
It should also be mentioned, that Mugen's and Ikemen's vertical camera bounding algorithms work
very differently, especially in the case of a wide zoom range.
The parallax floors using the `xscale` parameter should also receive automatic delta adjustments,
however these may need to be tweaked after conversion.
Stages already having zoom are not supported. Highres stages using `highres` are also
not supported. Highres stages using `localcoord` and/or `(x/y)scale` should theoretically
be supported, however this has not been extensively tested.
positional arguments:
DEF_FILE the stage DEF file (multiple files can be given)
the files will be modified in place!
options:
-h, --help show this help message and exit
-r RATIO, --target-aspect-ratio RATIO
adjust the stage to support the given widescreen aspect ratio (e.g. 16x9)
mutually exclusive with the `--target-zoom` option: use only one or the other
-z ZOOM, --target-zoom ZOOM
adjust the stage to support at least the given zoom value (e.g. 0.75)
warning: setting this value too low may introduce artifacts
mutually exclusive with the `--target-aspect-ratio` option: use only one or the other
-n ZOOM_IN, --set-zoom-in ZOOM_IN
set/override the `zoomin` camera parameter to the given value
(default: calculated from the target aspect ratio or the same as target zoom)
-t ZOOM_OUT, --set-zoom-out ZOOM_OUT
set/override the `zoomout` camera parameter to the given value
warning: setting this value lower than the target zoom *will* introduce artifacts
(default: calculated from the target aspect ratio or the same as target zoom)
-m CB_MODE, --bounds-mode CB_MODE
choose camera's bounding mode (values: mugen | ikemen | none, default: mugen)
* the `mugen` mode enables hacks for MUGEN's quirks, to possibly avoid artifacts
* the `ikemen` mode disables stage height cutting
* the `none` mode leaves the camera's vertical bounding parameters unchanged
-p, --no-parallax do not modify the parallax backgrounds (default: modify parallax backgrounds)
-d, --debug-bg set the `debugbg` property to `1` in the modified stage DEF file (default: do not set)
-o OUT_PATH, --output-path OUT_PATH
write the modified stage DEF file or files to the given output file or
directory respectively, instead of modifying the given DEF files in-place
--no-backup do not create a backup for the modified stage DEF files
all of the file will be irreversibly modified in place!
--version show program's version number and exit
examples:
stage-zoomer DEF_FILE
modify the given zoom-less stage DEF file to support a 16:9 aspect ratio
(this is the default behavior when no additional options are given)
stage-zoomer -z 0.85 DEF_FILE
modify the given zoom-less stage DEF file to support a zoom of 0.85
the stage will be set to always display in this exact zoom
stage-zoomer -z 0.8 -n 1.0 DEF_FILE
modify the given zoom-less stage DEF file to support a zoom-out of 0.8
set the zoom-in value to 1.0, making the effective zoom range [0.8, 1.0]
stage-zoomer -r 64x27 DEF_FILE
modify the given zoom-less stage DEF file to support the ultra-wide 64:27 aspect ratio
(this implies a large zoom-out value, therefore some artifacts may not be avoided)
Copyright (c) 2021-2024 Pixel Grass, License: MIT
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND. **
A detailed Scaler description/usage:
Spoiler, click to toggle visibilty
usage: stage-scaler [-h] [-s SCALE] [-x XSCALE] [-y YSCALE] [-p] [-d] [-o OUT_PATH] [--no-backup] [--version] DEF_FILE [DEF_FILE ...]
A stage DEF file converter for M.U.G.E.N/Ikemen that allows to resize the whole stage by using
the `xscale` and `yscale` parameters. The horizontal deltas, vertical offsets of backgrounds
and the left, right and upper camera bounds are also adjusted accordingly.
The vertical camera bounds may still need manual adjustments after conversion.
Stages that already have the `xscale` or `yscale` parameters set to values other than 1.0
are not supported. Highres stages using the `highres` parameter are also not supported.
positional arguments:
DEF_FILE the stage DEF file (multiple files can be given)
the files will be modified in-place!
options:
-h, --help show this help message and exit
-s SCALE, --scale SCALE
use the `xscale` and `yscale` stage parameters to resize the stage by the given factor
adjust the horizontal deltas, vertical offsets of backgrounds and the camera bounds
-x XSCALE, --xscale XSCALE
use the `xscale` stage parameter to resize the stage horizontally by the given factor
adjust the horizontal deltas of backgrounds and the left and right camera bounds
-y YSCALE, --yscale YSCALE
use the `yscale` stage parameter to resize the stage vertically by the given factor
adjust the vertical offsets of backgrounds and the upper camera bound
-p, --no-parallax do not modify the parallax backgrounds (default: modify parallax backgrounds)
-d, --debug-bg set the `debugbg` property to `1` in the modified stage DEF file (default: do not set)
-o OUT_PATH, --output-path OUT_PATH
write the modified stage DEF file or files to the given output file or
directory respectively, instead of modifying the given DEF files in-place
--no-backup do not create a backup for the modified stage DEF files
all of the file will be irreversibly modified in place!
--version show program's version number and exit
examples:
stage-scaler -s 1.5 DEF_FILE
modify the given stage DEF file to resize the stage to 150%
stage-scaler -y 1.25 DEF_FILE
modify the given stage DEF file to resize the stage vertically to 125%
the horizontal dimensions of the stage will remain unchanged
Copyright (c) 2024 Pixel Grass, License: MIT
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND. **
Updated: 2024-01-31
Changelog 1.0.0 (Scaler):
- Initial version.
Changelog 1.1.0 (Zoomer):
- Added support for the conversion of old-style parallax background layers that use the xscale parameter.
- Removed the legacy Ikemen bounds mode, as well as the separate horizontal/vertical bound modes (the -x, -y options).
- More tweaks in vertical bounds calculation formulas.
- Added the -o / --output-path option that can be used to avoid modifying the stage files in-place.
- Some minor bufixes.
- Some tweaks in the errors handling.
- Some tweaks in the documentation.
Changelog 1.0.2 (Zoomer):
- Updated formulas for the newest Ikemen GO version.
- Added optional `debugbg` setting for follow-up manual edits.
- Excluded parallax backgrounds from delta adjustments.
- Other minor tweaks and fixes.