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

Localized all links
No edit summary
(Localized all links)
Line 22: Line 22:
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 [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).
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).


==Making your first sprites in 256 colours==
==Making your first sprites in 256 colours==
Line 39: Line 39:
[[Image:8bittut_initpal.png]]
[[Image:8bittut_initpal.png]]


You can now start setting some of the colours, starting from the ''first editable one'' (ie. slot #17, or #42 if you want to keep the original colours set by the AGS editor), to colours that you think will be commonly used by your sprites, then you may start drawing your sprites, adding more colours to the palette in the process, if needed. For example, I come up with [http://www.2dadventure.com/ags/8bittut_ss0.pcx this] which contains the following sprite:
You can now start setting some of the colours, starting from the ''first editable one'' (ie. slot #17, or #42 if you want to keep the original colours set by the AGS editor), to colours that you think will be commonly used by your sprites, then you may start drawing your sprites, adding more colours to the palette in the process, if needed. For example, I come up with [[media:8bittut_ss0.pcx|this]] which contains the following sprite:


[[Image:8bittut_sprite0.png]]
[[Image:8bittut_sprite0.png]]
Line 60: Line 60:
'''Note: With AGS V2.6SP1 and earlier, the editor cannot remember some of these settings well, so if you import another sprite later, you should double-check to make sure that the settings are correct before importing. This was fixed in later versions of the editor.'''
'''Note: With AGS V2.6SP1 and earlier, the editor cannot remember some of these settings well, so if you import another sprite later, you should double-check to make sure that the settings are correct before importing. This was fixed in later versions of the editor.'''


Now I draw another sprite on the [http://www.2dadventure.com/ags/8bittut_ss1.pcx same image file], adding the following sprite:
Now I draw another sprite on the [[media:8bittut_ss1.pcx|same image file]], adding the following sprite:


[[Image:8bittut_sprite1.png]]
[[Image:8bittut_sprite1.png]]
Line 76: Line 76:


==Making your first backgrounds in 256 colours==
==Making your first backgrounds in 256 colours==
Having done some sprites I think it's now time for me to make some backgrounds. First I make [http://www.2dadventure.com/ags/8bittut_dizzy.pcx this background], you may check out that its palette is like:
Having done some sprites I think it's now time for me to make some backgrounds. First I make [[media:8bittut_dizzy.pcx|this background]], you may check out that its palette is like:


[[Image:8bittut_dizzypal.png]]
[[Image:8bittut_dizzypal.png]]
Line 91: Line 91:
I had added the two imported sprites as objects to check if things went smoothly, note that the girl's sprite was imported perfectly as her antenna are intact and are not "eaten" by the dark transparent colour during import. This is one importance of using exact palette import.
I had added the two imported sprites as objects to check if things went smoothly, note that the girl's sprite was imported perfectly as her antenna are intact and are not "eaten" by the dark transparent colour during import. This is one importance of using exact palette import.


I am happy, so I draw [http://www.2dadventure.com/ags/8bittut_disco.pcx one more background], this time the palette is like:
I am happy, so I draw [[media:8bittut_disco.pcx|one more background]], this time the palette is like:


[[Image:8bittut_discopal.png]]
[[Image:8bittut_discopal.png]]
Line 99: Line 99:
Next I import the background with exact palette blah bla... (like before) as the background of another room, you may also check out the slots in the "'''Palette Editor'''" like before to see if the import was successful. (Don't forget to set these slots back to "'''room-dependent'''" after checking!)
Next I import the background with exact palette blah bla... (like before) as the background of another room, you may also check out the slots in the "'''Palette Editor'''" like before to see if the import was successful. (Don't forget to set these slots back to "'''room-dependent'''" after checking!)


Next, I think it may be a good idea to add a door to the disco room, so I want to draw a sprite for it, but I want it to blend with the background perfectly, and since that sprite will only be used in one room, it doesn't seem like a good idea to waste "'''fixed'''" sprite colour slots by copying some of the colours from the background. What should I do? I just draw [http://www.2dadventure.com/ags/8bittut_door.pcx this], which used the "'''room-dependent'''" colour slots directly. You may have asked, "aren't these slots '''ONLY''' for backgrounds?" The answer is, "Yes, and No. These slots can be used for backgrounds, you ''can'' actually use them in sprites too, provided that sprite is ''only'' used in ''that'' room or other room ''using similar colour settings'', otherwise it may look funny."
Next, I think it may be a good idea to add a door to the disco room, so I want to draw a sprite for it, but I want it to blend with the background perfectly, and since that sprite will only be used in one room, it doesn't seem like a good idea to waste "'''fixed'''" sprite colour slots by copying some of the colours from the background. What should I do? I just draw [[media:8bittut_door.pcx|this]], which used the "'''room-dependent'''" colour slots directly. You may have asked, "aren't these slots '''ONLY''' for backgrounds?" The answer is, "Yes, and No. These slots can be used for backgrounds, you ''can'' actually use them in sprites too, provided that sprite is ''only'' used in ''that'' room or other room ''using similar colour settings'', otherwise it may look funny."


To import this door sprite, go to the "'''Sprite manager'''" and open up the import dialog, make sure you have ''un''checked "'''Remap colours to game palette'''" and select "'''Colour index 0'''" as transparent, ''AND'' '''check''' the "'''Lock sprite to current room (use room colours)'''" box, you can then import the sprite like before.
To import this door sprite, go to the "'''Sprite manager'''" and open up the import dialog, make sure you have ''un''checked "'''Remap colours to game palette'''" and select "'''Colour index 0'''" as transparent, ''AND'' '''check''' the "'''Lock sprite to current room (use room colours)'''" box, you can then import the sprite like before.
Line 112: Line 112:
I think this tutorial is long enough to keep you awake, and it's only about basic stuffs, I think it's about done for this part already, but before I stop I'll give you a present, which is how the materials put together into an AGS "game" would be like:
I think this tutorial is long enough to keep you awake, and it's only about basic stuffs, I think it's about done for this part already, but before I stop I'll give you a present, which is how the materials put together into an AGS "game" would be like:


[http://www.2dadventure.com/ags/8bittut_paltut1.zip Download this file]
[[media:8bittut_paltut1.zip|Download this file]]


To test it just unzip it into an empty folder and load up '''ac2game.dta''' via the AGS editor and ''save'' a game. ('''room1.crm''' is the "dizzy" room, where you can click to transport you to '''room2.crm''', which is the "disco" room, you can click on the door(way) to toggle between opening and closing of the door, which shows you how the door sprite matches perfectly with the background, if you're having enough "fun" just press '''ctrl-Q''' to quit.)  
To test it just unzip it into an empty folder and load up '''ac2game.dta''' via the AGS editor and ''save'' a game. ('''room1.crm''' is the "dizzy" room, where you can click to transport you to '''room2.crm''', which is the "disco" room, you can click on the door(way) to toggle between opening and closing of the door, which shows you how the door sprite matches perfectly with the background, if you're having enough "fun" just press '''ctrl-Q''' to quit.)