#66362 - gs2phateon - Tue Jan 10, 2006 3:37 am
At this point I have basically given up on making a 512x256 map the old-fashioned way. I have been working on this for about 2 weeks, and my program never reads the tiles right.
So I'm moving on.
Now, I'm just trying to combine 2 smaller maps into one large, longer map. The palette and map were very easy to do: the palette is the same for both of my maps, and the maps I could just copy and paste into one file.
I've answered half my question already, but that still leaves the tile sets. Obviously, it hasn't worked to copy and paste those into the same file. I know it's just the tiles that aren't working, because I can use either of the original tile sets for its respective map, and the other will just look funny.
So is there any way to load one set of tiles or one side of a map, and then use another set for the other half? Or even better, are there any programs out there that will let me simply merge both of my sets of 8x8 tiles into one larger tileset? Any help would be VERY appreciated, thanks.
#66364 - poslundc - Tue Jan 10, 2006 4:14 am
gs2phateon wrote: |
So is there any way to load one set of tiles or one side of a map, and then use another set for the other half? |
No, there isn't.
If the combined number of tiles is less than 1024, though, you can load the tilesets sequentially into VRAM and then add the correct offset to get from one tileset to the next when you specify your tile index in the map data. So if you have two tilesets, and your first tileset has 72 tiles in it, then tile 0 of the second tileset would become 72, tile 1 would be 73, etc.
Few games use maps larger than the 256x256 maps; they just scroll around and replace the edges of the map with new tile entries as they are reached. This works in part because the text background wrap, so that when you scroll past the right border of the map you'll start displaying tiles from the left edge, etc. Play just about any scrolling game in an emulator with the map viewer open to see how it works.
Dan.
#66365 - gs2phateon - Tue Jan 10, 2006 4:39 am
But if you aren't using map bigger than 256x256, where are the new tiles being loaded from?
#66366 - poslundc - Tue Jan 10, 2006 4:54 am
The same place you load your 256x256 map from: the ROM. You just use a map larger than 256x256 and copy in the sections you need.
Dan.
#66370 - gs2phateon - Tue Jan 10, 2006 5:10 am
And the tiles and the palette, how are they adjusted? I have done something similar to this before, but I had all of the tiles made before-hand. Do I make all of the tiles with the map too?
#66381 - poslundc - Tue Jan 10, 2006 7:06 am
You can design whatever kind of system you choose. All the GBA has a predetermined need for is the tile data and the screen data in VRAM; how you populate that data is up to you.
Most people write tools (such as a map editor) to convert information into a form that their program can use. If you are using someone else's tool, you'll need a way to convert and interpret its output into the correct data to display.
Dan.
#66480 - gs2phateon - Wed Jan 11, 2006 3:14 am
Thanks for the help, I got it to work, sort of. I made the map and everything, and it could scroll a huge map tile by tile. I wasn't using the scrolling register. Right now I'm trying to use it so I can scroll pixel by pixel, but I'm having a hard time readjusting the position on the map, so it will just wrap around the edges. Do you have any tips for this?
#66491 - poslundc - Wed Jan 11, 2006 7:23 am
gs2phateon wrote: |
Thanks for the help, I got it to work, sort of. I made the map and everything, and it could scroll a huge map tile by tile. I wasn't using the scrolling register. Right now I'm trying to use it so I can scroll pixel by pixel, but I'm having a hard time readjusting the position on the map, so it will just wrap around the edges. Do you have any tips for this? |
You can scroll the VRAM map to any location on your ROM map if you bitwise-AND the x- and y-coordinates with 255 (0xFF).
To convert tile coordinates in the ROM map to tile coordinates to use in the VRAM map, bitwise-AND the tile coordinates with 31 (0x1F).
First get it working, then see if you can figure out why it works.
Dan.
#66510 - pure_ev1l - Wed Jan 11, 2006 2:13 pm
I haven't read ppl's reply's just because I can't be bothered, just saw the topic and thought I would add my 2 cents as I just typed something relivant on another topic...
"its easy. I have only been programing for GBA for 4 days now, and I have made my own map editor with infinite size capabilities with some good tools and a gba game that can play any size map with no (visible) loading
all you need to do is if u move 1 tile left load a line of tiles down the left side off screen....
the only limittation of it is the fact that I ran out of virtual memory on my comp trying to compile a map bigger than 1024*1024 tiles....
but if I would have been able to compile it, it would have played.
if what I'm saying applies to your problem then with a slight grudge I could part with my source code for dynamic loading of an infinite map?"
#66694 - gs2phateon - Fri Jan 13, 2006 12:06 am
Yes, that is a pretty easy concept to understand, and I tried that, but I could only get it to work on a map that scrolled by tiles. I was just having some trouble using the scroll register to scroll by pixels.
#66695 - gs2phateon - Fri Jan 13, 2006 12:12 am
I have another question, how do you "bitwise-AND the x- and y-coordinates with 255 (0xFF)"?
#66698 - poslundc - Fri Jan 13, 2006 12:34 am
#66725 - LOst? - Fri Jan 13, 2006 5:52 am
poslundc wrote: |
Few games use maps larger than the 256x256 maps; they just scroll around and replace the edges of the map with new tile entries as they are reached. This works in part because the text background wrap, so that when you scroll past the right border of the map you'll start displaying tiles from the left edge, etc. Play just about any scrolling game in an emulator with the map viewer open to see how it works.
Dan. |
There is one problem. For GBA this works because the size of the screen is 240x160. That leaves a little edge for updating new tiles. But on the DS, the screen is 256 in width. That means you need to use 512 in map size in order to get a hidden edge to update the map. I hope you understand what I mean.
_________________
Exceptions are fun
#66753 - tepples - Fri Jan 13, 2006 7:44 am
LOst? wrote: |
But on the DS, the screen is 256 in width. That means you need to use 512 in map size in order to get a hidden edge to update the map. |
That or use windowing to restrict the display to 248 pixels wide. A lot of NES games did that (notably Super Mario Bros. 3), and so did Kirby Super Star for Super NES. But the majority of horizontally scrolling games for those systems just used a 512-pixel-wide map, which was laid out as two separate map segments just as it is on the GBA and Nintendo DS.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#66879 - gs2phateon - Sat Jan 14, 2006 2:07 am
So what's the final word? Is 512x256 any easier to use? I also have another question. Supposing I try to make a large scrolling map, do I have to refresh the tiles as well as the map coordinates every loop, or whenever I move the map?
#66880 - poslundc - Sat Jan 14, 2006 2:16 am
gs2phateon wrote: |
Is 512x256 any easier to use? |
No.
The main conceivable reason to use one would be to span the entire 256 pixel width on the DS. On the GBA they are only ever useful for a small subset of special purposes that don't include general-purpose scrolling.
Quote: |
I also have another question. Supposing I try to make a large scrolling map, do I have to refresh the tiles as well as the map coordinates every loop, or whenever I move the map? |
So long as you have enough VRAM, a text background can hold up to 1024 16-colour tiles. If you are able to stay within this limit, you won't have to refresh any tiles.
Dan.
#67140 - gs2phateon - Sun Jan 15, 2006 9:02 pm
Wow, I finally got it to work right! All I basically did was have it scroll pixel by pixel using the scroll register, and every time the number of pixels scrolled equals 8, the tiles move one in the direction scrolled, and the number of pixels equals zero again. Then it repeats until it reaches the boundary I set. It doesn't wrap around, but I don't really need it for what I'm making. Thanks for all your help poslundc!