Wednesday, February 3, 2010

Scripts

Scripts are basically files containing commands that tell Unity how certain objects should behave. One script you're familiar with already, is the one that allows us to walk around our game world in first person (the "FPSWalker" script). We are going to be using some other scripts as well that we will have to import, so that we could make our objects perform other actions, like rotate. To do this, we have to drag our script file into our 'Scripts' folder, that's inside our Standard Assets.

Now, to apply the script, either drag the script over to the object you want to attach it to, or select the object and go to "Component" > "Scripts" and select the script you want











One of the scripts that we are going to be using is called 'GemCollect;' this script lets us collect items (or 'gems') throughout our game a'la pacman or super mario. You should all have this script already included in your Scripts folder, so using one of the methods described above, attach the "GemCollect" script to your 'First Person Controller', this tells Unity that your character is able to collect certain objects. Next, to specify which objects are the ones that we can collect, we have to tag them. First select the object that you want to be collectible, then in the 'Inspector', click on the Tag attribute, and select 'gem.' If the tag 'gem' isn't already included, we're going to have to add it by selecting 'Add Tag...'.













This will take us to the Tag Manager; there, we will have to add the tag 'gem' to the first unused 'Element' in the list.







Once you have that done, just go back to the object you want to be collected, and select 'gem' from the Tag menu as described above. Repeat this for all your collectible objects.

Monday, February 1, 2010

Unity pipe line!

I just want to go back and review some basics from last class :

The PIPELINE
Once you are done with your model...
- Go to "render" then "bake object," and check: Ambient Occlusion, illuminate and single texture.
- After your burn, double-click on your texture; what you will see is check marks in "ambient inclusion" and "illumination," but not in "color channel;" we need to reverse this.
- Open up "ambient" and "illumination," then go to "clear"
- Go to your desktop where C4d has placed all your textures for walls etc. They will be labeled and have two textures for each section. Open them up in Photoshop, Cut and paste one on top of another and go to"multiply," then save of the psd as "walls texture" etc. Repeat this until all your textures are done.

Go back to C4d; in the texture attributes, hit "color" and load up those textures for each wall, ceiling, etc.

Now we are ready to bring this into Unity!
Also, remember that "light maps" add directional light, and require a burnt light map to work; Go to "terrain" > "add light map"

MESH HAVE COLLIDERS:
Lets' make sure we're not just able to walk right through our models; go to: "Component" > "physics" > "mesh have coliders"

A quick overview of Unity:




Unity navigation:
Rotate, move and scale - very similar to cinema 4d, except you need to hold down "ALT" simultaneously for zooming in/out, and rotating the camera around the scene.



Layout screen:
We have two working areas
#1: all gray = working area
#2: all blue (below the gray) = game screen



Main Camera:
This is what should be in the middle of the sc reen-when you touch it you should have an axis-we call this now the "translate tool"-you mayemploy all move tools on this.

Inspector window:

Very similar to our attributes menu in C4d, touch anything in the translate menu and it's attributes will show up in the inspector to your right.



Terrain:
Go up to the top menu and click on terrain-go to "create terrain" then go to "terrain resolution" changes the resolution to 500m/500m square go to height map and change that to 30m.

Manipulating your terrain:

Go to Inspector window based on terrain and check out your options to move terrain-we have first the "raise height tool" - notice your various options for brush size etc.




Brush tool:

This is a way to add textures to your terrain. you also can use this to apply tress etc.
touch it and notice "edit texture" in the right corner-click on that then touch the triangle to it's right to get all the textures available to you.

all your textures and assets will be in the bottom right next to game window-we call this our "toy box'-please save a version of your project into "Assets" and you will see it show up in you "TB"


Trees:
When adding trees, don'tforget the bend factor; you can get trees the same way as getting textures.





Lighting:
Go to "create other" and get "directional lighting" rotate it around to get your desired look-then go to "terrain" and then "render a light map" to secure your new lighting onto your land (remember-when you use light -make sure you always render a light map)




Sun:
"create other " and add "point light" - you are going to need to add a flare on this - try "sun" under flare in theinspector
window.

First person:
Delete your camera by holding down ctl and hitting delete
grab FP from TB and drop it onto your translate area. position it at 250/70/250 so itdrops into the center off our game.-Adjust speed and height in inspector.

Play game: press play in the game view-walk around (remember, you must stop game before making anychanges.)


Sky:
Go to "Render settings" click and let go-look to your right and find "Sky box" in your Inspector window.-click on that and grab a sky.






Water:
Go to "pro-standard assets" in your toy box-make sure you position your water right and make sure you set the scale value to 1000/1000 (depending on your space)







Particle systems:
Go to "Game object"-then "create other" then "Particle systems" look in the Inspector and see all the variables to control your PS-your going to mostly be concerned with upping the numbers on emitter 15/20 and emission 20/30 also try "world velocity" to give it a natural look




Wednesday, January 27, 2010

Unity 101 (Part 2)

Last class ,we learned how to manipulate and move through our terrain. Today i would like to go a step further by adding a sky, trees and water.

All items that are associated with terrain are under "terrain" in the top menu.



To add a sky, go to"edit" > "render settings," you should then see a section called "skybox."



Adding trees is also simple; go to the attributes of the terrain, and the tree button should be pressed as you select your desired tree. Place trees down by clicking on the scene.

Water is equally as easy; you will find water in your "pro standard assets," so just drag and drop the water, but you must change the size in the inspector.

Currently, our scenes are very dark; with out adding "directional" light, we cant see anything,
so go to "game object" > "create other" > "directional light," and move the light to obtain your desired look, then make sure you burn the light map by going to "terrain" > "create light map."

Last thing we learned was how to reverse our normals in order for our models to be inserted into Unity properly. Remember to make a copy of your object first, and then reverse its normals by making it editable on planes, and right-clicking to select "reverse normals."

Monday, January 25, 2010

Unity 101

Last class we started to learn unity. Today I want to go over what we learned.

In the top left corner, you will see everything you need for navagating through Unity. You have Object move, Scene move, rotate, reduce and enlarge.









You can also adjust the view by hitting the axis the the top right.










We also learned to get a terrain into our scene: from the top menu select "terrain" > "add terrain." As you can see, its attributes are on the right; these can be changed to manipulate your terrain.
Inserted objects were also something interesting we learned. Go to 'Insert object', then select 'cube'. Try placing the cube down onto your terrain using its axis.

First person: We grabbed this first person perspective camera and inserted that into our game from the menu below.
Press play above your scene and move your camera around using the keys.

We will go over all of this again for todays class; and remember, if you want to find an object in your game, simply click on the object in the manager, and press "f".

Monday, January 11, 2010

Congratulations on a successful mid-term!

You all had wonderful videos-This hard work shows that you all are ready to start building your game and now going beyond just 3-D.
here is some of your hard work:

Wednesday, December 9, 2009

Moving our Camera: 
We are now ready to move our camera through the 3D space (our room).
The most important thing to do, is to make sure you have your camera pass over all the other animations going on around your room.  First thing you should do, is write down where all your individual animations start. Secondly, when moving your camera through your room, mark down key frames in a limited manner;
let Cinema 4D fill in the gaps, as this allows for smoother camera movement; the more key frames you have the faster and jerkier your camera movements will be.  Third, focus on telling a story with the camera; fly around the room and spend time looking at every object with the camera.

Call me over when your done and we will render your movie out.


Monday, December 7, 2009

Game Of The Day:
http://www.vivalagames.com/play/idiottest/


Questions:
- Describe your experience playing the game. Was it challenging?
- What were some of the things this game was designed to test?
- Describe some of the ways the game tries to 'trick' you.


Today we will take a break from our rooms and focus on special effects. I gave you a bit of a lecture on "PARTICLE EFFECTS" and their purpose in 3D cinema. Cinema 4d offers us the power of using "Particle Effects" without having to go to another application like After Effects. The first things we need are "Emitters", these can be reduced in size and made to flow at any angle. Emitters are essentially ready to go, but first you need to parent an object to them before you can actually see the emitters working. You can even parent lights to these emitters for explosion or fairy dust type effects, just don't forget to add a lens to the light by looking in its lighting attributes. Effecters are contained in the same menu as the emitters, and they help direct emitter particles in specific ways.
Last thing we did today was create text by going to the spline menu and grabbing the text tool. Everything for the text can be controlled from the attributes menu (font change, size etc). Just make sure you parent the text to an extrude nurb after that, to give it 3D depth.