News:

Don't forget to visit the main site! There's lots of helpful docs, patches, and more!

Main Menu

Metroid 1 Background tiles / Display priorities? Putting Samus in front...

Started by AceEbb, September 18, 2017, 07:39:38 PM

Previous topic - Next topic

AceEbb

Hey all! Just registered, would ordinarily "lurk more" but have for a long time had this question on my mind...

I've always wanted to make a hack, and have had many false starts and abandoned projects. One thing that would really motivate me to finish one is being able to implement true background tiles, i.e. tiles that Samus could obscure / stand in front of. It seems like the code, as it is, always puts Samus behind stuff, as seen when door-jumping thru walls. And of course, the bushes and stuff that Samus is "behind." One exception I've seen is that doors are displayed as "behind" Samus. Hmmm...

My question: Does anyone where I'd start with this? I recognize from Editroid that room structures have a display priority since they can be moved forward and back relative to one another. Anyone know where in the ROM the rules for Samus's display priority is, if any? Or how it works for those bushes and if that can be tweaked/reversed? Or is it more a question of what gets drawn onto the screen first?

Any info and related ROM offsets that could help me get my head around the problem would be greatly appreciated!

snarfblam

I'm afraid things are a little less flexible than you might think. Think of the background as a single layer. A sprite may either appear in front of or behind the background. Samus is always behind the background for the sake of doorways and tunnels. It would be possible (easy, even) to place Samus in front of the background, but then Samus wouldn't be concealed by these objects. Door bubbles can appear behind Samus because those are separate sprites and not part of the background layer.

It's possible to flip back and forth between in-front-of and behind the background layer, but this gets complicated fast. You could have Samus always in front of the background except when touching a doorway tile to keep doorways in front, which is relatively easy to program, but then you need to have a blank "buffer" area near the door so Samus doesn't visibly "pop" through the background layer. That still doesn't get you morph tunnels and the like. Beyond this half-assed solution, things get really complicated pretty fast.

AceEbb

Wow, didn't expect a reply so fast, thanks - and snarfblam himself no less! Have always been much impressed with all your work.

Yeah, I had a feeling it might be not-so-easy. Hmmm, I've always been the king of workarounds in many areas of my life, so the half-ass solution might be ok. By "flip between" do you mean, would that work room by room? If so, I could limit my pretty background stuff to certain places where I could purposely avoid it looking stupid, such as by omitting breakable tiles in those places, or whatever else it would take. By the "blank buffer" area, do you mean I'd have to completely forego the grid-like "door-jamb" tiles and just have blank tiles in their place?

Do you have the specifics of how this would work (the half-assery of which you speak) handy? I'd love to play with it even if I end up ultimately disappointed. I geek out hard on this game and all its glitchy majesty. Thanks again, man!

Grimlock

I think with the right design choices you could easily scoot Samus to the top layer and design around that.  Even with bubble doors you could just design them as a transparent bubble with an outline around them.  Other than that I can't think of any other issues you would encounter.