#113545 - AN_D_K - Thu Dec 28, 2006 8:47 pm
I have some artists asking me to program a DS demo for them. I'm currently working on the 2D tile part and have tiles working as long as they work on the 8x8 tiled screen.
However, the artists want to be awkward. They find 16x16 tiles too small, but 32x32 too big. I've stressed how the DS works but they want 21x21 tiles (well, 19x19 with a border).
Gah! Telling them "sod off and take your crazy ideas with you" isn't really an option.
I've accepted that the tiles must be power of two, but I was hoping there would be some way of being able to position a tile anywhere rather than attaching to the lowest 8.
Is there anyway to get around the 8x8 tile rule?
#113548 - OOPMan - Thu Dec 28, 2006 9:36 pm
Hmmmm, you could write your own manual tiling engine and store the tiles in main memory and output to them a BG. Of course, by doing so you negate most of the HW acceleration provided by the DS for things such as tiles...
If it's just for a demo, then this will probably be okay. If there's a plan to take things further though you probably will need to tell the artists to join the real world.
Have you considered using 32x32 tiles and padding the empty space with "invisble ink"?
_________________
"My boot, your face..." - Attributed to OOPMan, Emperor of Eroticon VI
You can find my NDS homebrew projects here...
#113549 - sirpoonga - Thu Dec 28, 2006 9:37 pm
You could make your own tile engine that draws on an 8bit background. However that might be slow.
That's an odd size, especially since the screen is 256x192. Round peg, square hole.
Odd number dimension don't work well in an even number system. Try centering a 21 pixel wide sprite on the screen...
The question that comes to my mind is if they are all tiles with borders are the tiles going to change?
#113550 - Sunray - Thu Dec 28, 2006 9:39 pm
I don't know much about the 2D modes, but with 3D (and orthographic projection) it should be as easy as power-of-two.
#113551 - Dwedit - Thu Dec 28, 2006 9:42 pm
On a GBA, you can use the scaling features to try to transform 24x24 tiles down to 19x19 tiles. I'm not sure if the hardware scaling can reliably transform 24x24 tiles down to 19x19, and have the exact same pixels omitted each time.
I suggest you find out what pixels get omitted when you transform 24x24 down to 19x19, and see if they are consistent or not. If they are, you can convert the 19x19 tiles up to 24x24 tiles for storage in VRAM, then let the hardware change them back down again. If 19x19 can not work try 18x18, or suggest 24x24.
Tepples wrote a demo which uses the scaling capabilities to turn 8x8 tiles into 6x8 tiles, and it looks like there is no distortion. (see http://www.pineight.com/gba/ bottom of page)
And no, tile sizes do not need to be powers of two, just multiples of 8.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."
#113553 - sajiimori - Thu Dec 28, 2006 9:53 pm
Scaling and using the 3D hardware are both good options.
If you go the scaling route, you'll want to preprocess 21x21 tiles to duplicate a row and column per char. You have to pick the right ones to duplicate so it'll look right -- that may require experimentation.
Edit: Oh, I guess you already said that, Dwedit. :)
#113562 - NeX - Thu Dec 28, 2006 11:17 pm
Tell them to comprimise at 24x24. It's close to 21x21 and fits the hardware.
#113578 - AN_D_K - Fri Dec 29, 2006 1:22 am
I thought about 24 but the reason 21x21 was chosen was because there would only be a 2 pixel border at each end. 24 means a stupidly large border which would negate the resize from 32.
You're right about just manually doing it myself. I'd rather just tell them to grow up. It's not too hard ...just pointless and annoying.
3D probably won't cut it. The rescale probably won't work.
What about using sprites ???
#113579 - Sausage Boy - Fri Dec 29, 2006 1:26 am
What's the problem with 3d, and scaling?
_________________
"no offense, but this is the gayest game ever"
#113583 - Lick - Fri Dec 29, 2006 1:45 am
You can use sprites. Just use 32x32 sprites and align them in a grid of 21x21. When loading the 21x21 graphics, just add 11 pixels to the right and at the bottom. This creates a border (actually, a corner) of transparent pixels so it doesn't overlap another sprite/tile.
If you run out of sprites [the hardware allows for 128], just reuse (search "hblank sprites") them.
Sausage Boy wrote: |
What's the problem with 3d, and scaling? |
The 3D hardware doesn't do filtering so perhaps entire rows/columns of the graphics is lost. This isn't a problem with general textures, but if the graphics are pixel art, then it matters.. BIG TIME!
_________________
http://licklick.wordpress.com
#113590 - sajiimori - Fri Dec 29, 2006 2:04 am
AN_D_K,
I wasn't suggesting that you manually edit every tile that the artists produce to make it 24x24. You would write a tool that duplicates a row and column per char so that a 24x24 tile will cleanly scale down to 21x21 with no dropout. This is an entirely workable solution, assuming you can spare the affine BG.
As for 3D, orthographic projections can be used to map world coordinates straight to pixels. Filtering is not an issue if all you want is a 1:1 mapping between texels and pixels.
Sprites could work, though you have to mess with HBlank, and you can't allocate as much VRAM to them, unless you can remap VRAM banks in the middle of VDraw, which is yet more gratuitous trickery.
At any rate, it's no use being afraid of a technique just because you think it might not work. Why doncha try it? ;)
#113595 - Lick - Fri Dec 29, 2006 2:11 am
After reading sajimori's post...
If you can get 3D to work at all, I would suggest loading the 21x21 into 32x32 textures (again, don't scale 'm but add transparent borders to the right and bottom). Then put quads (32x32) in a grid of 21x21 pixels.
I should really start experimenting with the 3D hardware. I'm stuck with 2D..
_________________
http://licklick.wordpress.com
#113597 - tepples - Fri Dec 29, 2006 2:19 am
AN_D_K wrote: |
I have some artists asking me to program a DS demo for them. I'm currently working on the 2D tile part and have tiles working as long as they work on the 8x8 tiled screen.
However, the artists want to be awkward. They find 16x16 tiles too small, but 32x32 too big. I've stressed how the DS works but they want 21x21 tiles (well, 19x19 with a border). |
Others have pointed out 24x24, which Kirby Super Star for Super NES uses. Is there a reason that the art department really needs the 19x19 with a border?
Quote: |
I've accepted that the tiles must be power of two, but I was hoping there would be some way of being able to position a tile anywhere rather than attaching to the lowest 8.
Is there anyway to get around the 8x8 tile rule? |
Yes. You can change the vertical by using hblank DMA to skip scanlines, and you can change the horizontal tile size to a multiple of 4 pixels by using two layers, one offset by four pixels. Both Puyo Pop (commercial GBA game) and Luminesweeper (homebrew GBA game) use these two techniques to make 12x12 pixel tiles. You could get 20x20 this way.
Or you could do it the Pengo way: make your entire playfield out of sprites. Commercial GBA games using this include Puzzle League (called Panel de Pon in Japan), Super Puzzle Fighter II, the Pac-Attack module of Pac-Man Collection, and quite a few WarioWare microgames. If you need more than 128, you can HDMA in new sprite display lists.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#113635 - Sunray - Fri Dec 29, 2006 11:17 am
If you go with 3D, make a tileset texture that contain many/all of your tiles. This texture can be 128x128 or 256x256 for example. An actual tile in this tileset can be any size, 21x21 is fine, no need for any scaling.
#113670 - AN_D_K - Fri Dec 29, 2006 4:30 pm
Thanks for the ideas and advice.
As I mentioned before, 21x21 tiles was chosen because it fits the screen best with not too large and obstructive borders (2 pixels either end) and a nice 12x10 grid. If I go up to 24x24 then I'm stuck with a border of 4 pixels at either end. Down to 16 and they are too small for what the artists want to do. The ideal thing would be to be able to kick them in the nuts and say "it's 32x32 or nothing. punks".
I guess it depends upon the artist demands of how much memory they want to fill up. For the sprites, is the limit of 128 sprites for 8x8 sprites? So 32 for 16x16?
The 3D method is winning. Make some quads and draw the textures from the same big image as the tiles. May just take a bit of experimenting from the ideas given to find the one that produces the best results.
If I did use a 3D tile then I should just be able to sample a 21x21 from the large texture and it will look spot on if the tile is scaled properly, right?
#113673 - FluBBa - Fri Dec 29, 2006 4:56 pm
How do you cram 10 21x21 tiles vertically in 192 pixels?
_________________
I probably suck, my not is a programmer.
#113674 - Lick - Fri Dec 29, 2006 4:59 pm
FluBBa wrote: |
How do you cram 10 21x21 tiles vertically in 192 pixels? |
With scrolling?
_________________
http://licklick.wordpress.com
#113675 - Lick - Fri Dec 29, 2006 5:00 pm
AN_D_K wrote: |
I guess it depends upon the artist demands of how much memory they want to fill up. For the sprites, is the limit of 128 sprites for 8x8 sprites? So 32 for 16x16? |
No, 128 sprites of all sizes.
Quote: |
If I did use a 3D tile then I should just be able to sample a 21x21 from the large texture and it will look spot on if the tile is scaled properly, right? |
Yes.
_________________
http://licklick.wordpress.com
#113676 - AN_D_K - Fri Dec 29, 2006 5:11 pm
You're right. It's 9 vertically! 3 pixels remainder ...so again, not too bad a border.
#113708 - tepples - Fri Dec 29, 2006 10:45 pm
AN_D_K wrote: |
As I mentioned before, 21x21 tiles was chosen because it fits the screen best with not too large and obstructive borders (2 pixels either end) and a nice 12x10 grid. |
Players don't really care much about borders at the edges of the visible playfield. Zoop for Super NES used a grid of 18x14 tiles 12x14 pixels in size, for 216x196 pixels out of 256x224.
Are you sure about your math? 12x10 tiles 21x21 in size is 252*210, which is bigger than the DS screen.
Quote: |
If I go up to 24x24 then I'm stuck with a border of 4 pixels at either end. Down to 16 and they are too small for what the artists want to do. The ideal thing would be to be able to kick them in the nuts and say "it's 32x32 or nothing. punks".
I guess it depends upon the artist demands of how much memory they want to fill up. For the sprites, is the limit of 128 sprites for 8x8 sprites? So 32 for 16x16? |
The limit is 128 sprites at any size.
Quote: |
The 3D method is winning. |
And DS-only, which limits your market.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.