256 Colour Tutorial Part 1(V2.62): Difference between revisions

Line 12: Line 12:
When you start a new game in the AGS editor, by default, it will be a 256 colour one (unless you have it changed by clicking the "'''Change game colour depth'''" button in the '''Palette editor'''). Now go to the '''Palette''' editor, you'll see the default set of palette colours:
When you start a new game in the AGS editor, by default, it will be a 256 colour one (unless you have it changed by clicking the "'''Change game colour depth'''" button in the '''Palette editor'''). Now go to the '''Palette''' editor, you'll see the default set of palette colours:


[Image:8bittut_basepal.png]
[[Image:8bittut_basepal.png]]


There are a total of '''256''' usable colour slots (slot #0 through slot #255), you may also notice that there is a letter "'''L'''" on each of the first 17 colour slots (slot #0 through #16), it means that these slots are "''locked''" by the editor, so you should ''leave them unchanged through-out the whole game'' (actually you ''can'' change their values in-game, but this is not advisable, as they're mainly used for system graphics/messages/etc., moreover, without messing with them, you still have full control of 239 colours). Slot #17 through slot #41 are assigned as ''sprite colours'' by default, you can just leave them alone, or if you don't like them, you can change them to suit your needs. The remaining 214 colours (slot #42 through #255) are "'''room dependent'''" by default, so their values can be different in different rooms (mainly used for room backgrounds), as shown by the big "'''X'''" on each of these slots.
There are a total of '''256''' usable colour slots (slot #0 through slot #255), you may also notice that there is a letter "'''L'''" on each of the first 17 colour slots (slot #0 through #16), it means that these slots are "''locked''" by the editor, so you should ''leave them unchanged through-out the whole game'' (actually you ''can'' change their values in-game, but this is not advisable, as they're mainly used for system graphics/messages/etc., moreover, without messing with them, you still have full control of 239 colours). Slot #17 through slot #41 are assigned as ''sprite colours'' by default, you can just leave them alone, or if you don't like them, you can change them to suit your needs. The remaining 214 colours (slot #42 through #255) are "'''room dependent'''" by default, so their values can be different in different rooms (mainly used for room backgrounds), as shown by the big "'''X'''" on each of these slots.


Now, click on one of the colour slots, if it's not a "'''room dependent'''" colour, you'll see some (<font color="FF0000>R</font>, <font color="00FF00">G</font>, <font color="0000FF">B</font>) values on the upper-right corner of the '''Palette editor''', this order-tuple of values determines how the colour of that particular slot will be like in the game. If the colour you clicked is ''not'' a "'''locked'''" one there'll be three (3) adjustable sliders, with which you can adjust each of the <font color="FF0000>(R)ed</font>, <font color="00FF00">(G)reen</font> and <font color="0000FF">(B)lue</font> channel values for that slot. Under standard VGA/MCGA palette, each channel can have '''64''' levels of different intensities, running from 0 (zero intensity) to 63 (full intensity). For example, (0,0,0) is <font color="000000>black</font>, (63,0,0) is <font color="FF0000>red</font>, whereas (63,63,63) is <span style="background-color:#999;"><font color="#FFFFFF">white</font></span>. Now, try dragging the sliders and watch the colour changes, hope you'll get a hang on how things work now.
Now, click on one of the colour slots, if it's not a "'''room dependent'''" colour, you'll see some (<font color="FF0000">R</font>, <font color="00FF00">G</font>, <font color="0000FF">B</font>) values on the upper-right corner of the '''Palette editor''', this order-tuple of values determines how the colour of that particular slot will be like in the game. If the colour you clicked is ''not'' a "'''locked'''" one there'll be three (3) adjustable sliders, with which you can adjust each of the <font color="FF0000">(R)ed</font>, <font color="00FF00">(G)reen</font> and <font color="0000FF">(B)lue</font> channel values for that slot. Under standard VGA/MCGA palette, each channel can have '''64''' levels of different intensities, running from 0 (zero intensity) to 63 (full intensity). For example, (0,0,0) is <font color="000000">black</font>, (63,0,0) is <font color="FF0000">red</font>, whereas (63,63,63) is <span style="background-color:#999;"><font color="#FFFFFF">white</font></span>. Now, try dragging the sliders and watch the colour changes, hope you'll get a hang on how things work now.
 
'''<u>Note</u>: Depending on the graphics packages you use, the channel ranges may be expressed differently. For example, in Deluxe Paint ][ Enhanced, each of the channels' intensity ranges from 0 to 100, and in some of the more "modern" programmes like Grafix 2 the range is probably from 0 to 255. Nonetheless, when imported into the AGS editor, they will be hashed to the standard 64 level intensity anyway.'''
'''<u>Note</u>: Depending on the graphics packages you use, the channel ranges may be expressed differently. For example, in Deluxe Paint ][ Enhanced, each of the channels' intensity ranges from 0 to 100, and in some of the more "modern" programmes like Grafix 2 the range is probably from 0 to 255. Nonetheless, when imported into the AGS editor, they will be hashed to the standard 64 level intensity anyway.'''


After having fun messing with the colours, it's a nice idea to quit the editor to discard of the nasty random colour tests you made and restart it, and it's now time for the ''important part'' - to make the decision on the general usage of the slots - how many slots should be "fixed" so they'll be "''unchanged''" (words like "''fixed''" and "''unchanged''" are relative terms in my tutorials, you will find out why later...) through-out the whole game, and how many of them should be set "'''room dependent'''" so they can be different in different rooms. I suggest that you divide the palette into 2 parts - the '''first part''' and the '''second part''', while the first part is for the "'''fixed'''" colours, the second part is for the "'''room dependent'''" colours, and don't let them scattered around for the sake of better organisation. Now there're 256 colour slots in total, you may decide how many colours should be assigned as "'''fixed'''" (mainly for sprites) and use the rest as "'''room dependent'''" (mainly for room backgrounds). If for example, you want your sprites to look more cartoony and don't need much variations on their colours you may assign less colour slots to them (thus you can have more colours for backgrounds), on the other hand, if you need more colours for sprites you may assign more slots to them (the drawback is that you may have less free colours for room backgrounds now). If you cannot make up your mind I suggest you divide the palette into equal halves, that is, to use the first half (#0 to #127) for sprites and the second half (#128 to #255) for backgrounds, and if you do things right you can still change the assignment halfway through the production process if needed.
After having fun messing with the colours, it's a nice idea to quit the editor to discard of the nasty random colour tests you made and restart it, and it's now time for the ''important part'' - to make the decision on the general usage of the slots - how many slots should be "fixed" so they'll be "''unchanged''" (words like "''fixed''" and "''unchanged''" are relative terms in my tutorials, you will find out why later...) through-out the whole game, and how many of them should be set "'''room dependent'''" so they can be different in different rooms. I suggest that you divide the palette into 2 parts - the '''first part''' and the '''second part''', while the first part is for the "'''fixed'''" colours, the second part is for the "'''room dependent'''" colours, and don't let them scattered around for the sake of better organisation. Now there're 256 colour slots in total, you may decide how many colours should be assigned as "'''fixed'''" (mainly for sprites) and use the rest as "'''room dependent'''" (mainly for room backgrounds). If for example, you want your sprites to look more cartoony and don't need much variations on their colours you may assign less colour slots to them (thus you can have more colours for backgrounds), on the other hand, if you need more colours for sprites you may assign more slots to them (the drawback is that you may have less free colours for room backgrounds now). If you cannot make up your mind I suggest you divide the palette into equal halves, that is, to use the first half (#0 to #127) for sprites and the second half (#128 to #255) for backgrounds, and if you do things right you can still change the assignment halfway through the production process if needed.


Now, '''DON'T CHANGE ANYTHING IN THE PALETTE EDITOR''', this is not (yet) required in this stage. Click the "'''Export palette to file...'''" button, name the file and save it as '''.PCX''' format, like [[media:8bittut_basepal.pcx|this]]. ''DON'T'' bother using the '''.PAL''' format, as ''most'' graphics packages can load '''.PCX''' files already and '''.PAL''' is an ambiguous file extension that different graphics programmes may interpret the format differently. Even if your favourite graphics package cannot load '''.PCX''' files, you can use free conversion tools (e.g. [http://www.irfanview.com Irfan View]) which won't ''change the colours or mess with the palette slot orders during conversions'', this is '''VERY''' important if you take it serious and really want to use the 8-bit palette effects to the max. You can keep a copy of the saved file in a safe place for your convenience, in case you'll start another 256-colour project later (or just download the file linked above).
Now, '''DON'T CHANGE ANYTHING IN THE PALETTE EDITOR''', this is not (yet) required in this stage. Click the "'''Export palette to file...'''" button, name the file and save it as '''.PCX''' format, like [http://www.2dadventure.com/ags/8bittut_basepal.pcx this]]. ''DON'T'' bother using the '''.PAL''' format, as ''most'' graphics packages can load '''.PCX''' files already and '''.PAL''' is an ambiguous file extension that different graphics programmes may interpret the format differently. Even if your favourite graphics package cannot load '''.PCX''' files, you can use free conversion tools (e.g. [http://www.irfanview.com Irfan View]) which won't ''change the colours or mess with the palette slot orders during conversions'', this is '''VERY''' important if you take it serious and really want to use the 8-bit palette effects to the max. You can keep a copy of the saved file in a safe place for your convenience, in case you'll start another 256-colour project later (or just download the file linked above).


==Making your first sprites in 256 colours==
==Making your first sprites in 256 colours==