3D Game Dev Starter Kit – Unity3D

Wide434x210

Pretty Cool, huh?

So from what I’m seeing around in the various communities, the hardest thing with video game development is, “Where do I start?”  Well, I’ve decided to answer that question.  With this kit! https://onedrive.live.com/redir?resid=BA8DC4B28555902A!1496&authkey=!AACNnQmRmY0GGkg&ithint=file%2czip

Continue reading

Why you should use Event Systems

Hello Readers!

So I have received a ton of questions about event systems from both C# classes I teach as well as from Unity game development classes I teach.  So I have decided to build this blog post generically enough to apply to both.  If you aren’t using event systems, your code probably looks a lot like something below…

    /// <summary>
    /// Moves the character on the ladder
    /// </summary>
    /// <param name="position">place touched.</param>
    /// <param name="other">the object that collided with us.</param>
    private void MoveOnLadder(Vector3 position, Collider2D other)
    {
        GameObject profSuite = other.gameObject.transform.parent.gameObject;
        //I used 10 because that is how far the camera is from the scene
        Vector3 worldPos = Camera.main.ScreenToWorldPoint(new Vector3(position.x, position.y, 10));
        Vector2 touchPos = new Vector2(worldPos.x, worldPos.y);
        Collider2D col = Physics2D.OverlapCircle(touchPos, 0.2f, this.whatIsInteractive);
        if (null == col)
        {
            //they didn't touch the ladder, don't move.
            return;
        }
        //double check make sure they didnt cheat and did click on this ladder
        if (col.gameObject.transform.position == this.gameObject.transform.position
            || col.gameObject.transform.position == this.parent.transform.position)
        {
            //move the player to the top
            Vector3 nTansform = profSuite.transform.position;
            nTansform.x = this.top.transform.position.x;
            nTansform.y = this.top.transform.position.y + 5;
            profSuite.transform.position = nTansform;
            profSuite.GetComponent<Rigidbody2D>().AddForce(new Vector2(0.0f, this.HopUpPower));
        }
    }

Continue reading

Physically based Characters!

Hello…World!

So this just gave me a good run for my money for a while. For the longest time, I’ve been building all of my Characters completely wrong and the bug didn’t really surface until this latest game. Lets start by talking about what a Physically based Character even is.

What is a physically based character

1. A game object which is controlled by a player with input.

2. Reacts to the physics system in conjunction with player input.

Continue reading

Note About Writing Shaders for Windows

customShader
So you want to write your own shaders do you? OK, I agree, custom shaders really changes the way the game looks. You can quickly and easily stylize your game to look very different from all the other games with a few simple shaders applied to your models and sprites.  But you have to write them well.  I have helped port a few games over to windows the past few days (5 I think).  Anyways, all 5 games had issues with their custom shaders on windows.

Continue reading

Persistent Game State and Switching Scenes – Memory Leaks and Crashing!

TitleScene

So I wanted a really cool menu scene where I have actual characters from the game and a 3D world as the backdrop.  You can see the image above for an example.  When you click New Game, the camera zooms in on a single character with the others slightly out of view on either side but still visible.  Swiping left or right takes you to the next character you can choose.  While you are on a character, you can interact with the character via normal input, switch between attack and spell phases, create a minion etc.  These characters are powered off of the same state management system that centrally controls the state of my game.  This same system also includes my event management system, which is also persistent.

Continue reading

Object Pooling – A Great way to Increase Performance

PlatformerGuy So you want to have constant explosions, hundreds of rockets, bullets flying all over the place and general insanity in your game.  Great, so do I!  But this insanity comes at a cost if you don’t manage your resources properly.  When you instantiate and destroy an object, you have to allocate memory, it sits there for a while and eventually the garbage collector comes by and releases it, IF it meets all of the requirements.  Well that’s the sliced down version anyways.  If you are interested in more reading on the whys, here are some links to additional reading.

This article discusses one technique for helping manage those resources for objects that might quickly go through that cycle.  The article is three sections, what is object pooling, what to pool and how to implement object pooling. Continue reading

Touch Input – Moving a Character in 3D Environments using Rays

There are literally hundreds of millions of windows touch tablets out there running windows 8 these days, so it is almost mandatory these days to support touch input in some manner.  I am going to just provide some sample code below that has been commented.  Please note you can use these same techniques to select or unselect objects.  The sample below is a mouse and touch input that allows you to point and click, or touch a point in the 3D environment and the character will move to that point.
touchInput3D

Continue reading

Build a 2D Top Down Game – Zero to Published – Part 9

Welcome to part 9!  I can’t believe we are here already.  Up to this point you should have a fully functioning basic game!  You should have spiders being generated on a timer along with a way to destroy the spider webs, when enough webs are destroyed you should load the next level or the win level.  When you take too much damage, you should be respawned at the start of the level.

In this article, we are going to cover publishing to Windows Store 8 and Windows Phone 8 Store!

Continue reading