warmCabin / mm2_flicker_ender

Simulates a few of Rockman 2's key drawing routines in Lua to eliminate sprite flicker
0 stars 0 forks source link

Overview

mm2_flicker_ender reimplements a few of Rockman 2's drawing routines in Lua to overcome the 64-sprite limitation. The goal of this script is to draw the exact tiles the game would have drawn if OAM was infinite.

Only compatible with Rockman 2 for now. Not Mega Man 2, not Super Mario Bros. 2, not Rockman 3. Just Rockman 2. Mega Man 2 support should eventually be possible. The tiledraw script is more general purpose, and could be reused in a project like this for a different game.

Video explanation

Arguments

There are a few arguments you can specify in the script window to tweak the drawing order to your liking. By default, this script imitates the alternating drawing order of the game, equivalent to the arguments: --order canonical --shuffle alternating

Usage: flicker_ender.lua [-h] [--order {canonical,recommended}]
       [--shuffle {alternating,cyclic,none}]
       [--oam-limit <num sprites>] [--disable-i-frame-flicker]
       [--debug] [--verbose]

Options:
   -h, --help            Show this help message and exit.
   --order {canonical,recommended},
        -o {canonical,recommended}
                         Sprite drawing order. canonical = what the game does. recommended = tweaks to fix certain overlapping issues. If unspecified, will be chosen based on shuffle.
   --shuffle {alternating,cyclic,none},
          -s {alternating,cyclic,none}
                         What type of sprite shuffling to use. The real game code uses alternating. (default: alternating)
   --oam-limit <num sprites>,
            -l <num sprites>
                         Limit for the imitation OAM. Will be infinite if unspecified (recommended). 64 is the NES default. Use this if you want to make flicker worse!
   --disable-i-frame-flicker, -i
                         Whether Mega Man and bosses should flicker during i-frames
   --debug, -d           Enable debug mode. Offset rendering and draw some info to the screen
   --verbose, -v         Enable verbose printing, up to 3 levels. WARNING: very slow!

Orderings

Really only noticeable if shuffle = none.

Shuffle

OAM Limit

Sets a limit for how many sprites can be drawn each frame. While this may seem antithetical to the purpose of this script, here are the uses cases that motivated its inclusion:

Disable i-frame flicker

An enhancement mainly for TASing. It turns off the 2-frame flicker and crash stars that occur during invincibility frames for Mega Man and bosses so you can better see what you're doing.