Quality

Video Games

Design Throw Back Motivation

Failure, Life, Inspiration & Motivation

Over the past six months I am very happy to say I have been making great progress. But as IT goes with anything it's very much the same in development.

Sometimes you eat the bear & sometimes the bear eats you.

My hot streak has dried up in these last few weeks, and I find myself running in circles. I've clocked a few hours shy of the One Thousand mark chasing this goal. After hitting back to back dead ends, I recently pursued a roll back throwing away nearly two months of progress. All of this and now another dead end, leaving me with a muddled code base, a general confusion and lack of direction.

Here I find myself trying to recoup my thoughts, inspiration, and motivation - with a few words for my future self or anyone who finds themselves lost down a similar long and winding path.

  1. Ideas are the most fragile thing in existence.

    • know when to nurture yours and play it close to your chest
    • practice discerning the bad, good & great... time is your limitation, do you really want to invest in THIS one.
    • learn when to shelve the not so great, and cull the bad before they start wasting your time.
  2. Find your Muse / Motivation / Inspiration ( whatever you want to call it)

    • That thing that gets you amped. Learn to summon it at will, you will need it.
  3. Master your craft

    • Become as technically proficient as you can and don't forget to learn the theory
  4. SHOW UP and Work Through it, ESPECIALLY if you can't find your Motivation

    • Not everyone can just roll out of bed and do this.
    • Figure out what you need to get your head in the game, eliminate distractions, get some caffeine in your veins, make it your routine
  5. Lost? Step back, Plan then R&D...

    • Keep one clear goal, focus and always make sure you are working towards it
  6. If you've got to fail... Fail Fast... but LEARN SOMETHING PLEASE!

  7. Write about it... especially even if you hate doing it

    • Take notes, write things down, share with the world
    • I know this one is scary, but that's why you have to do it. Publicly express your knowledge, this means double check your facts and get it right.
  8. Chumbawamba (...horrible 90s reference aside)

    • NEVER FUCKING GIVE UP
Life Success Failure Ideas

Asymptotic Analysis... of console.log()

Doing My Algorithm's homework I may have accidentally left logging on...

Talk about "Big Oh"...

My merge sort subroutines completed somehow! (after 7 minutes...)

Moral of the story?

Console Logging Merge Sort Recursion when N = 1,000,000? === Bad Idea

JavaScript Development Algorithms

JavaScript Tick Paradigm

Recently I was playing with Ionic brushing up on my mobile js / ng skills. My goal was a simple text game inspired by CandyBox2.net - In my journey I quickly discovered the need for a:

Tick-Based System - where game time progresses according to real time, but in discrete steps.

My first implementation resulted in quite a few messy intervals running in tandem, each looking something like this:

var combatTick  =   1000,
    combatInt   =   setInterval(function(){
                        /**
                         * Example Actions:
                         * regenerateHealth();
                         * applyDamageOverTime();
                         */
                    }, combatTick);

The Problems

  • Hardcoded & Felt Clunky
  • Required multiple interval management if new actions became available later
  • No intuitive way to modify actions

So I scrapped this model in favor of something more like a queue system.

function Clock(){
    var actions = [], tickTime = 1000, tickCount = 0,
        i = setInterval(function(){
            tickCount++; // increment the count
            for (var x=0; x < actions.length; x++) {
                if (actions[x] && typeof actions[x] === "function") {
                    actions[x]();
                } // perform the queued repeat actions
            }
        }, tickTime);
    return {
        addAction: function(a){
            actions.push(a);
        },
        clearActions: function(){
            actions = [];
        },
        getCount: function(){
            return tickCount;
        }
    };
};

In a nutshell this factory method returns a Clock Object with private properties for actionsList, tickTime and tickCount. As well as a private property i to hold the interval object. This clock object also have three public methods addAction, clearActions and getCount.

Plans for the future

I think we could even improve upon this method going forward by creating an "Action Class" with attributes to determine if this specific Action is "enabled", as well as setting its own frequency, and number of times to repeat. Then we can have the Clock Manage all of our intervals for us.

JavaScript Game Dev Development

Deventures

"Hello World"

My name is Joe and I have been coding professionally for the past 5 years, and in a more personal capacity for at least a decade before that. All this time I've been meaning to start a development blog, but never got around to doing it until now.

I recently discovered Jekyll and just had to give it a shot...

So here we are. In the upcoming months I have a lot of Game Dev on my horizons as well as a few serious goals of programmer professional development for 2015.

Hello World About Me Development Jekyll Game Dev