Attribute / Tile

Are you new to 6502, NES, or even programming in general? Post any of your questions here. Remember - the only dumb question is the question that remains unasked.

Moderator: Moderators

User avatar
tokumaru
Posts: 12106
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Attribute / Tile

Post by tokumaru »

gauauu wrote:Well, I am using 4x4 metatiles. But doing free all-directional scrolling - it's not obvious to me why I need to read the attribute tables for that, am I missing something?
(I'm using 4 name tables, if that makes a difference)
Even if you do have the off-screen space for updates in all directions (which you do because you're using 4 name tables), you still have to deal with the fact each name table is 30 tiles tall, and that number is not divisible by 4, so in every other vertical name table the attributes of your 4x4 metatiles will be misaligned with the attribute table, meaning you'll have to shift and mix attributes from different metatiles (or a buffer in RAM) to form the final attribute bytes.

That is, unless you take the easy way out, which's truncating the bottommost row of metatiles in every screen, using only the top half, so that attributes never misalign. That's as easy as 8-way scrolling gets, but I think it's weird to pretend that sections of your level maps don't exist.
User avatar
gauauu
Posts: 729
Joined: Sat Jan 09, 2016 9:21 pm
Location: Central Illinois, USA
Contact:

Re: Attribute / Tile

Post by gauauu »

tokumaru wrote: That is, unless you take the easy way out, which's truncating the bottommost row of metatiles in every screen, using only the top half, so that attributes never misalign. That's as easy as 8-way scrolling gets, but I think it's weird to pretend that sections of your level maps don't exist.
Heh, after a lot of thought and internal debate, that's exactly what I'm doing. I started writing the routines to do the mis-aligned metatiles, and said "forget this" -- so yeah, sections of my level maps won't actually exist :-/
User avatar
tokumaru
Posts: 12106
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Attribute / Tile

Post by tokumaru »

Yeah, that simplifies the rendering code a lot, but slightly complicates the logic side, since now you'll also need to skip those rows when testing for collisions, meaning you'll probably need a few Y >= 240? checks here and there.
User avatar
gauauu
Posts: 729
Joined: Sat Jan 09, 2016 9:21 pm
Location: Central Illinois, USA
Contact:

Re: Attribute / Tile

Post by gauauu »

Yup. Most of the checks are pretty simple so far. The only annoying ones I've hit at this point are checking for characters that span the 240-px boundary. Might be worth tracking y2 for each character just to avoid having to recompute that at each collision check.
User avatar
Myask
Posts: 965
Joined: Sat Jul 12, 2014 3:04 pm

Re: Attribute / Tile

Post by Myask »

Use the hidden data to label your maps, mayhap~

Or use it to spell out another message.

I asked this question, or close to it.
Post Reply