gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Creating animation with Grit

#162633 - sixmind80 - Sat Sep 06, 2008 3:19 pm

Hi,

I've been following the patater tutorial on beginner's nds and i've been wanting to know how to first convert PNGs (in frames) to nds format using Grit and secondly how to apply that in the code( ie displaying the different frames ). if anyone could tell me how to do it or simply direct me to the howto for it, it'd be very appreciated.

thanks again

#162650 - silent_code - Sun Sep 07, 2008 11:00 am

There's been some talk on (sprite) animation, so just use the search function. You could try wingrit (or usenti) for exporting (and editing), too.

Note: It's important, that you store frames in a vertical layout in the sprite sheets.

Come back after searching the forum a bit (try for at least 20 min. - although you should get informative results in about 2 min.).
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.

#162652 - tepples - Sun Sep 07, 2008 1:11 pm

silent_code wrote:
Note: It's important, that you store frames in a vertical layout in the sprite sheets.

That's accurate for 1D mode. But in 2D mode, you might want to store the frames in a 256-pixel-wide (16-color) or 128-pixel-wide (256-color) sheet.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#162654 - sixmind80 - Sun Sep 07, 2008 3:04 pm

hi
thx for the suggestion. i did however search the forum before even registering an account and there were some threads about it but they were unanswered as well. more specifically, i was looking for what are the options to use with grit/wingrit. and i don't know, are they many different ways of doing this if using grit?

#162655 - sixmind80 - Sun Sep 07, 2008 3:08 pm

tepples wrote:
silent_code wrote:
Note: It's important, that you store frames in a vertical layout in the sprite sheets.

That's accurate for 1D mode. But in 2D mode, you might want to store the frames in a 256-pixel-wide (16-color) or 128-pixel-wide (256-color) sheet.


for 1D mode, 256 colors, each frame 64x64, do you just do:

-W3 -p -gt -gB8

#162715 - hacker013 - Wed Sep 10, 2008 3:33 pm

1D doesn't exists on the nds because:

1D = length
2D = length * width
3D = length * width * height
_________________
Website / Blog

Let the nds be with you.

#162716 - Cearn - Wed Sep 10, 2008 4:13 pm

1D or 2D here refers to which tiles are used for the tile-rows of an object. In 1D mode, all tiles are consecutive in memory; VRAM is used as an array of tiles. In 2D mode, VRAM is considered a matrix of tiles, and different tile-rows are at an offset.

Code:

Tile arrangement example:
 0  1  2  3 ... 31
32 33 34 35 ... 63
etc

In 1D mode, a 16x16 object uses tiles 0, 1, 2, 3; in 2D mode, it uses tiles 0, 1, 32, 33. See also tonc:obj-mapping.

By default, grit distributes the tiles as they appear in the bitmap (i.e., as a matrix), making it more suitable for 2D modes. However, you can also clump multiple tiles together with the metatiling options -Mw and -Mh. You can also achieve this by arranging bitmap as a column of animation frames instead of a row. In a columnar layout, 2D and 1D are effective identical, so no additional options are necessary.

For more details, go here.

#162884 - sixmind80 - Mon Sep 15, 2008 4:21 pm

Cearn wrote:
1D or 2D here refers to which tiles are used for the tile-rows of an object. In 1D mode, all tiles are consecutive in memory; VRAM is used as an array of tiles. In 2D mode, VRAM is considered a matrix of tiles, and different tile-rows are at an offset.

Code:

Tile arrangement example:
 0  1  2  3 ... 31
32 33 34 35 ... 63
etc

In 1D mode, a 16x16 object uses tiles 0, 1, 2, 3; in 2D mode, it uses tiles 0, 1, 32, 33. See also tonc:obj-mapping.

By default, grit distributes the tiles as they appear in the bitmap (i.e., as a matrix), making it more suitable for 2D modes. However, you can also clump multiple tiles together with the metatiling options -Mw and -Mh. You can also achieve this by arranging bitmap as a column of animation frames instead of a row. In a columnar layout, 2D and 1D are effective identical, so no additional options are necessary.

For more details, go here.


thanks i'll look at more on that metatiling thing as i'll be using a column-arranged frames.
Another question that i've been looking for is how you load up different frames of the sprite. can you show me an example? i've seen people using SPRITE_GFX directly( which i have no idea what's going on ), and the dmaCopyHalfWords(..) ( which i'm using from patater example ). if someone can show me an example of one of those or even each of the methods, that'll be really great.

thank you again