Archive for the ‘Unity’ Category

Futile Quick Start

Futile is a framework that allows you to control rendering within Unity programmatically. This is a boon to anyone interested in 2D games and finds, like myself, that Unity impedes 2D game development.

  1. Get Futile from Github
  2. Import the Futile.unitypackage into you Unity project, Assets->Import Package->Custom Package…
  3. Create an Empty GameObject and call it Futile Camera, GameObject->Create Empty
  4. Find the Futile script in the Project Pane and drag it to the Futile Camera object you just created.
  5. Make or find a fun and silly image, I like this one: OMG IT SPINS
  6. Now put it in you Unity project under the Asset folder and call it OMG.
  7. Click on the image and set the Texture Type to Advance and then the Non Power of 2 to None.
  8. Create a new Script file and name it FunWithFutile.cs and drag it to the Futile Camera object.
  9. Now copy the code below into you script file.
    using UnityEngine;
    
    public class FunWithFutile : MonoBehaviour
    {
        // Use this for initialization
        void Start()
        {
            FutileParams futileParams =
                new FutileParams(true, true, true, true);
    
            futileParams.AddResolutionLevel(
                1024, 1, 1, "");
    
            futileParams.origin = new Vector2(
                 0.5f, 0.5f);
    
            Futile.instance.Init(futileParams);
    
            Futile.atlasManager.LoadImage("OMG");
            FSprite fSprite = new FSprite("OMG");
            Futile.stage.AddChild(fSprite);
        }
    
        // Update is called once per frame
        void Update()
        {
    
        }
    }
  10. Press play and be impressed!

Read Full Post »

Unity3D #pragma strict Gotch

I was working with some code in a book today and could not figure out why a variable was giving me problems.

Unknown idenifier: ‘mesh’. (BCE0005)

I don’t usually program using JavaScript much less with MonoDevlop, so it took me a while.  Turns out, it’s a little thing:

#pragma strict

I was using it, and the book wasn’t.  They didn’t declare the variable in the example unlike ALL the other ones! That’s why it is unknown, it IS unknown.  The sample code that came with the book compiled because it doesn’t have the #pragma strict.

Read Full Post »

I didn’t finish. I just didn’t have my weekend clear.  You really need a clear weekend to finish Ludum Dare. The tech change in the middle didn’t help.

My main take away: Unity slowed me down. I’m too much of a programmer. When a game engine gets in the way, I can see all the different ways I would code myself out of the problem, but I can’t see any solutions in the engine’s context. Code is a powerful too, and I’m good at using it. Game engine’s are alien worlds with bizarre rules and un-explainable behavior.

So, I’m going to stop using game engines (or frameworks etc.) I’ll use non-game libraries and leave all the game programming to myself. Specifically, something like SDL, SFML or even XNA are good for me, but not stuff like Torque 2D or Unity. I think XNA is “library” enough not to be considered a game engine. It’s more like a toolbox. Oh, I think the caveat here is I want to make 2D games, not 3D.

I think there is a bigger principal at work here: KISS = Keep It Simple Stupid Game Engine’s are complicated systems built by lots of programmers.  They have multitudes of  audiences with different needs.  This all makes them hard to understand with lots of bells and whistles.  In order to accommodate all these different requirements, some feature are overly complex with lots of assumptions.  Those assumptions require rigidness to keep you out of the weeds that aren’t handle so well because of those assumptions.  So at the end of a Ludum Dare weekend, you look back and see all the time lost figuring the game engine’s nuances and gotrchas.  Then you pine for a chance to go back in time and just pounded out the code you needed.

Read Full Post »

I’m about half way throught this weekend’s Ludum Dare 21 (althought the traffic level is really bad right now.)  The theme is Escape.

Tools so far:

My Pac Man mechanic isn’t exactly fun, but it too late in the contest now to change :(   I’m using momentum or forces to move the player, which at least one interesting difference over the classic game.  This make moving around a little less straight forward, and might have some emergent strategies, we’ll see.

Interesting! Notch of Minecraft fame is video streaming live as he programs his Ludum Dare 21 entry!!

 

 

Read Full Post »

Updated 9/22/2012

Inspiration – Videos and Movies

Inspiration – Games

How Games Work

User Experience

Unity Tutorials

Read Full Post »