hi
Most of you are probably familiar with the Retry Patch by worldpeace, you know, the one used in every Kaizo hack to not make you waste years of your life waiting to restart a level? Well, a few months ago I had a thought: how hard would it be to remake it, but using UberASM instead? As it turns out, fairly hard but possible.
So, my design goals with this project were the following:
The result is this:
[DOWNLOAD]
(you can also check the GitHub repository here)
A summary of the features included from the original/modified Retry patch:
New features:
Some bugs from the original Retry that have been fixed:
Other QOL additions:
At first setting it up might seem hard, mostly because there's a lot of files to insert with UberASM. The "how_to_insert" file guides you through it, and after the initial setup, using it is as simple as just editing the settings you want and running UberASM Tool (note that the hijacks are applied automatically when running the tool). If you need to remove it from your ROM, simply delete the files from the UberASM folder and list.txt, run the tool, then patch the included "retry_unpatch" file with Asar.
Most of you are probably familiar with the Retry Patch by worldpeace, you know, the one used in every Kaizo hack to not make you waste years of your life waiting to restart a level? Well, a few months ago I had a thought: how hard would it be to remake it, but using UberASM instead? As it turns out, fairly hard but possible.
So, my design goals with this project were the following:
- Use as few hijacks as possible: these are usually what makes a patch incompatible with other resources, which is fairly common in case of Retry.
- Include all the features from all Retry versions (official, KLDC baserom version, dtothefourth's version, my KLDC version) and add more. Players/hackers who are already familiar with those should feel like it's mostly the same patch, but with a new dress.
- Make the code less intimidating to understand and edit.
The result is this:
(you can also check the GitHub repository here)
A summary of the features included from the original/modified Retry patch:
- Compatible with LoROM as well as SA-1. It should also be compatible with already existing resources that were made to be compatible with Retry (for example, Individual DC Save patch).
- Different death options: instant respawn, "retry/exit" prompt respawn, vanilla death sequence, that can be changed on a sublevel basis.
- Counterbreak options: reset powerup, Yoshi, coins, etc. on death and on overworld load, useful for Kaizo hacks or collabs.
- Infinite lives option. A must-have for Kaizo hacks.
- Multiple midways system: ability to have more than one midway per level/sublevel. Each sublevel's entrance can be set as a checkpoint, or you can use the custom midway object to have as many midways as you want. (the more custom midways you have, the more RAM needed, by default it's 8 per sublevel)
- SRAM expansion feature: Retry will save its checkpoints to SRAM, and you can use this to save your own stuff as well (as an alternative to the SRAM/BW-RAM Plus patch).
- Retry Prompt customization: you can customize the prompt by removing the "Exit" option, or the black box, or move it around. Useful to let the player see what's on the screen without obstructing their view.
New features:
- Compatible with a lot more resources than before, thanks to the reduced amount of hijacks (14 instead of 40+). Important mentions are: message box patches (for example Message Box Expansion), death routine patches (idk, haven't tried any lol), start+select patches (Start+Select Advanced), NMI patches (although lx5 mostly solved that issue in 2.06b), and more (Easy Mode 7 patch comes to mind).
- The SRAM expansion patch is SA-1 compatible as well (saves to BWRAM instead of SRAM, of course). No need to use BW-RAM Plus to save Retry's checkpoints anymore! Also, similarly to SRAM/BW-RAM Plus, it uses a "defaults" table to initialize the SRAM on new file load with the values you want (original Retry just resets everything to 0 instead).
- Some of the global options can be controlled with RAM addresses. For example, you can turn on/off the prompt "Exit" option or black box with it, or change the prompt position, or change from instant respawn to prompt on the fly. This can be useful for collabs (maybe someone wants the default prompt, while someone else wants the unobtrusive version) or to let the player choose which respawn option they want (with some in-game menu or something).
- Made the "reset RNG" option sublevel dependent. Original Retry always resets the RNG, so you can have consistent behaviors when respawning, but sometimes this can be undesirable (for example, in bosses). Now you can set some sublevels to not have the RNG reset.
- Added a table to turn on SFX echo on a sublevel basis. This was ported over from the KLDC baserom Retry.
- New options to make respawning even faster. One lets you have the prompt but skip the "Mario jumps up" phase of the death animation, making the prompt appear instantly. The other largely decreases the time the level takes to fadein/fadeout, saving 1-2 seconds for each death.
- Added a death counter. Since Retry mostly involves around dying, it made sense to integrate the death counter patch into it. You can optionally display it on the status bar or on the Overworld border.
- Easy to integrate Retry's multiple checkpoint system with custom midway blocks/sprites. There's a specific address you can use to set a checkpoint for the current level, and optionally to set which entrance the checkpoint will redirect to (similarly to Retry's custom midway object).
- Added a SFX when getting a checkpoint on room entrance. This is useful to let the player know they just got an "invisible" checkpoint. You can turn this off if undesired.
- Added a "save the game when getting a checkpoint" option, similarly to hacks like Not Dracula's Castle. Be wary of not softlocking a player's save file, though :) (make sure all levels are beatable from any checkpoint).
- Added a bunch of more "extra" routines that run in specific moments of the game, useful for coders. Besides the ones from OG Retry (one called when dying and one when respawning), there's also routines called when loading/saving the game, one when getting a normal checkpoint and a room checkpoint, and one called at the very end of gamemode 14 (just before music code runs).
Some bugs from the original Retry that have been fixed:
- Sprites will behave consistently when respawning in a level with a pipe entrance. In vanilla, during a pipe entrance sprites won't move if you came from a pipe, while they will move if you came from a door. OG Retry made this inconsistent on respawn, making sprites always move in either case.
- Sprites won't disappear when the Retry prompt shows up. This was often noticeable when dying while a bounce block sprite was spawned.
- When using SA-1 or PIXI's 255 sprites per level feature, their sprite index table will be reset properly when using more than 128 in a level (OG Retry only reset the first 128 entries).
Other QOL additions:
- It's now easy to change which tiles in SP1/2 the prompt will use. Before you had to edit a few tables that used different formats, and also change some values in the code itself so it was kind of a pain. Now you just need to edit some defines. This is useful if you have other resources that dynamically upload tiles in SP1/2 (e.g. 32x32 tilemap patch, sprite status bar, etc.). Also, the prompt will use less space in the GFX file, since it uses (almost) exclusively 8x8 OAM tiles instead of 16x16. This is especially true if disabling the "Exit" option or the black box: with both disabled, only 5 tiles will be used.
- The code is split in multiple modules and (mostly) commented, to make understanding it and editing it friendlier. No more scouring around a single huge file trying to find what you need. Also Retry's RAM now uses sane naming (for example, !ram_is_respawning rather than !freeram+5).
At first setting it up might seem hard, mostly because there's a lot of files to insert with UberASM. The "how_to_insert" file guides you through it, and after the initial setup, using it is as simple as just editing the settings you want and running UberASM Tool (note that the hijacks are applied automatically when running the tool). If you need to remove it from your ROM, simply delete the files from the UberASM folder and list.txt, run the tool, then patch the included "retry_unpatch" file with Asar.
What's missing?
This is an early C3 release, although all the features that I planned to add are implemented. Only things missing right now are:- Finish the documentation: some things are missing, most notably the "ObjecTool integration" doc, and also currently the docs are all over the place. I plan on writing a proper readme and organizing everything better.
- Check for compatibility with some resources like the latest SA-1 v1.40 (should work fine, I just haven't checked yet), lx5's Custom Powerups, lx5's DSS (it should work fine with the instant respawn option, while the prompt probably breaks. I may try to make them work together at some point), No Overworld UberASM, Co-Op patch for Retry, etc.
- Fix any bugs that might come up in the meantime. Speaking of, if you think you found a bug, let me know here or by DMs.
Special Thanks
I need to mention a few special people who helped a lot:- worldpeace: while not directly helping me, he made the original Retry patch, without which I couldn't have made this.
- lx5: for providing integration with many resources to OG Retry 2.06b, and also for the BW-RAM Plus patch.
which I stole the code from - Abdu, BabaYegha, Fyre150 and margot: for beta testing the patch, reporting and providing feedback and suggestions.