Jump to content

Photo

CSets: Use and Transparency

cset csets transparent translucent transparency darkness shading shader shaders

  • Please log in to reply
4 replies to this topic

#1 ZoriaRPG

ZoriaRPG

    The Timelord

  • ZC Developers
  • Gender:Unspecified
  • Location:Prydon Academy

Posted 03 March 2020 - 05:12 AM

CSet    Behavior    Description    
0       Constant    Used for various GUI items such as status icons.    
1       Constant    Used for various GUI items such as status icons.    
2       Palette     Used for overworld and dungeon graphics such as trees,
                    walls, statues, etc.    
3       Palette     Used for overworld and dungeon graphics such as trees,
                    walls, statues, etc.
4       Palette     Used for overworld and dungeon graphics such as trees,
                    walls, statues, etc.
5       Constant    Used for overworld and dungeon graphics such as trees,
                    walls, statues, etc.    
6       Varies      Used for Link, the "Zelda" Guy and the "Merchant" Guy.    
                    Changes when you acquire some items.
7       Constant    Used for sprites, typically blue and red enemies.    
8       Constant    Used for sprites and the remaining Guy and enemies.    
9       Palette     Used for sprites whose colour depends on the level.    
10      Constant    Generally not used, but available for use by ZC to colour
                    various in-game visual items such as the player minimap
                    position indicator or the flashing compass/boss indicator
                    when the player has the compass.
                    (See: Quest > Graphics > Misc Colors).    
11      Constant    Generally not used, but available for use by ZC to colour
                    various in-game UI elements items such as the message text,
                    and other in-game UI elements.
                    (See:  Quest > Graphics > Misc Colors).
12      Constant    Not used by ZC. You can do whatever you want with this 

                    CSet.    
13      Varies      Used for Extra Sprite Palettes (ESPs).
                    The last enemy on a screen with an ESP loads its palette
                    to this CSet.
14      VGA/UI      Used for some GUI elements.
15      DVGA/UI     Used for the overall UI Theme (.ztheme).

 

 

TRANSPARENCY

When designing a palette, it is important to consider colours that ZC will blend to
generate translucent effects.

What occurs, is that allegro (the graphics library behind ZC) scans all of the colours
in your present palette, and for any admixture of two, it builds a set of colour blends,
based on the closest colour available in the palette that those two colours produce.

Thus, if you have a palette of all yellow and blue, no transparency effect can create green.
You need some green colours in the current palette for the blending routines to say y+b==g

If you want dark blues, dark greys and so forth, you need to provide some colours in he
palette for Allegro to use as substitutions for normal palette colours when you use
translucent effects.

Thus, it is critical that you reserve space in CSets for some shaded colours, if you want
this to be visually pleasing.

There are 32 colours reserved by e system for UI stuff (CSets 14 and 15; 0xE and 0xF).

These are VGA and DVGA (dark VGA), representing a standard se of VGA colours for UI
elements. As of 2.53.1, the user can edit CSet 0xF, as these colours are used for the theme
for ZQuest and ZC Player.

That technically makes these available to allegro for trans tables, but as these are all
theme-dependent, you can't rely on them  for creating these effects

CSet 13 is used for extended sprite palettes, and thus loaded in depending on the enemies
on-screen, and likewise is unreliable for translucent effects.

You want to add shading colours to either constant CSets, or CSets that are based on level:

CSets 0, 1, 5, 7, 8, 10, 11 and 12 are all constant. Place colours that you want for
universal shading into these CSets.

CSets 2, 3, and 4 are loaded by level. Use them for shading colours that you want to use in
specific levels.

CSet 6 is used to draw the player sprite:
Some colours in it swap out depending on items obtained (e.g. red ring), so it is best to avoid it.

CSet 9 is used for enemies with a CSet that changes based on the current level palette.
Thus, this is also not a prudent candidate for translucent colour effects, but it is usable
if needed.

As long as you design your palette around these expectations, you can accomplish very solid effects
with transparent overlays, but you need to create a 'light' and a 'dark' colour for your overworld
and dungeon graphics.

A basic template for CSets might be:

 
 
0x0 Transparent

0x1 Base 1
0x2 Base 2
0x3 Base 3
0x4 Base 4
0x5 Base 5
0x6 Highlight 1
0x7 Highlight 2

0x8 Dark 1
0x9 Dark 2
0xA Dark 3
0xB Dark 4
0xC Dark 5
0xD Dark Highlight 1
0xE Dark Highlight 2

0xF Black

 

 

Another Option

Four main colours, with a normal, a light, and a dark 'shade' per each.

This gives you a solid amount of flexibility.

e.g. Green, Brown, Yellow, Blue

 

0x0 Transparent

0x1 Base 1 Normal
0x2 Base 2 Normal
0x3 Base 3 Normal
0x4 Base 4 Normal
0x5 Base 1 Dark
0x6 Base 2
Dark
0x7 Base 3 Dark

0x8 Base 4 Dark
0x9 Base 1 Light
0xA Base 2 Light
0xB Base 3 Light
0xC Base 4 Light
0xD Highlight 1
0xE Highlight 2

0xF Black


  • ShadowTiger, Jared and Aquamentus (Facing Right) like this

#2 Peteo

Peteo

    Back in Business!

  • Members
  • Real Name:Pete
  • Gender:Male
  • Location:Finland

Posted 03 March 2020 - 12:08 PM

Let's see if I understood this correctly at all.

 

For example, I have some blue water on screen and I use a black translucent layer on top of everything to get that nice dark effect going. Now ZC will look for darker versions of the blue on screen from all the CSets, right? It doesn't matter where the dark blue colors are, as long as they're somewhere in CSet 0-15 that ZC can access at that moment, correct? Is it that simple?

 

I've never paid attention in my quests how translucency works and I've always been satisfied with the translucency effects, hehe. And my quests are really graphics heavy too.  :)


Edited by Peteo, 03 March 2020 - 12:09 PM.


#3 ZoriaRPG

ZoriaRPG

    The Timelord

  • ZC Developers
  • Gender:Unspecified
  • Location:Prydon Academy

Posted 05 March 2020 - 04:49 AM

Let's see if I understood this correctly at all.

 

For example, I have some blue water on screen and I use a black translucent layer on top of everything to get that nice dark effect going. Now ZC will look for darker versions of the blue on screen from all the CSets, right? It doesn't matter where the dark blue colors are, as long as they're somewhere in CSet 0-15 that ZC can access at that moment, correct? Is it that simple?

 

I've never paid attention in my quests how translucency works and I've always been satisfied with the translucency effects, hehe. And my quests are really graphics heavy too.  :)

 

Aye, it tries to find the 'best' match in your full current palette. Thus, if you change DMaps and that change loads different colours to the Level Palette CSets, it will use the colours available based on that.

 

You can put blended colours into those csets -- I advise this if you wouldn't use them anywhere else. Again, see my suggested style guide per cset. Another option:

 

0x0 Transparent

0x1 Base 1 Normal
0x2 Base 2 Normal
0x3 Base 3 Normal
0x4 Base 4 Normal
0x5 Base 1 Dark
0x6 Base 2
Dark
0x7 Base 3 Dark

0x8 Base 4 Dark
0x9 Base 1 Light
0xA Base 2 Light
0xB Base 3 Light
0xC Base 4 Light
0xD Highlight 1
0xE Highlight 2

0xF Black


  • Peteo likes this

#4 P-Tux7

P-Tux7

    Illustrious

  • Members

Posted 05 March 2020 - 07:55 PM

Aye, it tries to find the 'best' match in your full current palette. Thus, if you change DMaps and that change loads different colours to the Level Palette CSets, it will use the colours available based on that.

 

You can put blended colours into those csets -- I advise this if you wouldn't use them anywhere else. Again, see my suggested style guide per cset. Another option:

 

0x0 Transparent

0x1 Base 1 Normal
0x2 Base 2 Normal
0x3 Base 3 Normal
0x4 Base 4 Normal
0x5 Base 1 Dark
0x6 Base 2
Dark
0x7 Base 3 Dark

0x8 Base 4 Dark
0x9 Base 1 Light
0xA Base 2 Light
0xB Base 3 Light
0xC Base 4 Light
0xD Highlight 1
0xE Highlight 2

0xF Black

An option for 8-bit importing to only color-match to the constant CSets (0, 1, 5, 7, 8, 10, 11) would be appreciated.



#5 ZoriaRPG

ZoriaRPG

    The Timelord

  • ZC Developers
  • Gender:Unspecified
  • Location:Prydon Academy

Posted 08 March 2020 - 10:08 AM

An option for 8-bit importing to only color-match to the constant CSets (0, 1, 5, 7, 8, 10, 11) would be appreciated.

 

eeeeeh.... Loading an all black level palette would accomplish that, for now.





Also tagged with one or more of these keywords: cset, csets, transparent, translucent, transparency, darkness, shading, shader, shaders

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users