How to Create Game Elements with Graphic Styles
In today's tutorial I'm going to show you how to prepare and create a variety of Graphic Styles in Adobe Illustrator CS6 to then use within a game. The benefits of using Graphic Styles is that you can then go on to apply them to a multitude of shapes without needing to recreate each look. So let's jump into this fun tutorial!
I'll be using Adobe Illustrator CS5 for my initial parts of this tutorial, this is purely personal preference as I find it a bit more stable on my PC. However using AI CS6 from start to finish is completely fine. Start off by creating a New Document in Color Mode RGB.
I'm going to try something new for me and that is a different way of preparing a color palette. I got this tip from tutorials by Beto Garza, of which he has several here on Vectortuts+. Start off by drawing two shapes spaced apart and create a Specified Steps of 3 Blend from them (Ctrl + Alt + B). Modify your start and end color to get a nice gradual change in color. This is the basics of getting a color palette.
Mix it up and try picking a color from the default Swatches panel but then going into the Color Guide panel and selecting a color from there. This may give you another variety of colors to play with.
Before I go any further with preparing my palettes, I need to know what sets of colors I will need for the variety of elements I'm going to be creating. So start off with a basic sketch of a game scene. Here I've added six potential areas to be created.
So with the six areas, I'll create a Blend of colors for each element. I've just duplicated the original Blend and then modified the start and end colors.
Once you're happy with your palettes, Object > Expand them so the Blend is removed and you're left with five colors for each element. Select each group of colors individually and click on New Color Group at the bottom of your Swatches panel. This will add the colors from that group into it's own palette folder. You can then double click on the palette folder and name it to Soil/Rocks, Grass etc... to make it easier to reference later on.
Element by element, I'll show you how to create each Graphic Style. We're going to start on the "Grass". Start by drawing a curved line with the Pen Tool (P) or Arc Tool. Give it a black stroke color and then apply a 4pt Stroke Weight. In the Stroke panel, add the Profile: Width Profile 1.
While selected, in the Brushes panel select Add New Brush > Scatter Brush and use the below options. Change the Colorization Method to Tints and click on OK.
Draw a line with the Line Segment Tool (\) on the artboard and in the Appearance panel you'll want to add nine strokes with the lightest green at the top and darkest at the bottom. Apply your Grass Brush to each of the strokes and then from top to bottom the following Stroke Weights: 0.5, 0.75, 0.75, 1.0, 1.25, 1.25, 1.5, 1.5, 1.75pt.
Once done, in the Graphic Styles panel, click on New Graphic Style to add it to the panel. Double click on the icon it creates and rename it to something more memorable.
Now we have our first element, I'm going to set up my Layers panel so there is a layer for each element.
I've then added basic shapes for each element using the colors from my custom palettes. I can see from here whether the colors work well together. Right now, I'm not too sure of the pink but I'll change that later on when I have a better idea of how the elements work together.
Moving on, we'll begin creating our Soil/Rocks. This style is where Adobe Illustrator CS6 begins earning it's price tag because of the wonderful Pattern Tool. We'll start by drawing several shapes with the Rounded Rectangle Tool. I've added a 4pt Stroke Weight and used medium colors from this color group for the fill and stroke.
Once created, select all of the shapes and go to Effects > Transform & Distort > Roughen and use the options below. This will create a more irregular style to the shapes.
Then go to Object > Expand Appearance to remove the Effect and give you the standalone shapes.
Select your shapes and go to Object > Pattern > Make to bring into use the Pattern Options.
Using the Selection Tool (V), move your shapes into place, rotate if required and then modify your Pattern Options to give the pattern you wise. Aim to place the rocks into a formation with would allow as little gaps as possible but also so the shapes aren't touching each other. We're not quiet finished with creating this pattern...
Using the Pen Tool (P), add shading to the rocks. Now the eagle eyed will be the first to say "how can there be shading on rocks because they are all under ground", my response is... "artistic license my party pooper friend!". Add shading will create a more rock like texture. So first add one of your lighter colors to the rocks, remembering to draw irregular shapes.
Then using a lighter color again, add further highlights to the rocks. Once you're happy with your pattern, click on Done and it will add your new pattern to your Swatches panel, ready to use.
When I applied the pattern to the soil area of the game, the pattern was too large. So while the shape is selected go to Object > Transform > Scale and reduce the scale of the pattern only by 50%.
Then using the colors only from the blend palette we created, I've made a Graphic Style with a transparent linear gradient coming from the top and then a medium-light brown solid behind the pattern. Once done, I've saved this Graphic Style as "Soil Rocks".
Moving onto our mountains/hills in the background. Start by drawing a long rectangle with the Rectangle Tool (M). Then use the Effect > Transform & Distort > Zig Zag effect with Smooth points to create a wave.
Then Object > Expand to your stand alone shape.
Now to remove those spiky ends. Draw two Rectangles (M) over either end of the shape and select them both and make a Compound Path (Ctrl + 8).
Then use Pathfinder > Minus Front to remove those ugly spiky ends.
Let's now use the Pattern Tool to create a nice wavy pattern. First modify the options to ensure you've got smooth curves on every peak with no unnecessary corners.
Duplicate the wave and Paste in Front (Ctrl + F) and then alter the colors of the way with the colors from your mountain palette. Click Done when you're happy with the outcome.
I've drawn some cartoon style mountains/hills in the background with the Pen Tool (P). Draw then individually rather than as part of one large shape.
I've then went onto creating the following Graphic Style with the below Appearance panel options. The darker gradient has an Offset Path of -4pt while the lighter which is coming from the top of the hills is set to -10pt.
Let's recycle the mountains Graphic Style and apply it to the sky.
While selected, go into Recolor Artwork and click on the Sky Color Group at the side, then click on OK.
I've removed some of the Effects and strokes to the shape so it's just a pattern and two linear gradients.
I'm going to go into the pattern element itself and modify it as the current color combination is a bit too bold for the sky.
I've used the two lightest blues in the palette to create a pattern of two waves.
To make it a big more fluffier, I'm going to apply a Smooth Point Zig Zag Effect to the shapes with the below settings.
Then use Object > Expand on the shapes.
If you zoom right in, you can see we have a problem with those spiky edges again!
This time however, go in with the Pen Tool (P) and just remove the unnecessary points. You wont need to remove all of them, just the ones which are causing a distortion on the pattern. Click Done when you're happy with the outcome.
Unlike the rocks/soil, this pattern is too small for the sky. So I'm going to change the scale of the pattern and increase it by 200%.
I've then modified the gradients to create a much subtler pattern. With the sky, you don't want the pattern to stand out so much as it may distract you from the actual game/action. Once you're happy with the outcome, create your New Graphic Style and name it appropriately.
I want the hills in the background to seem more detached from the foreground, so I'm going to add another gradient to the Graphic Style we already have. Using the gradient used for the bottom of the Sky Graphic Style, I'm going to add this over the strokes and fills of the Hill Graphic Style. With this applied and saved, it definitely separates the background and foreground now.
Now let's make the Graphic Style for the Mystery Boxes. Draw two Rectangles (M) on two of each other and apply two different shades from the Mystery Box palette.
Using the Transform panel, rotate by 45 degrees.
Let's create a pattern with these shapes with the Pattern Tool. I've one of the shapes and added a darker color behind the two original rectangles to give a triple stripe effect. Now that I'm happy with the pattern, click on Done.
Finishing off our Mystery Box Graphic Style, I've added strokes in a similar style of the mountains as well as a light gradient which is Offset Path by -4pt.
The sun is created by using Zig Zag Effects with different settings and colors. Start with an even circle created with the Ellipse Tool (L). Below are the settings of the first effect.
With a darker color Add New Fill behind the first.
Then Add New Fill on top of both fills with a lighter color.
Using the same yellow, add a transparent radial gradient on below the brightest yellow with an Offset Path of 40pt. Then save your Graphic Style and name appropriately.
Now we have our complete Graphic Styles, I'm going to tell them out. I've added an additional platform to test out our soil and added a stroke of grass on top. However the edges of the soil seem incomplete.
I've went ahead and altered the soil Graphic Style by adding two strokes. This will allow it to follow a similar style as the rest of our scene.
As suspected, our Mystery Boxes don't match our overall color scheme, so I've selected the boxes and then used Recolor Artwork and used the Soil Rocks Color Group.
I've altered the order of the colors in the group by clicking on the drill down menu and selecting Lightness - light to dark. This will create the dark outline then a lighter outline around the shape.
Use the Type Tool (T) to add a question mark to one of the Mystery Boxes and apply the "Soil 2" Graphic Style.
I'm going to alter the colors of the overall scene to give a different look to our game, perhaps for a different level to it. Duplicate all the elements and give them their own layer.
I'm going to go through and Recolor Artwork on each of the elements. For the Sky, I've went into the Edit tab of the options dialogue box. Click on Link harmony colors to keep the same ratio between the colors.
When you move one of the colors, it will alter all three. I'm going to give a sunset/sunrise look to the scene by adding a muted pink sky.
I don't want the colors of the mountains to be too different, so I'm going to go for a similar hue and change the mountains to the original Mystery Box Color Group.
I've then went in to alter the Grass by going into the Edit tab. The same is with the Mystery Boxes and Soil/Rocks. I've also altered the colors of the Sun and changed the position of it to fit with the sunset/sunrise color scheme.
Once finished, remember to add your new Graphic Styles to the panel and rename them appropriately. This will make it much easier to use in the future.
I hope you've enjoyed today's tutorial on how to create some game elements by creating a variety of Graphic Styles. Learning how to take advantage of Graphic Styles can save a lot of time off your workflow and make it much easier for game designers to create the elements they wish by simply applying a style to a basic shape.