Skip to main content

Posts

Choose Binding Time Consciously, Awake and Start functions for Initialization

So I ran into a simple but annoying problem when I was trying to hurry up and finish a game I have been working on for a while so I could move on to start a new idea. I was being stupid an hard coding the last features I wanted to include in the game, and of course came across a problem that I spent 30 minutes on that I could of easily avoided if I was thinking. Here is how the problem began. I needed a way to keep up with all the Light projectors in my scene and figure out which ones are close to me. This sounded easy enough, but alas I managed to screw it up. The code I wrote  used an array that was set on the awake  method using GameObject.FindGameObjectsWithTag("TagName"); In my scene, the player is already in my scene, and the lights are not. When my scene is played, a script called GameInit calls the city generator which in turn calls the multiple factories, one being the factory that generates all the lights in my game. Although it looks like when my scen...

Making Images in GIMP Part Two

In the previous post about making images in GIMP, I went over the process of creating the composition and creating clean line art.  In this next part I will explain the steps I go through in coloring my picture, including flats, foreground, background, extra detail, and lighting. And let us continue! The next thing I did after making the line art was add a new layer on screen mode and filled it with an orangish-brown color.  This will tie the piece together in the end by giving all the colors a similar hue while they still pertain to their individuality.  The opacity of the screen is about 52% so that it's not too overwhelming.  Along with this I have brought down the line art layers to 80% opacity to give it a softer effect. Here you can clearly tell the palette I have chosen for this piece, it's going to be filled with earthy tones.  The flat colors for the foreground are fairly basic and cooperate with each other.  Don't be afraid to take...

How To Instantiate Along A Grid (Simple City Generator Method)

A city created at run time that was instantiated along a grid. The reason for this post is to allow people to understand how to make something like this easy and simple. The city is instantiated along a grid using the restraints of the length and width perimeters passed through into the generator. Tiles are incremented through a constant that defines the width/length of the tile square. Here's the code I've constructed for the current explanation : var tileConstant:float = so and so number; var tileObject:GameObject; function BuildCity(desiredLength:int, desiredWidth:int){ var length:int=1; var width:int=1; while(length<=desiredLength){                 Instantiate(tileObject, Vector3(width*tileConstant,0,length*tileConstant), Quaternion.identity); //incrementing if(length ==(desiredLength)&&width <desiredWidth){ length = 1; width +=1; }else{ length+=1; } ...

Backing Up Your Projects

What Prompted This Post: Over the summer while working on one of my games, Unity 3D released an update which required your project to be "upgraded".It warned me to back up my project, but of course me being the stupid little high-school student I am, didn't even think twice and upgraded the project without any precautions. Upon the re opening of my Unity project, I was in shock. Where as the skeletons for all my prefabs, models, and materials still existed, they were all out of place and not put together. So a prefab of a enemy had the mesh component, but the mesh was not linked to it to render, the material was not linked to be rendered. The attached script was said to be missing (although still existed within my project, just not linked). This existed not only in prefabs but every game object in every scene. I was never able to get back my terrain (although height maps existed) so I had to end up remaking it. The whole process of linking everything back together ...

Optimization Tip #1 - Windows As Textures

A lot of games back before the super consoles of PS3 or the XBox 360, companies had to go to extra lengths to save on faces to boost the performance. Technology throughout the past 10 years has grown tremendously advanced for such a short period of time. We are though, still not to the point of having the ability to run the graphics of a PS3's prestige on an everyday tablet and not have major issues. All developers have to optimize their games of course, especially those who are developing for android or IOS. One way everyone has seen is UV mapping entire buildings with a texture. Doors and windows are flat and look like some one cut pictures out of a magazine and glued them on a cardboard box as part of an art project. Now I'm not denouncing the method, its actually kind of crazy to think of trying to model a building in crazy detail. A lot of what makes a realistic looking model is the detail of the texture, instead of the complexity of the it's m...

Making Images in GIMP Part One

This is a little off our usual topic, but still an important factor for games.  When you walk into a game store and you're looking for no game in particular except for one that looks cool, you can't judge it off of game play, you have to go by the cover (and the description on the back of a game).  And so, I shall show you the basics of making an image in GIMP. NOTE OF WARNING:  GIMP was not made primarily as a drawing tool, it was made for image manipulation, so while it has many of the same features that Photoshop has, it does not have everything.

Importing Models and Animation From Blender

NOTE - If nothing is showing up in your preview section, then you have exported the model wrong. Remember you need to have selected in Blender what to be exported. If you have done this, try reversing the faces in the model and re exporting. So after you have your model from Blender rigged , animated , and exported, you can bring it in to the unity editor.  Scale factor is by default 0.01, to change that, try looking at this link .  Anyways, your going to want to drag you model to your scene and adjust the scale factor till you have the desired size (scale factor 1 is rarely what you ever want it, its huge). To start defining your animation, click the + button that's highlighted purple in the picture. You'll get something like this where you can name your animation, define starting and ending frames, and wrap mode. Remember back when you were making the animation for your model? you had to define frames and you had a certain amount of frames ...