A fact is we never had the opportunity to explore fully SMW's OAM table. Roughly 60% of it is completely hardcoded and the 40% remaining we can somewhat use with limitations using NMSTL, NoMoreSpriteTileLimits, which was revolutionary when it was released, but noways there's better solutions when the SA-1 chip is available.
MaxTile is here. Now you can use ALL the OAM slots available (128 total) and not just the 50-60 slots that the current patches used to allow.
But how about compatibility? We need to be careful with what kind of solution we can use. If we rewrite SMW's OAM allocation from scratch, you will have to pretty much port all vanilla sources and SMW Central resources to use, which is not very motivating -- you don't want to wait until all resources are converted before using them on your SMW hack.
For that reason, MaxTile was made to keep compatibility with all existing resources, specially custom sprites! This means that you can use MaxTile and use normally all your custom and vanilla sprites. It not just works normally, but also it does take benefit from using MaxTile. Now you can easily put 6 banzai bills, 5 big boos at the same time on the screen, without editing a single line of code, nor using their disassemblies -- SA-1 Pack does the work for you.
You can try with any custom resource as well! Custom sprites works fine with MaxTile, if the custom sprite used to work with SA-1 and PIXI before, it's very likely to keep working with MaxTile normally!
MaxTile doesn't remap or removes anything. The $0200-$03FF OAM attribute table still works normally. The secret is that every time a sprite runs, MaxTile ensures that $0338+ is cleaned up and moved to another buffer before the next sprite writes though it.
All sprite tiles are copied to the "MaxTile Buffer", which at the end of the frame, the rest of the $0200-$03FF table is compressed, eliminating all previous unused slots. Then, the MaxTile buffer copies all tiles to $0200-$03FF, taking all unused slots that SMW leaves, keeping it 100% compatible with anything else that writes to the $0200-$03FF, because MaxTile does the copy exactly when the frame is done.
Video link - This is Erik's Giant Urchins, hosted there, absolutely no line was changed to make it work with MaxTile.
SA-1 Pack v1.40 - MaxTile also features a priority system, where you can (finally!) control if you sprite will appear in front or behind other sprites:
Normal sprite priority - appears behind Mario and other tiles (fireball)
High priority - appears in front of Mario but behind other tiles (fireball)
Highest priority - appears in front of everything.
The priority system is completely dynamic, that is, the only thing you need to change is the value you pass to MaxTile (0 - highest priority, 3 - lowest priority) and it will give you a pointer with requested priority. The only thing you need to worry is draw!
SA-1 MaxTile uses several SA-1 tricks to ensure performance. Copy buffers back and forth is slow, the SNES system does not have enough bandwidth for that and the 65c816 architecture is not favorable at all.
Even if you use the heaviest sprites in terms of tile - even if they were not made to work on MaxTile - you won't get slowdown.
video link - This uses Akaginite's ExBanzai Bill sprites to demonstrate the power of the MaxTile engine and - no slowdown - ! It's worth seeing that Mario cape and Yoshi still works fine even with tons of tiles.
In other words, SA-1 Pack now allows for you putting 22 sprites on screen, 255 sprites per level and you can use the maximum amount of tiles possible - 128 - the maximum that the SNES hardware, S-PPU, allows for!
So what are you waiting for? Ah, the download link...
You might be thinking now "fine, more sprite spam!" or "I don't like putting so many enemies on my level, how can this be useful for me?"
The good news is that SA-1 MaxTile is not just about putting enemies or bosses on your ROM hack. Sprites are a purely visual thing that the SNES allows for, this means you can also draw things that are not enemies too.
The SNES Picture Processing Unit allows up to 128 sprite tiles on screen. Given they are 16x16, you can pretty much draw something as big as 256x128, 176x176 or well, 32,768 pixels on the screen without relying on Layer 1, Layer 2 or Layer 3.
This means that you can draw some simple background or animations as well! They are not enemies, but with creativity you can pretty much make your own sprite backgrounds or effects that normally requires HDMA or a dedicated layer.
For demonstration purposes, I decided to revive one of the very first codes I did in 2012, which is the snowfall effect on the overworld: https://www.youtube.com/watch?v=RGCs3KWyicA. It's simple, but because of the OAM limitations some tiles ended up disappearing or conflicting with the OW border part that is sprite (the panel behind Mario).
After almost 9 years, I decided to adjust the code to use SA-1 MaxTile and made it work on both levels and overworld via UberASM. Here is the result:
Much more dense and perfectly working snowfall - over 100 sprite tiles appearing on the screen at the same time. You can configure how many tiles to appear, whenever to enable or disable transparency, if it's just adapt for levels or overworld and much more.
The advantage of using sprites is exactly that - you have full freedom to control how many of them appear per time, density, speed, etc.
For the record, The Snowfall UberASM code uses SA-1 MaxTile Allocation Mode. It's one of the ways to use SA-1 MaxTile directly.
Another example I'd like to share is really, making sprite backgrounds. I thought in trees because they're vertical and they don't use many OAM tiles compared to a mountain or clouds.
Since they don't use many tiles, I made three layers of trees at once as you can see here:
If you combine creatively with layer 2 and layer 3, you are pretty much having six backgrounds on your level and you can parallax all of them together. And yet you can have 10 koopa troopas on the level without slowdown or getting out of sprite limits.
The system is a bit hardcoded but if you have reasonable ASM knowledge, you can customize it to add and remove layers, add and remove pillars or even completely make your own sprite background layers.
With MaxTile, I hope it becomes more common not just sprite backgrounds, but also larger platforms, larger sprites (including bosses) and more freedom in doing your SMW levels. I'd say this system is powerful enough to compete with Mario Maker, because you can pretty much make most of the screen filled with sprites and we have an huge amount of custom sprites available to use - and they should work normally with MaxTile - !
And of course, MaxTile was made thinking on the ASM programmer too. The system should not be hard to use on custom sprites and custom backgrounds, including on overworld and I took the time to write a complete documentation on how to make resources using MaxTile. Make sure to give it a read: here.
Epic. I'll give a read to the docs later but what you're showing here can be truly revolutionary and it doesn't even sound too difficult to use (and even compatible with pre-existing resources!). Great job.
DeppySlide Discord Moderator and Public Relations Gooey
Wow. Kaizo makers will be pleased with this new update. Now they're going to make thousands bullet hell levels. Also, tons of possibilities for normal hacks as well. Superb work as always, Vitor. You're always making such great progress and making SMW go one thousand steps further.
This is pretty damn amazing. The ability to have so many massive sprites onscreen at once is one thing, but the idea of creating new "layers", and 4bpp ones at that, is really exciting to me. While I don't have any plans for a hack right now, if I do end up making one then I'll almost certainly be implementing this.
You don't show up very often, but when you do, you're doing absolutely revolutionary stuff!
This is epic and even if I don't understand how it works, I am looking forward to trying this out.
I have no words to describe how amazed I am. You truly show again, that there are no limits for you!
Location: The Milky Way Galaxy
Last seen: 14 hours, 55 minutes and 11 seconds ago
Every time you make a new SA-1 pack update, I say that it can't get any better, it's as good as it's gonna get. Then, you make an update that blows that preconception out of the water. Vitor, you are doing incredible work!
-------------------- Currently working on:
Super Kekcroc World 4 (lol jk)