Celius wrote:I think i understand scrolling now. I think I am going to make a couple programs for my current projects. I could design them, I just am not so good with programming opening files and saving files. Do you think it will be alright to make programs with C, and not C++? Because I only know C at the moment. I am not sure how to just jump right into hibber jibber, and ouput stuff on the screen. I don't know how to make a program open a .chr file and put the data on the screen! Is it really hard? Do you know where I could find out how to?
Hi, Celius. Any programming language/tool you choose is fine, as long as you can write to files with it. One of the easiest tools to build level editor is qbasic (old basic interpreter from microsoft wich came with DOS and Win95), wich I used for quite a while. Reading from and writing to files is very easy with it. I use Delphi now, since it is easier to make graphical stuff that more advanced level editors need.
To build your level editor you'll first need to decide what will your level format be. You must think how your game is going to work: Will the screen move horizontally? Vertically? Both? How long will the levels be? How will you handle the objects in it? - All this stuff impacts on how your level editor works. Large levels will most likely need some kind of compression, you must decide a way to define objects (sprites and bg), etc. etc.
The easiest level format is a 2-dimensional array of blocks (I am assuming you can work with arrays in C or whatever). Sit down a minute and decide what kinds of blocks your levels will use. Rocks, grass, sky, water, bricks, etc. All blocks must be the same size (in this simple case, 16x16 pixels, or 2x2 tiles), so if you need larger things they'll have to be made of smaller pieces.
After you have decided all the blocks you're going to use, you must assign a number to each block. Now all you have to do is write a program to "draw" your level. This program is only a friendly interface, so that when you place a sky block at the top of the screen it writes the correct number to an array.
In this simple case you could just write the block numbers to .db statements (althoug it would be very boring) and not write a program for it at all, but in more complicated level designs (like in SMB1, where the levels are compressed, so things aren't quite aligned for a human to see very well) you'll certainly need a level design program to aid you.
Anyway, when you're past this level making part, you must worry on how to implement the reading of the level format you idealized. In this case you'll most likely have to build a table, describing the tiles that make up every block, and the palette they use. So, when reading this level from ROM you'll have to get the block number, check on your table what tiles that block uses, write the tiles to the name table and write the palette entries to the attribute table.
Deciding on a level format is one of the hardest things when making a full game, especially when it's a scrolling game.
You said you'd use a "scanline" something to trigger the drawing of the next part of the level, but that isn't necessary. Just do it like this: If your charecter (player) moved 16 pixels to the right, you draw a new column of blocks to the right. Just draw as your player walks, because there is not enough time in vblank to draw an entire screen. You should draw it little by little.
Here's an advice: Download FCEUXD (or you could use your beloved Nesticle...=D) and use it's nametable viewing capabilities to watch how commercial games draw their levels little by little as you walk, and you might just get some ideas.
Watch games like Kirby (sometimes it scrolls 4-ways!), Little Mermaid (uses a very interesting level format), or even Somari (scrolls everywhere and can be usefull, even beeing a glitchy pirate). Try to figure out how people do stuff and you'll learn a lot.
And remember, the NES does not do anything "automatically", like scrolling or such. The NES is not like Macromedia Flash os anything like this. YOU have to tell the NES what to do on EVERY frame (or even in the middle of a frame!). It doesn't have "built-in animation", YOU make anymation by positioning things in different places every frame. This is great because it puts you in control of everything. If it had such easy commands like "scroll till this point" it wouldn't be fun at all and all games would look the same.
Good luck with your projects! (I can't seem to finish any of mine!)
-tokumaru-