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

Jump to navigation Jump to search
m
Line 37: Line 37:
# You may have noticed that colour #0 is black by default, but now I am telling you, that you ''should'' change the colour of this entry to something else (even if it belongs to a "'''locked'''" colour, I will explain later), I usually change it to <font color="FF00FF">pink</font> (by dragging both of the <font color="FF0000">R</font> and <font color="0000FF">B</font> sliders to full intensity) which is the default transparent colour used in many programmes, if you want to use this <font color="FF00FF">pink</font> colour (or some other colours close enough to it) in you game's graphics, you may change the colour of this slot to some other colour that will clash less with your in-game graphics. After the changes the palette should look like this:
# You may have noticed that colour #0 is black by default, but now I am telling you, that you ''should'' change the colour of this entry to something else (even if it belongs to a "'''locked'''" colour, I will explain later), I usually change it to <font color="FF00FF">pink</font> (by dragging both of the <font color="FF0000">R</font> and <font color="0000FF">B</font> sliders to full intensity) which is the default transparent colour used in many programmes, if you want to use this <font color="FF00FF">pink</font> colour (or some other colours close enough to it) in you game's graphics, you may change the colour of this slot to some other colour that will clash less with your in-game graphics. After the changes the palette should look like this:


[[Image:8bittut_initpal.png]]
[[Image:8bittut_initpal.png|center|Initial palette]]


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:
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|center|68px|Girl sprite]]


and the palette is currently set up like this:
and the palette is currently set up like this:


[[Image:8bittut_ss0pal.png]]
[[Image:8bittut_ss0pal.png|center|Girl sprite palette]]


You'll see that before drawing this first sprite, ''I thought'' that shades of skin colour, red and blue might be quite frequently used in my sprites, so I first set up slots #17 to #31 to contain these colours (the second row), even though some of the slots were still not used for painting my first sprite, they may still be used later in some other sprites, so don't be afraid that they'd be wasted at the time being. When I was drawing a sprite I add more colours to the palette when needed (see the third row of colours). Note that when I needed the black colour I used slot #16 (like in her antenna and eyes), whereas when I needed transparent colour I used slot #0, as shown by the surrounding pink colour, that's the reason I changed slot #0 to some other colour - so it won't clash with the black colour in case I need to use it in my sprites. Note also that I put a white rectangle surrounding the sprite, it will certainly help when it is to be imported into an AGS game.
You'll see that before drawing this first sprite, ''I thought'' that shades of skin colour, red and blue might be quite frequently used in my sprites, so I first set up slots #17 to #31 to contain these colours (the second row), even though some of the slots were still not used for painting my first sprite, they may still be used later in some other sprites, so don't be afraid that they'd be wasted at the time being. When I was drawing a sprite I add more colours to the palette when needed (see the third row of colours). Note that when I needed the black colour I used slot #16 (like in her antenna and eyes), whereas when I needed transparent colour I used slot #0, as shown by the surrounding pink colour, that's the reason I changed slot #0 to some other colour - so it won't clash with the black colour in case I need to use it in my sprites. Note also that I put a white rectangle surrounding the sprite, it will certainly help when it is to be imported into an AGS game.
Next I may continue to draw more sprites, but as I am so excited I really want to see it imported into my game. Go to "'''palette editor'''" of the AGS editor, check the range of colours to import as ''sprite colours'', in my case it's slot #17 through #37, so I first click slot #17, ''HOLD'' the '''SHIFT''' key and click slot #37, so that the desired range is selected, make sure that the "'''This colour is room-dependent'''" checkbox is ''UNCHECKED'' and click the "'''Import slots from file...'''" button, now we just need to choose the image file containing the sprite (if it already is in '''.PCX''' format, if not, convert it to '''.PCX''' format first, too bad you can't import colour slots from '''.BMP''' files at the moment), and the colours of the selected slots will change to match your image file. Now, slot #38 through #41 still contains the original colours set by the editor and I don't like them, I just select these 4 slots (click slot #38, hold '''SHIFT''' and click slot #41), then check the "'''This colour is room-dependent'''" checkbox, to make them get out of my sight ''temporally''. The current palette should look like this:
Next I may continue to draw more sprites, but as I am so excited I really want to see it imported into my game. Go to "'''palette editor'''" of the AGS editor, check the range of colours to import as ''sprite colours'', in my case it's slot #17 through #37, so I first click slot #17, ''HOLD'' the '''SHIFT''' key and click slot #37, so that the desired range is selected, make sure that the "'''This colour is room-dependent'''" checkbox is ''UNCHECKED'' and click the "'''Import slots from file...'''" button, now we just need to choose the image file containing the sprite (if it already is in '''.PCX''' format, if not, convert it to '''.PCX''' format first, too bad you can't import colour slots from '''.BMP''' files at the moment), and the colours of the selected slots will change to match your image file. Now, slot #38 through #41 still contains the original colours set by the editor and I don't like them, I just select these 4 slots (click slot #38, hold '''SHIFT''' and click slot #41), then check the "'''This colour is room-dependent'''" checkbox, to make them get out of my sight ''temporally''. The current palette should look like this:


[[Image:8bittut_ss0pala.png]]
[[Image:8bittut_ss0pala.png|center|AGS palette after for importing Girl sprite]]


Now, go to "'''Sprite manager'''" of the AGS editor, right click and select "'''import new sprite...'''", make sure that 1) the "'''Remap colours to game palette'''" checkbox is ''un''checked'', and 2) the "'''Transparent colour'''" is set to "'''Palette index 0'''" (you can set the other settings yourself depending on your need), like below:
Now, go to "'''Sprite manager'''" of the AGS editor, right click and select "'''import new sprite...'''", make sure that 1) the "'''Remap colours to game palette'''" checkbox is ''un''checked'', and 2) the "'''Transparent colour'''" is set to "'''Palette index 0'''" (you can set the other settings yourself depending on your need), like below:


[[Image:8bittut_imspr00.png]]
[[Image:8bittut_imspr00.png|center|Exact palette import sprite settings]]


Now, click "'''Import from file...'''" and select that image file containing the sprite, right drag the rectangle to match the size, blah bla..., your imported sprite will now be stored '''EXACTLY''' like the originally drawn one. (During import you may see that the pink colour becomes black, don't panic, as you'll later find out that it should be imported perfectly with that "pink" colour region transparent when you put it over a background. You may also find out that drawing a rectangle around the sprite helps, otherwise I might have cropped out the antenna accidentally.)
Now, click "'''Import from file...'''" and select that image file containing the sprite, right drag the rectangle to match the size, blah bla..., your imported sprite will now be stored '''EXACTLY''' like the originally drawn one. (During import you may see that the pink colour becomes black, don't panic, as you'll later find out that it should be imported perfectly with that "pink" colour region transparent when you put it over a background. You may also find out that drawing a rectangle around the sprite helps, otherwise I might have cropped out the antenna accidentally.)
Line 62: Line 62:
Now I draw another sprite on the [[media: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|center|96px|Alien sprite]]


The palette has now become:
The palette has now become:


[[Image:8bittut_ss1pal.png]]
[[Image:8bittut_ss1pal.png|center|Alien sprite palette]]


You'll see that in this second sprite some of the sprite colours set before were used (this time I even used some of the colours not used in the last sprite, e.g. slot #17, the darkest skin tone), and more colours were added (slots #38 through #40).
You'll see that in this second sprite some of the sprite colours set before were used (this time I even used some of the colours not used in the last sprite, e.g. slot #17, the darkest skin tone), and more colours were added (slots #38 through #40).
So, to import this sprite, I first select slot #38 to slot #40 in the '''Palette editor''' (like before), uncheck the "'''This colour is room-dependent'''" checkbox (if necessary), and then import these 3 new colours from the sprite sheet into the editor:
So, to import this sprite, I first select slot #38 to slot #40 in the '''Palette editor''' (like before), uncheck the "'''This colour is room-dependent'''" checkbox (if necessary), and then import these 3 new colours from the sprite sheet into the editor:


[[Image:8bittut_ss1pala.png]]
[[Image:8bittut_ss1pala.png|center|AGS palette for importing Alien sprite]]


That's one way you can create sprites in the game making process, and how to add more colours (if needed) in due course, so basically you can draw more sprites, adding more colours if needed, import, draw more sprites... etc. One thing you need to take care of is what you had decided at the beginning - how many colour slots were actually assigned for those "'''fixed'''" sprite colours (in my case it's slot #0 to #127), so when you design your sprites and add colours to the palette, make sure you have some planning on them, and don't add too many new colours unless it's really necessary, or it will reach the limit you set real quickly, and that should not be considered good organisation. (If you are sure that your backgrounds won't need that many colours, you may make a compromise though, that is, change your decision by increasing the number of colour slots planned for sprites, you will have less free slots for backgrounds then.)
That's one way you can create sprites in the game making process, and how to add more colours (if needed) in due course, so basically you can draw more sprites, adding more colours if needed, import, draw more sprites... etc. One thing you need to take care of is what you had decided at the beginning - how many colour slots were actually assigned for those "'''fixed'''" sprite colours (in my case it's slot #0 to #127), so when you design your sprites and add colours to the palette, make sure you have some planning on them, and don't add too many new colours unless it's really necessary, or it will reach the limit you set real quickly, and that should not be considered good organisation. (If you are sure that your backgrounds won't need that many colours, you may make a compromise though, that is, change your decision by increasing the number of colour slots planned for sprites, you will have less free slots for backgrounds then.)

Navigation menu