I've been thinking about a side-project to create an RPG following the limitations of the NES as closely as I can.
To be clear, I'm talking about creating a game using modern architecture but designed to mimic the NES, not creating an actual NES ROM. Even so, I want to follow as many of the hardware restrictions as I am capable of. The more I've studied what most of these limits are, and as I've examined how NES games worked within those limits, the more I want to work within the limits myself. That being said, all the questions I have about these limitations should assume I am talking about the limitations from officially licensed hardware from the era. (Though it is fun to learn what other things were/are possible, so I'm not opposed to learning extra information.)
I've already found and examined a lot of information about how it handles and draws sprites and backgrounds. What I do not understand are things about how it loads and stores tiles.
I do understand that the system had two banks for tiles, each capable of storing 256 tiles, which comes out to the equivalent of two 128x128 images worth of tiles (as each tile is 8x8.) (Edit; fixed the number.)
What I do not understand is what restrictions the system has in regards to how it fills those banks with data. I was on a forum on another site and someone tried to explain a lot of it to me, but I didn't understand much of it, and the fellow never replied to confirm or explain anything.
First of all, I have questions about exactly where a tile is loaded. By which I mean, what order a particular tile may be in the memory. If we think of the banks as literally a 128x128 image, are there restrictions about where on that image a tile could be? Let's say in one part of the game, I load a bunch of forest tiles, and then in another part of the game, I load a bunch of city tiles, and in both areas I have some tiles that are used in both areas. Do those tiles that are used in both areas have to appear in the same location on the 128 image, and be all in the same order? Or would having them be in a different location/order mean that I have to create a whole new set of tiles or a new tileset or such thing? And to what extent do any such restrictions apply? Would this apply to both banks as if they were one? Or to each bank individually as a whole unit? Or perhaps just it just applies to a group of 64 tiles? Or are such restrictions irrelevant, and if I wanted to load a forest area, and then bring in just one single tile from the city area, I could so that without impacting how I have to arrange everything?
Granted, there is something to be said about the ease of always knowing that the tile you want is always in a given location. But knowing how these restrictions are set up will be important for knowing what combinations of enemies I can have in a battle.
Next question, if I say the term "tileset," exactly what am I referring to? It was really hard to write that section about without using it, but I want to make sure it refers to what I think it refers.
Next set of questions, which I suspect impacts the answers to my first set of questions. On the other forum a guy talked about how a game could load tiles into memory from either RAM or ROM. This very much intrigued me, but I was left with far too much that I didn't understand. First of all, is this an option that is set permanently for a cartridge, or something can be changed at a reasonable point in the game? Now, he said that with using ROM for tile data, the entire tileset could be switched out each frame. A lot of games use this to animate backgrounds. But the trade-off is that a game can't mix up what tiles are in a tileset as freely. Whereas if it loads the tiles from RAM, it can mix the tiles more freely, but it has limits about how many tiles it change out per frame. And I assume these limits are dependent on what MMC the cart uses. But even so, I am curious what all of these limitations actually are. It was suggested to use RAM loading for an RPG because it allows me to more freely customize what combination of enemies appears in a battle. But if I can load an entire bank of tiles into the memory for each frame, what's really stopping me from just creating a lot of pre-made tilesets for each possible combination of enemies I could want? What harm does it do me to load a bank of tiles that is only one tile different from another bank? He also made it sound like games that use the RAM loading method were pretty much incapable of animating backgrounds (at least by changing what tiles are loaded; there still is the possibility of using palette animations, and I'm guessing tilemap animating should be a thing.) But if the RAM method simply slows down the speed at which tiles can be loaded, what's wrong with just keeping the number of animated tiles limited to how many can be loaded per frame? Why couldn't I animate just the water tiles? Or load a whole new image for the player each frame?
And finally, although not really related to loading tiles, I would like to know: is there really any disadvantage to using the 8x16 sprite mode?
I can see how it can cause problems with having too many sprites on one scanline, since even if a row is transparent it still counts toward that limit. So if you were building a character that was, say, 24 pixels tall, you could run into the flickering problem a little easier since there are an extra 8 pixels floating above (or below) the part that is actually visible. And if you want to build a character with multiple palettes, you will have to fit those palettes into 8x16 sections instead of 8x8 sections. But those are relatively minor trade-offs compared to being able to effectively double the number of sprites on the screen. Is there some other disadvantage that I am unaware of? Also, can the game switch between the sprite mode at any given time, or is it set permanently in the cartridge, or what?
Those are all of the questions I have at this time. Thank you for your time.
To be clear, I'm talking about creating a game using modern architecture but designed to mimic the NES, not creating an actual NES ROM. Even so, I want to follow as many of the hardware restrictions as I am capable of. The more I've studied what most of these limits are, and as I've examined how NES games worked within those limits, the more I want to work within the limits myself. That being said, all the questions I have about these limitations should assume I am talking about the limitations from officially licensed hardware from the era. (Though it is fun to learn what other things were/are possible, so I'm not opposed to learning extra information.)
I've already found and examined a lot of information about how it handles and draws sprites and backgrounds. What I do not understand are things about how it loads and stores tiles.
I do understand that the system had two banks for tiles, each capable of storing 256 tiles, which comes out to the equivalent of two 128x128 images worth of tiles (as each tile is 8x8.) (Edit; fixed the number.)
What I do not understand is what restrictions the system has in regards to how it fills those banks with data. I was on a forum on another site and someone tried to explain a lot of it to me, but I didn't understand much of it, and the fellow never replied to confirm or explain anything.
First of all, I have questions about exactly where a tile is loaded. By which I mean, what order a particular tile may be in the memory. If we think of the banks as literally a 128x128 image, are there restrictions about where on that image a tile could be? Let's say in one part of the game, I load a bunch of forest tiles, and then in another part of the game, I load a bunch of city tiles, and in both areas I have some tiles that are used in both areas. Do those tiles that are used in both areas have to appear in the same location on the 128 image, and be all in the same order? Or would having them be in a different location/order mean that I have to create a whole new set of tiles or a new tileset or such thing? And to what extent do any such restrictions apply? Would this apply to both banks as if they were one? Or to each bank individually as a whole unit? Or perhaps just it just applies to a group of 64 tiles? Or are such restrictions irrelevant, and if I wanted to load a forest area, and then bring in just one single tile from the city area, I could so that without impacting how I have to arrange everything?
Granted, there is something to be said about the ease of always knowing that the tile you want is always in a given location. But knowing how these restrictions are set up will be important for knowing what combinations of enemies I can have in a battle.
Next question, if I say the term "tileset," exactly what am I referring to? It was really hard to write that section about without using it, but I want to make sure it refers to what I think it refers.
Next set of questions, which I suspect impacts the answers to my first set of questions. On the other forum a guy talked about how a game could load tiles into memory from either RAM or ROM. This very much intrigued me, but I was left with far too much that I didn't understand. First of all, is this an option that is set permanently for a cartridge, or something can be changed at a reasonable point in the game? Now, he said that with using ROM for tile data, the entire tileset could be switched out each frame. A lot of games use this to animate backgrounds. But the trade-off is that a game can't mix up what tiles are in a tileset as freely. Whereas if it loads the tiles from RAM, it can mix the tiles more freely, but it has limits about how many tiles it change out per frame. And I assume these limits are dependent on what MMC the cart uses. But even so, I am curious what all of these limitations actually are. It was suggested to use RAM loading for an RPG because it allows me to more freely customize what combination of enemies appears in a battle. But if I can load an entire bank of tiles into the memory for each frame, what's really stopping me from just creating a lot of pre-made tilesets for each possible combination of enemies I could want? What harm does it do me to load a bank of tiles that is only one tile different from another bank? He also made it sound like games that use the RAM loading method were pretty much incapable of animating backgrounds (at least by changing what tiles are loaded; there still is the possibility of using palette animations, and I'm guessing tilemap animating should be a thing.) But if the RAM method simply slows down the speed at which tiles can be loaded, what's wrong with just keeping the number of animated tiles limited to how many can be loaded per frame? Why couldn't I animate just the water tiles? Or load a whole new image for the player each frame?
And finally, although not really related to loading tiles, I would like to know: is there really any disadvantage to using the 8x16 sprite mode?
I can see how it can cause problems with having too many sprites on one scanline, since even if a row is transparent it still counts toward that limit. So if you were building a character that was, say, 24 pixels tall, you could run into the flickering problem a little easier since there are an extra 8 pixels floating above (or below) the part that is actually visible. And if you want to build a character with multiple palettes, you will have to fit those palettes into 8x16 sections instead of 8x8 sections. But those are relatively minor trade-offs compared to being able to effectively double the number of sprites on the screen. Is there some other disadvantage that I am unaware of? Also, can the game switch between the sprite mode at any given time, or is it set permanently in the cartridge, or what?
Those are all of the questions I have at this time. Thank you for your time.