#168476 - renatobs - Thu Apr 30, 2009 2:49 am
Hi! I?d like to know if have some way to do fade and alpha blending for each tile in background mode 5 ?? I?d like to change the brightness of some tiles, but I don?t know how... I need to do a effect on the background similar the used in the game "shining force" ( sega genesis ) that limite the zone you can move with a character. I already did it, but with another background, using a tile of 1 color and change the blend of the background. But in the future I?ll need of this background tha now I?m using to do only "zone blending".
Last edited by renatobs on Fri May 01, 2009 1:52 am; edited 1 time in total
#168479 - DiscoStew - Thu Apr 30, 2009 4:13 am
How about having alternate "dimmed" palette entries? I'm pretty sure that's how Shining Force did the effect.
_________________
DS - It's all about DiscoStew
#168493 - renatobs - Fri May 01, 2009 1:39 am
I?m not sure about it !
I guess that it?s something totaly diferent. How is possible change the color "only" of some tiles in the background ? There?s no special tile attribute to do this ?
#168494 - DiscoStew - Fri May 01, 2009 2:15 am
I haven't touched anything involving the DS's ability to deal with backgrounds, but I'm pretty sure that with the exclusion of extended backgrounds, the format is pretty much the same as with the GBA.
A Text background under the 4-bit color palette mode is capable of producing this effect, because each tile has a 4-bit entry in it that decides what palette out of 16 possible palettes it can use. With that, you can alter that attribute to use a palette that is designed to be a "dimmed" version of the regular palette that the tile had used. Say if your background uses 8 4-bit (16 color) palettes, you can duplicate those 8 to fill in the other half of the possibly usable palettes, but dim the colors for each. Then, when you can determine if a tile is to have this particular effect, you just change the palette index to the correct one.
If you are not using the 4-bit color mode, or using an affine background, you won't be able to do this. Having a Text BG under 256-colors does not use the palette attribute, and the Affine BGs are 8-bit entries for just tiles alone with no flip/mirror and palette attributes. I'm not sure what the extended BGs are capable of, so someone else can give information pertaining to them.
_________________
DS - It's all about DiscoStew
#168496 - headspin - Fri May 01, 2009 6:12 am
#168506 - renatobs - Sat May 02, 2009 12:19 am
OK. I thanks the answers, but what I want to do is control each severally tile !!! I didn?t understand if I can do it with "extended palette '... how could I change the palette for one tile only ? Maybe if someone here could see a video ( youtube ) of battle in Shining Force, will understand. The effect is similar a "fade in/out", from white to black and vice-versa, but only about some tiles to determinated the area you can walk. I already did it, but using one background, with many tiles, 4 x 4 tiles ( 32 x 32 pixels ), side by side, and doing blending in this background. The problem is that I?m spending one backgroung to do this. Probably, I?ll need this background in the future. In the remake "Shining Force" to GBA, THQ did the same I?m doing now, they used a background, but I need change this.
Thanks.
PS.: sorry for my english and sorry again if you?re telling me how to do what I need but maybe I?m not understanding...
#168509 - TwentySeven - Sat May 02, 2009 1:12 am
Read this:
http://dev-scene.com/NDS/Tutorials_Day_4
Especially take note of the part titled "Map Entries"
When you use a extended BG, you use 16 bits to define each map entry.
The uppper X bits are used to define which palette you use - those palettes need to be set up and assigned a BG though. Search for using extended palettes.
#168510 - headspin - Sat May 02, 2009 1:14 am
#168515 - DiscoStew - Sat May 02, 2009 4:27 am
renatobs wrote: |
OK. I thanks the answers, but what I want to do is control each severally tile !!! I didn?t understand if I can do it with "extended palette '... how could I change the palette for one tile only ? Maybe if someone here could see a video ( youtube ) of battle in Shining Force, will understand. The effect is similar a "fade in/out", from white to black and vice-versa, but only about some tiles to determinated the area you can walk. I already did it, but using one background, with many tiles, 4 x 4 tiles ( 32 x 32 pixels ), side by side, and doing blending in this background. The problem is that I?m spending one backgroung to do this. Probably, I?ll need this background in the future. In the remake "Shining Force" to GBA, THQ did the same I?m doing now, they used a background, but I need change this.
Thanks.
PS.: sorry for my english and sorry again if you?re telling me how to do what I need but maybe I?m not understanding... |
Kind of like a "glowing" effect? It's simple once you've got the background set up to work with entries per tile so you can assign a palette to each tile. Once you get that working, you can then alter the palette itself to whatever effect you want, "glowing" included.
_________________
DS - It's all about DiscoStew
#168532 - renatobs - Sat May 02, 2009 11:42 pm
Ooohhh... now I?m getting the ideia... I didn?t know about this... thanks... I?ll study about this and see what I can to do...
But, if it doesn?t disturb, could some one here give a code example ? My current background and sub_backgroun are in MODE_0_2D, each with 4 BG?s, 256 colors. I used pcx2gba to make a C arrays ( palette and data, 16bit ) of the tiles and I?m using TILE STUDIO to do the maps. This give me a 16bit map array. For now it?s everything ok. How can I enable extended paletes and control this in the tiles ? Could both of screens ( main and sub ) use the extended palette ?
As more ideias you can put here, more soon I?ll understand and continue working hard with the game !!!
Thanks so much for while !!!!
#168533 - headspin - Sun May 03, 2009 5:11 am
I already gave you links that explain how to use extended palettes and the bits to set in a map entry for palette number.
http://www.liranuna.com/nds-2d-tuts/lesson-5/
http://nocash.emubase.de/gbatek.htm#lcdvrambgscreendataformatbgmap
For converting graphics why are you using pcx2gba and not grit? Have you looked at the examples included with devkitPro?
_________________
Warhawk DS | Manic Miner: The Lost Levels | The Detective Game
#168537 - sverx - Mon May 04, 2009 11:59 am
renatobs wrote: |
How can I enable extended paletes and control this in the tiles ? Could both of screens ( main and sub ) use the extended palette ? |
Code: |
videoSetMode (MODE_0_2D | DISPLAY_BG0_ACTIVE | DISPLAY_BG1_ACTIVE | DISPLAY_BG2_ACTIVE | DISPLAY_BG3_ACTIVE | DISPLAY_BG_EXT_PALETTE ); |
... or videoSetModeSub() for subengine.
Then when assigning a tile in the map just remember to specify a palette, like this:
Code: |
final_tile = (tile & 0x3FF) | (palette << 12); |
?