Language…
4 users online: Astrakitu,  BeeKaay,  Big Brawler, Teows - Guests: 244 - Bots: 97
Users: 70,823 (2,363 active)
Latest user: sdauner

Overworld Player Sprite Expansion

SMW Patches → Overworld Player Sprite Expansion

Submission Details

Name: Overworld Player Sprite Expansion
Author: Barrels O' Fun
Added:
Tool: Asar
Requires Free Space: Yes
Bug Fix: No
Featured: No
Description: A complete rewrite of Erik's 'Overworld Mario Tilemap Rewrite'.

These patches rewrite the entirety of the code that handles the drawing of the overworld players and of Yoshi, resulting in a 16x16 dynamic sprite for Mario/Luigi (instead of 4 8x8s) as well as Yoshi if enabled.

There are a variety of simple tweaks you can apply in 'OPSE.asm' as well slightly more advanced things you could such as dynamic palettes and powerup graphics in the 'opse' folder with files such as 'opse_gfx.asm', 'opse_dynamicpalettes.asm,' and 'opse_powerups.asm'.

More advanced additions include powerup objects and custom animations. You can use defined RAM values (usually $13E6/$13E7) in uberASM to override players' animations using the provided animations or your own if you've coded them in and added them to the table.

Powerup Objects can be added in 'opse_powerups.asm' and are a lot more work than adding graphics or modifying dynamic palettes, as you have code the entirety of the object yourself and potentially interfacing it with the players' existing animations. A cape object and a basic sample floater object have been provided.

If there's main code that needs tweaking, all of that is in 'opse/main' in several named files.
Tags: dynamic lorom oam overworld player pose sa-1 tile yoshi
Comments: 18 (jump to comments)
Download 55.69 KiB | 178 downloads

Screenshots

Comments (18)

Skewer Link
For those who plan to use this, keep in mind that this patch in its base is incompatible with "LX5's Player Graphics Kit"
Link13 Link
Patched it on a lorom with DKCR Status Bar and it removes it. Luigi's fire palette doesn't change. (Doesn't seem the code has it pointed to it.) I noticed P2 Cape Palette doesn't show and I wish there's a way to move the cape pal location. I'm currently working on OW Custom Powerups graphics for my hack because of this. And finished! Other than those problems, great patch.
 MarioFanGamer Link
Moderated with:
  • Lunar Magic v3.51
  • SA-1 Pack v1.40
  • Asar 1.71
  • Yoshi Expansion Kit v1.01
  • BSNES v115 (single player stuff)
  • Mesen 2 (two player stuff)
Removed dots from folder names (UNIX dotfiles are considered "hidden" but these are too important to be hidden), fixed major glitch where the palette was messing up on SA-1 (S-CPU code must use S-CPU registers, C-CPU must use C-CPU registers), fixed broken non-dynamic Yoshi Expansion indexing (redundant TAY removed), removed Erik from the authors since this is a near complete rewrite and consists of almost none of Erik's codes (not to mention he requested himself to be removed from the list anyway)

Let's be honest: This is one of the the best patches out there ever created for SMW since it gives the player sprite more freedom (most notably, diagonal sprites but also custom powerup states) and easily allows the use of better custom sprites. This does mean it's quite complex and may break some stuff (most notably, it rewrites the entire player GFX routine) and there are some bugs I've noticed two more minor bugs which I didn't
  • The lives exchanger doesn't upload the players' palette which becomes especially relevant after a hard loading (i.e. level transition, pipe or star warp)
  • An easier to fix issue is the fact that the player sprites will override which is especially notable with the !-blocks and one of the players happen to use a custom palette (fire by default) since they use the first half of the palette.


Some other things which could be a bit better for user-friendliness and either could have been handled better in general or be handled in:
  • If you use !YoshiExpansion with dynamic Yoshi colours, you need to manually change YoshiPalPtr to have eight colours, else the colours will be messed up for the latter half of the Yoshi colours (to any user out there, ExYPal1 is gold, ExYPal2 is silver, ExYPal3 is pink / local 1, ExYPal4 is gray / local 2).
  • Speaking of Yoshi: If you use non-dynamic colours, one must change YoshiGFX to OWYoshi.bin since the palettes are static in this case
  • It'd be a good idea to hide ($04*!8Directions) from the user as much as possible
  • It's generally understood that zero means a feature is disabled and non-zero so the whole error correction stuff is actually not necessary unless you're dealing with number ranges (and even then, you can use self-correcting defines such as I do for palette stuff).
  • Last but not least, for any hack which uses a CG-RAM mirror which gets uploaded every frame, allow the user to write to this mirror directly instead of using DMA all the time (saves some v-blank time since the colours don't have to be uploaded twice and the colours also are written to a CG-RAM mirror at all too)
Other improvements in regarding the patch itself:
  • The upwards cape animation looks a bit wrong (a bit too exaggerated if you ask me)
  • If you use bitwise operators with a constant, you don't need to change to 8-bit maths when you're in 16-bit mode since operands can easily be set to not modify the result (e.g. keep all the high bits clear when doing an ORA), resulting in a slightly faster and smaller code


But these issues are to be expected for such a big patch, something which can always be improved over time.
Cape Link
Yooo! Those diagonal overworld sprites are sick!
BDgames2023 Link
How can I put a custom palette?8>
 Erik Link
Can't update the patch as I didn't make the submission and I didn't contribute to this version, but two issues.
1. If you set !DynamicPalettes to any even value, the patch does not assemble. (using Asar 1.91)
Code
patches/opse/main/opse_lives_exchanger.asm:21: error: (Emismatched_parentheses): Mismatched parentheses. [if 2&1 || (1 == 1 && -1 < -1)]

2. If you set !8Directions to 0, the diagonal frames glitch.
Barrels O' Fun Author Link
Sorry for the slightly late response... Those issues should be fixed now.
Flipipu Link
Just tried the patch and it works great!

I have a question though, where is the location of the actual player sprites for mario and luigi? Like the ingame ones, not the overworld ones. Also, which asm do I edit to include unique extended tiles for luigi?

Edit: Nevermind I'm an idiot, I used a rom that already had Separate Luigi GFX installed, my bad
ELKIRA Link
This is very interesting, would this be able to play animations for the custom powerups of lx5? it is compatible, we would just have to find a way to do it...
simon.caio Link
oh wait! Does this mean I can finally have two completely different ow player graphics?
Klug Link
No way, dude. That's too much WITCHCRAFT going on! I swear to God this isn't part of the upcoming Summer C3...

Anyway, nice patch, tho~!
Heitor Porfirio Link
This patch is one of the most impressive things I've ever seen, a lot of people must like it! But I found some caveats:

1) I tried to install this patch with Asar v1.81 and with practically nothing changed, and it gave me this error:

Code
opse/main/opse_gfxhandler.asm:71 (called from opse/main/opse_gfxhandler.asm:112): error: (E5153): Invalid check command. [check bankcross full]
opse/main/opse_gfxhandler.asm:83 (called from opse/main/opse_gfxhandler.asm:112): error: (E5119): Broken incbin command. [incbin ../.graphics/OWWater.bin:(0)..((0+$40))]
opse/main/opse_gfxhandler.asm:84 (called from opse/main/opse_gfxhandler.asm:112): error: (E5119): Broken incbin command. [incbin ../.graphics/OWWater.bin:((0+$200))..((0+$240))]
opse/main/opse_gfxhandler.asm:83 (called from opse/main/opse_gfxhandler.asm:112): error: (E5119): Broken incbin command. [incbin ../.graphics/OWWater.bin:(64)..((64+$40))]
opse/main/opse_gfxhandler.asm:84 (called from opse/main/opse_gfxhandler.asm:112): error: (E5119): Broken incbin command. [incbin ../.graphics/OWWater.bin:((64+$200))..((64+$240))]
opse/main/opse_gfxhandler.asm:83 (called from opse/main/opse_gfxhandler.asm:112): error: (E5119): Broken incbin command. [incbin ../.graphics/OWWater.bin:(128)..((128+$40))]
opse/main/opse_gfxhandler.asm:84 (called from opse/main/opse_gfxhandler.asm:112): error: (E5119): Broken incbin command. [incbin ../.graphics/OWWater.bin:((128+$200))..((128+$240))]
opse/main/opse_gfxhandler.asm:83 (called from opse/main/opse_gfxhandler.asm:112): error: (E5119): Broken incbin command. [incbin ../.graphics/OWWater.bin:(192)..((192+$40))]
opse/main/opse_gfxhandler.asm:84 (called from opse/main/opse_gfxhandler.asm:112): error: (E5119): Broken incbin command. [incbin ../.graphics/OWWater.bin:((192+$200))..((192+$240))]
opse/main/opse_gfxhandler.asm:83 (called from opse/main/opse_gfxhandler.asm:112): error: (E5119): Broken incbin command. [incbin ../.graphics/OWWater.bin:(256)..((256+$40))]
opse/main/opse_gfxhandler.asm:84 (called from opse/main/opse_gfxhandler.asm:112): error: (E5119): Broken incbin command. [incbin ../.graphics/OWWater.bin:((256+$200))..((256+$240))]
opse/main/opse_gfxhandler.asm:83 (called from opse/main/opse_gfxhandler.asm:112): error: (E5119): Broken incbin command. [incbin ../.graphics/OWWater.bin:(320)..((320+$40))]
opse/main/opse_gfxhandler.asm:84 (called from opse/main/opse_gfxhandler.asm:112): error: (E5119): Broken incbin command. [incbin ../.graphics/OWWater.bin:((320+$200))..((320+$240))]
opse/main/opse_gfxhandler.asm:83 (called from opse/main/opse_gfxhandler.asm:112): error: (E5119): Broken incbin command. [incbin ../.graphics/OWWater.bin:(384)..((384+$40))]
opse/main/opse_gfxhandler.asm:84 (called from opse/main/opse_gfxhandler.asm:112): error: (E5119): Broken incbin command. [incbin ../.graphics/OWWater.bin:((384+$200))..((384+$240))]
opse/main/opse_gfxhandler.asm:71 (called from opse/main/opse_gfxhandler.asm:112): error: (E5153): Invalid check command. [check bankcross full]
opse/main/opse_gfxhandler.asm:73 (called from opse/main/opse_gfxhandler.asm:112): error: (E5061): Label 'WaterGFX' redefined. [WaterGFX:]
opse/main/opse_gfxhandler.asm:83 (called from opse/main/opse_gfxhandler.asm:112): error: (E5119): Broken incbin command. [incbin ../.graphics/OWWater.bin:(0)..((0+$40))]
opse/main/opse_gfxhandler.asm:84 (called from opse/main/opse_gfxhandler.asm:112): error: (E5119): Broken incbin command. [incbin ../.graphics/OWWater.bin:((0+$200))..((0+$240))]
opse/main/opse_gfxhandler.asm:83 (called from opse/main/opse_gfxhandler.asm:112): error: (E5119): Broken incbin command. [incbin ../.graphics/OWWater.bin:(64)..((64+$40))]
opse/main/opse_gfxhandler.asm:84 (called from opse/main/opse_gfxhandler.asm:112): error: (E5119): Broken incbin command. [incbin ../.graphics/OWWater.bin:((64+$200))..((64+$240))]
opse/main/opse_gfxhandler.asm:84 (called from opse/main/opse_gfxhandler.asm:112): error: (E5001): Over 20 errors detected. Aborting. [incbin ../.graphics/OWWater.bin:((64+$200))..((64+$240))]
A fatal error was detected while assembling the patch. Assembling aborted. Your ROM has not been modified.

And I tested it with Asar v1.91, and it didn't give any of these errors.

2) The player always starts with just 1 life, but I don't know if this was a matter of debugging.

But other than that, the patch is very good. Good luck! #smrpg{y}
Barrels O' Fun Author Link
Are you using the latest version of Asar? It compiles with version 1.9
Heitor Porfirio Link
Oops, I forgot to say that I first tested it on Asar v1.81 (which gave the error), then on the latest version. #smw{^_^;}
Barrels O' Fun Author Link
Also, the lives being set to 1 was debugging for quick gameover access, I must've forgotten to remove it. I've updated the patch to get rid of that hijack
Heitor Porfirio Link
I downloaded the file again, and the lives counter still remains at 1, for both Mario and Luigi. SMW Central has a problem with caching, which means that even if the file is updated, if it has the same name, it will not have any effect.

The recommendation would be to put at least one or more different characters in the file name when updating, or make another separate submission if you don't want.

And just a curiosity here:
If you install this patch first and then Widescreen Overworld, the dynamic graphics will not even appear, and a garbled 16x16 sprite may appear on the very left side of the Overworld for a brief moment. By installing Widescreen Overworld first and then this patch, they will work flawlessly.
Barrels O' Fun Author Link
I downloaded the updated version and it has the change I made removing the hijack.
In 'hijacks/continue_flag.asm', there was originally:

org $009E25
db $00

that set the lives to 1. Is that still there for you?
Also, for widescreen overworld, patch OPSE after it, not before and everything should be fine
Heitor Porfirio Link
Originally posted by Barrels O' Fun
I downloaded the updated version and it has the change I made removing the hijack.
In 'hijacks/continue_flag.asm', there was originally:

org $009E25
db $00

that set the lives to 1. Is that still there for you?

Now I turned off my computer, but it still didn't change for me.
But thanks for the reference, as the patch is very complex!

Originally posted by Barrels O' Fun
Also, for widescreen overworld, patch OPSE after it, not before and everything should be fine

And I saw that the interpretation of my other comment was weird, which meant that Widescreen Overworld had to be BEFORE OPSE, and I updated it.