Jump to content

Photo

CSets: Use and Transparency

cset csets transparent translucent transparency darkness shading shader shaders

  • Please log in to reply
8 replies to this topic

#1 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 03 March 2020 - 06: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
  • Location:Finland

Posted 03 March 2020 - 01: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 - 01:09 PM.


#3 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 05 March 2020 - 05: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

    💛

  • Members

Posted 05 March 2020 - 08: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 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 08 March 2020 - 11: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.



#6 Riflezen

Riflezen

    sometimes does stuff

  • Members
  • Real Name:Gus
  • Location:in the trees

Posted 31 March 2021 - 12:15 PM

Sorry for gravedigging, but are there any reasons why you shouldn't use a CSet for something other than what it was intended for, like using CSet 5/15 for enemies or CSet 7/8/11 on the overworld?



#7 Mitchfork

Mitchfork

    no fun. not ever.

  • Members
  • Real Name:Mitch
  • Location:Alabama

Posted 31 March 2021 - 12:38 PM

There is nothing hard-forcing you to follow the guidelines entirely. But there are a couple of things to note:

CSets 2, 3, 4, and 9 are the only CSets that are able to change during the game with the current level palette. This is what makes them suitable for normal overworld/dungeon graphics - you don't have to permanently use up colors in your palette to have a red dungeon vs. a blue dungeon, for instance.

CSet 6 changes when you get Rings to alter Link's palette. This means using it for other graphics isn't super recommended since they will also change.

Enemies flash through CSet 9, 8, 7, and 6 when they get hit. If the layout of these differs too much from what the enemy's normal CSet is, it'll look really funky when they're hurt.

Several default UI things use CSets 0 and 1. For instance, the regular Save/Continue menu and default subscreens use fixed colors in here. Some of these can be changed but you may not want to bother with it.
  • Riflezen likes this

#8 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 31 March 2021 - 03:05 PM

Regarding using CSet 15, since you mentioned that specifically Riflezen, yes, there is good reason not to use that one. CSets 13-15 cannot be safely used. They're used for storing colors such as alternate boss palettes or UI colors, and thus can change erratically. While Zoria's post here says 12 can be used, I've seen it change under some circumstances and suspect there is more to it than meets the eye; for now, I would consider 0-11 to be the "safe" CSets.


  • Riflezen likes this

#9 Orithan

Orithan

    Studying Scientist - Commission from Silvixen

  • Members
  • Location:Australia

Posted 01 April 2021 - 12:40 AM

CSet 12 is unused in ZC but it is used in ZQ for the colours shown on the Map pane section of the Main Panel in the Main Editor. You can do whatever you want with it but be aware that the colours will not necessarily show up correclty in ZQ.


Edited by Orithan, 01 April 2021 - 12:41 AM.

  • Riflezen likes this



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