December 18, 2009

Free Game Development Software

Filed under: Business — admin @ 3:22 pm

Starting a game development company is hard enough without worrying about money.  Here at Ginger Magic Games, we’ve found plenty of free software that you can use to make games.  Below is a short list of the software we use.

Raster Graphics

Gimp is a fantastic Photoshop replacement.  It’s available for Mac, Windows, and Linux, and has a very active community.  You can find tons of plug-ins and tutorials to help you with any editing you need.  Already learned Photoshop at school, or own the student version that won’t let you make money from your images?  Download “Gimpshop” and your Gimp install will look familiarly like Photoshop.  You’ll be texturing your games in no time (and at no cost).

Vector Graphics

Raster graphics are great, but for easily resizable, crisp vector graphics, you’ll need to replace Adobe Illustrator with something a little easier on the wallet.  Inkscape is a great choice.  It uses the W3C standard SVG format, so you can even view your saved images in compatible web browsers (like Firefox).  Like Gimp, Inkscape also has many tutorials that make it a quick, easy program to learn.

3-D Modeling

If you’re looking for a powerful, free 3-D modeling program, you can’t go wrong with Blender.  I learned 3-D modeling using Maya in school, and Blender can do everything that I learned in Maya plus more.  The user interface can be difficult if you’re used to another program, but if you’re just learning to model for the first time that won’t be a problem.  There are a ton of Blender tutorials online, including the WikiBook Blender 3D: Noob to Pro.  The first few sections of the book were all I needed to transition my knowledge from Maya over to Blender. sidenote:  I still prefer Maya and it will definitely be one of my first purchases when a positive cash flow rolls in.

Game Engine

You can’t go wrong with Unity.  I LOVE Unity, and have even before it was free.  If you want to develop quality 3D games for multiple platforms, you’d be crazy not to at least try this engine for yourself.  Once you run through one of the tutorials provided with the install, you’ll be able to prototype your games as quickly as an afternoon.  With the power to prototype so quickly, you’ll be able to test multiple game ideas before you dedicate yourself to completely fleshing out your next product.  And when it comes time to flesh it out, you’ll be amazed at the powerful, easy to use interface that Unity provides you.  As an added bonus, the Pro license as well as the Unity iPhone licenses are on sale for 20% until the end of 2009.

Audio

I actually have no idea what to use for audio because I haven’t made it this far in the development cycle of my first game yet.  I’ve heard of people using Audacity, but honestly I will probably source this part of my games out to an audio expert until.  After all, One man can’t do everything on a project.

Suggestions? If you know of any other great free software, drop us a comment.  I’m sure the other readers would love to hear from experience.

November 22, 2009

Tower Defense: Day 2

Filed under: Development, Tutorial — admin @ 11:59 pm

Tower Shooting

To make the towers fire, I used a simple pursuit algorithm so that the bullets would always hit their intended target, similar to a homing missile. Each tower has a capsule collider attached to it. The collider has a height of 2, and a radius that is equal to that particular tower’s range. This collider is set as a Trigger, and has the following script attached to it.

var bullet : GameObject;
var shotsPerSecond : float = 1.0;
private var secondsSinceLastShot : float = 0.0;

function Update() {
    secondsSinceLastShot += Time.deltaTime;
}
function OnTriggerStay (enemy : Collider) {
    if(secondsSinceLastShot >= 1.0 / shotsPerSecond) {
        var newBullet = Instantiate(bullet,
            transform.position, Quaternion.identity);
        secondsSinceLastShot = 0.0;
        // Set the enemy for the bullet to home on
        newBullet.transform.GetComponent(BulletScript).enemy =
            enemy.gameObject;
    }
}

That script will cause each tower to create a new instance of its bullet type shotsPerSecond times every second.  Bullets are implemented as a Unity PreFab that contains a small sphere with the following script attached.  It is the pursuit algorithm.  You can set how many frames it takes for the bullet to hit its intended target, and then each frame it will move a fraction of the distance toward the enemy.

var enemy : GameObject;
var numFramesToHit : int = 40;
var damage : int = 4;
private var frames : int = 0;

function Update () {
    if(enemy && frames <= numFramesToHit) {
        var mult = 1.0 / (numFramesToHit - frames);
        var diff : Vector3 = mult * (transform.position -
          enemy.transform.position);
        transform.position = transform.position - diff;
        frames++;
    }
    if(frames == numFramesToHit) {
        enemy.transform.GetComponent(EnemyScript).hit(damage);
        // Destroy the bullet object
        Destroy(gameObject);
    }
}

Splash Damage

I implemented splash damage using a simple technique that involved an empty GameObject and a spherical collider.  Similar to the way a tower decides who to shoot.  When a player is hit by a bullet that causes splash damage, an invisible spherical collider is created at the player’s current location.  Then, any players who are in range of the collider will be dealt damage, and finally the collider will destroy itself after a single frame.

Status Effects

To implement a status effect, all you need is a simple boolean value to indicate whether an enemy is affected, and a timer to keep track of the effect’s duration.  Make sure to have a separate boolean and timer for each type of status effect so that enemies can be slowed down and on fire at the same time!

if(aflame) {
    if(fireEffectTime < maxFireEffectTime) {
        health -= 1;
        fireEffectTime++;
    }
    else {
        aflame = false;
        fireEffectTime = 0;
    }
}

That’s all for today.  I may need to rework the damage code a bit when I start making the towers upgradable, but it’s working great for now.  Screen shots will be coming soon once we get to a post that actually has something interesting to look at.

November 21, 2009

Tower Defense: Day 1

Filed under: Development, Tutorial — admin @ 11:59 pm

It’s been one day and the game is still on schedule!  This series of posts will be a detailed tutorial on creating a tower defense style game using the Unity engine.  Today, I completed the first few steps:

  • Design
  • Title Screen / Menus
  • In Game GUI
  • Enemies Follow Paths
  • Player can Place Towers on Grid

Design

The game will be a standard tower defense game with towers and enemies based on different elements.  I slightly altered the elemental types from Pokemon for this game.  There will be 6 different types: normal, flying, fire, water, rock, and ghost.  Each enemy can be more susceptible to, more armored against, or totally immune to the different tower types.

The towers will each have different firing speeds, ranges, and damage amounts.  Some towers will also have a special ability such as splash damage.  Each tower can be repeatedly upgraded, increasing its stats by 10-50% per upgrade.  The following table lists the stats of each level 1 tower, along with its special ability.

Type Damage Speed Range Cost Ability
Normal 20 1.5 1.5 10 –None–
Fire 30 1.0 2.0 25 10% chance of catching enemy on fire, causing 2 damage per step for 10 steps
Water 10 1.0 2.0 25 Slow enemy down 50% for 3 seconds
Rock 50 0.25 1.5 50 Splash damage within range of injured enemy. Can’t hit flying enemies or ghosts.
Flying 50 2.0 2.5 100 –None–
Ghost 10% 1.0 1.0 150 Takes a percentage of enemy health instead of dealing direct damage.

The enemies also have specialized stats including health and speed.  The stats will increase by 3-5% per level.

Type Health Speed Special Ability
Normal 30 1.5 –None–
Fire 40 2.5 10% chance to set an attacking tower on fire
Water 100 1.0 –None–
Rock 50 1.5 Split into two smaller rock enemies with half health when defeated
Flying 60 1.5 Can fly over terrain instead of following the path
Ghost 80 2.0 Can fly over terrain, except for graveyards

The simulation part of the game comes in choosing the enemies that will attack each level.  The first 3 levels consist of a group of 20 enemies of the same type.  Level 1 is a group of normal enemies, followed by fire enemies in the second level, and then rock enemies.  The following rounds will consist of 20 enemies that are randomly chosen by an AI script.  At the beginning of each round, the script will simulate how the player would fare against 10 different randomly chosen groups of enemies.  These groups will be ranked by the player’s performance, and then the one chosen will depend on the difficulty setting.

Title Screen

Unity now has a GUI class that helps you create GUIs quickly and easily.  I made all of the GUI objects sizes relative to the screen resolution, so that the GUI will be proportionally similar on every player’s screen.  In an RPG or action/adventure type game, you may not want to do this.  Instead you could have all GUI elements be fixed width/height, and then if someone has a higher resolution, they can see more of the in game graphics because the GUI elements take up less screen real estate.

The following is a simple example that creates a box with two buttons inside of it in the middle of the screen.

function OnGUI () {
    var w : int = Screen.width;
    var h : int = Screen.height;
    GUI.Box (Rect (w / 3, h / 2, w / 3, h / 6 + 30), "");
    if(GUI.Button (Rect (w / 3 + 10, h / 2 + 10, w / 3 - 20, h / 12),
        "New Game")) {
        Application.LoadLevel (1);
    }
    if (GUI.Button (Rect (w / 3 + 10, 7 * h / 12 + 20, w / 3 - 20, h / 12),
        "Help")) {
        Application.LoadLevel (2);
    }
}

Path Following

Since the enemies in my game walk along a very simple path, I was able to come up with a simple solution that relies on triggers placed along the path.  Each enemy will have a velocity set on its rigidbody component, and will walk in a straight line.  Each corner on the path will have a capsule collider that is tagged either “Left” or “Right.”  This collider is set as a trigger so that the physics engine will report collisions, but ignore calculating interactions based on that collision.  The following piece of code will cause the enemies to turn properly based on the trigger’s tag when they run into it.

function OnTriggerEnter (other : Collider) {
    var oldZ = rigidbody.velocity.z;
    if(other.tag == "Right") {
       rigidbody.velocity.z = -rigidbody.velocity.x;
       rigidbody.velocity.x = oldZ;
    }
    else if(other.tag == "Left") {
       rigidbody.velocity.z = rigidbody.velocity.x;
       rigidbody.velocity.x = -oldZ;            
    }
}

Tower Placement

Placing towers involves converting mouse co-ordinates into 3D world co-ordinates.  This is not an intuitive thing to do.  At first, I tried just using the X and Y values reported by the mouse location.  This doesn’t work at all.  Instead, I found that you should cast a ray from the camera’s location, through the mouse’s location.  Then, you have a plane with an upward normal located at Z=0.  You calculate where the casted ray intersects with this plane, and that is the location that you should use as your 3D mouse location.  The following code will do this for you.

// Generate a plane that intersects the transform's
// position with an upwards normal.
var playerPlane = new Plane(Vector3.up, transform.position);

// Generate a ray from the cursor position
var ray = Camera.main.ScreenPointToRay (Input.mousePosition);

var hitdist = 0.0;

// If the ray is parallel to the plane, Raycast will
// return false. Otherwise, it sets hitdist to the
// distance along the ray that it intersects the plane
if (playerPlane.Raycast (ray, hitdist)) {
    // Get the point along the ray at the calculated distance.
    var targetPoint = ray.GetPoint(hitdist);
    transform.position = Vector3(Mathf.Round(targetPoint.x),
      Mathf.Round(targetPoint.y), Mathf.Round(targetPoint.z));
}

November 20, 2009

Demo Ready Game in 10 Days

Filed under: Development, Tutorial — admin @ 1:06 am

I have a final project due in Simulation class after the Thanksgiving break, so in the next 10 days I’ll be making a fully functioning tower defense strategy game that uses simulation techniques to randomly generate enemy groups according to a player’s difficulty setting and current progress. The project will be developed in Unity, and there will be a daily post detailing my progress.

Drop by all next week to see how quickly a game prototype can be developed in Unity. Each post will contain screen shots of the game’s progress, and the final post will contain a YouTube trailer demonstrating game play.  Here’s a quick run down of my goals for each day:

  1. Saturday
    • Game Design
    • Rough Graphics – Splash Screen & Menus
    • Rough Graphics – In Game GUI
    • Enemies (Colored Spheres) Follow Designated Paths
    • Player can Place Selected Tower (Cones) On Grid
  2. Sunday
    • Towers Shoot at Enemies in Range
    • Splash Damage
    • Slowing Damage
    • Fire Damage
    • Rock Enemies Actually Split
  3. Monday
    • 1st 3 Levels Have Proper Groups
    • Add Particle Effects and Lighting to Fire
    • Implement Monetary System
  4. Tuesday
    • Towers are Upgradeable
    • Enemies Get Stronger Each Level
    • Fire Enemies Special Ability Working
  5. Wednesday
    • Improve GUI Graphics
    • Begin Simulation AI
  6. Thursday
    • Continue Simulation AI
    • Improve Tower Graphics
  7. Friday
    • Finish Simulation AI
    • Boss Levels
    • Improve Bullet Graphics
    • Improve Level Graphics
  8. Saturday
    • Improve Enemy Graphics
  9. Sunday
    • Continue Graphics & Animation Work
  10. Monday
    • Finalize Graphics
    • Final Testing
    • YouTube Demo Video
    • Playable Web Version??
    • Fake Marketing on Site

November 12, 2009

Website Launch!!

Filed under: Uncategorized — admin @ 2:44 pm

The site is now live (and actually works in IE6)!

The site has gone from a sketch on a piece of paper to fully designed and developed in the past two weeks.  Thankfully I was able to skim through a book on Adobe Illustrator, and transfer that knowledge into Inkscape easily enough to create the logo.  A little CSS and a few browser tests later, and the site is born.  Check us out on Facebook and Twitter as well.  Drop by the Facebook page, and join in some of the discussions.

Copyright ©2009 Ginger Magic Games, L.L.C. --- Powered by WordPress