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

m
Line 75: Line 75:
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.)


==Making your first background 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 [[media: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 [http://www.2dadventure.com/ags/8bittut_dizzy.pcx this background], you may check out that its palette is like:


[[Image:8bittut_dizzypal.png]]
[[Image:8bittut_dizzypal.png]]


Note that when I make a background I just save a sprite image ''as a different name'' (so it has all the sprite colours properly set), ''change it's size'' to the background size I need, ''clear'' it, and then start adding colours from ''the end'' of the palette, as they're supposed to be "'''room dependent'''", so you can paint your backgrounds with these slots and make them different in different backgrounds if necessary. Note also that the first half of the palette matches that of the sprites so I can still use the fixed colours in my backgrounds if necessary (just don't change their colours as you may have drawn some of the sprites with these slots already). Now you may try importing it as a room background. My test game used 320x240 as its default resolution, so the background is of this dimension. Go to "'''Room Editor --> Setting'''" of the AGS Editor, and click the '''Import background (exact palette)''' [[Image:8bittut_exactpal.png]] button (make sure you didn't click the '''Import background''' [[Image:8bittut_impbgbut.png]] wrongly, note also that these two actions are now moved to the '''Room''' dropdown menu since AGS V2.7), the background should be imported without any problem. '''NOW''' (that is, you didn't restart the editor, start/load a new room, etc.) if you select the last few rows of slots in "'''Palette Editor'''" and uncheck the "'''This colour is room-dependent'''" box you'll see that the colours are imported perfectly like in the original image:
Note that when I make a background I just save a sprite image ''as a different name'' (so it has all the sprite colours properly set), ''change it's size'' to the background size I need, ''clear'' it, and then start adding colours from ''the end'' of the palette, as they're supposed to be "'''room dependent'''", so you can paint your backgrounds with these slots and make them different in different backgrounds if necessary. Note also that the first half of the palette matches that of the sprites so I can still use the fixed colours in my backgrounds if necessary (just don't change their colours as you may have drawn some of the sprites with these slots already). Now you may try importing it as a room background. My test game used 320x240 as its default resolution, so the background is of this dimension. Go to "'''Room Editor --> Setting'''" of the AGS Editor, and click the '''Import background (exact palette)''' [[Image:8bittut_exactpal.png]] button (make sure you didn't click the '''Import background''' [[Image:8bittut_impbgbut.png]] button wrongly, note also that these two actions are now moved to the '''Room''' dropdown menu since AGS V2.7), the background should be imported without any problem. '''NOW''' (that is, you didn't restart the editor, start/load a new room, etc.) if you select the last few rows of slots in "'''Palette Editor'''" and uncheck the "'''This colour is room-dependent'''" box you'll see that the colours are imported perfectly like in the original image:


[[Image:8bittut_dizzpala.png]]
[[Image:8bittut_dizzpala.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 [[media:8bittut_disco.pcx}one more background]], this time the palette is like:
I am happy, so I draw [http://www.2dadventure.com/ags/8bittut_disco.pcx one more background], this time the palette is like:


[[Image:8bittut_discopal.png]]
[[Image:8bittut_discopal.png]]