It was tricky to figure out exactly how I wanted to approach this in a way that was actually efficient, and I ended up doing something that's probably about as fast as it could be, at the cost of half a kilobyte of RAM (or lower since it's proportional to the max number of actors I want to allow per level, and I have that limit silly high currently)
I'm trying to get myself to favor solutions that are fast at the expense of some ROM or RAM because neither are really resources I need to conserve that much. I have about 55% of the RAM just doing nothing and I already have all the critical stuff in so it's fineee.
A feature I've been thinking about for awhile that would potentially take up a chunk of RAM is adding in some indirection when drawing level tiles/blocks, with a pointer for each one to let me redefine their appearance. Super Mario World does that, and it redefines what its 512 block IDs actually mean across tilesets.
I can think of a few situations where that would be helpful but with the overhead and the additional complexity I've just let it sit because I still haven't hit a situation where I feel like I *need* it.
#snesdev
@NovaSquirrel You could have each block have an attribute that can be checked against, depending on how you're implementing things. Or you can group things so that the check becomes a check for a range of IDs instead of a list of them, which might be simpler.
-F
@Felthry Yeah I'm using ranges for some things, like "is this a slope?" which gives me the fastest checks since the ID itself is enough.
There's also a per-block "category" or "class" field which I'm using for things like "is this water/collectible/a button?"; I guess there could be a category for variations of the same block.