Hello. I'm new here. I'm sorry if this is a question that has been answered before. If so, please feel free to point me to the correct thread.
I've already programmed a game that has a non-scrolling background, similar to a pac-man maze, which is the same for every level. I'd like to start work on a game that scrolls. I have a basic scrolling engine going that stores level data using RLE compression, decompresses that data on the fly, and sends it to the PPU so that as the screen scrolls left and right, it displays the correct new background tiles. I've pretty much figured out 'the seam' and swapping nametables.
In my first game, the level data is stored as data bytes in the rom. wall collision is handled by a routine that converts the sprites' coordinates into the relevant address in the table, and checks to see what type of tile it is, whether it's 'solid' or not. This method only works because the background data is not compressed. As far as I can tell, there is no really efficient way to perform this kind of check on compressed level data.
The NES doesn't really have enough RAM to decompress two entire screens' worth of tiles into a buffer for doing this kind of collision checking. I got it down to two pages with the use of 16*16 metatiles. My basic question is whether I'm using the right approach. Is there a better way to decompress level data, perform wall collision detection with sprites, and then load data into the nametables at the seam? Do I have to use two entire pages of RAM for this, or is there a way to do it with less? Thanks for any advice.
I've already programmed a game that has a non-scrolling background, similar to a pac-man maze, which is the same for every level. I'd like to start work on a game that scrolls. I have a basic scrolling engine going that stores level data using RLE compression, decompresses that data on the fly, and sends it to the PPU so that as the screen scrolls left and right, it displays the correct new background tiles. I've pretty much figured out 'the seam' and swapping nametables.
In my first game, the level data is stored as data bytes in the rom. wall collision is handled by a routine that converts the sprites' coordinates into the relevant address in the table, and checks to see what type of tile it is, whether it's 'solid' or not. This method only works because the background data is not compressed. As far as I can tell, there is no really efficient way to perform this kind of check on compressed level data.
The NES doesn't really have enough RAM to decompress two entire screens' worth of tiles into a buffer for doing this kind of collision checking. I got it down to two pages with the use of 16*16 metatiles. My basic question is whether I'm using the right approach. Is there a better way to decompress level data, perform wall collision detection with sprites, and then load data into the nametables at the seam? Do I have to use two entire pages of RAM for this, or is there a way to do it with less? Thanks for any advice.