Adventures in Programming, Ep. 1

def takingBreaks(self);

{

Every time I take any sort of extended break from writing code, I find that the break serves as a sort of double-edged sword. On one hand, it feels great to recharge after working long hours in front of a computer for months on end. On the other, getting back into the swing things can sometimes feel overwhelmingly difficult. When sitting down to start work on a new project, I sometimes feel as if I am competing in a staring contest with a blank screen. The monitors always wins.

While I don't necessarily identify myself as a "Programmer," I do think proficiency in coding is an important aspect of being a good game designer. I work entirely with scripting languages and pre-built game engines, so you won't see me writing engine components or advanced AI. However, the more time I spend writing logic, systems, mechanics, etc., the better I get at understanding the underlying principles behind programming (and it's proper and efficient use as a  game development tool).

Because my brain doesn't necessarily operate in code on a daily basis, when I sit down to write stuff, I have to focus extra hard in order to reach optimal productivity. This is fine during a typical semester, but what happens when I have a Winter break, or worse - Summer and how do I rebound from it?

workResume();

}

def workResume(self);

{

In all honesty, I am still trying to figure this part out. If I sit down in front of an empty project (Unity, ZeroEngine, etc.), I almost immediately feel lost and overwhelmed. Where do I start, what do I need, how do I write it, what are my relationships? With game programming, I have a very tough time thinking linearly or working in a single direction towards an undefined destination. This is by far, simultaneously the most stressful and depressing part of trying to get to work.

If I am working with an existing project, whether it's mine or somebody else's, sometimes it helps to look at basic scripts and components. If I can make sense of a simple component, like LevelBehavior or TurnManager, I can usually work my around the rest of the game and figure out where I left off or what needs to be worked on. Sometimes it's as simple as asking someone else for an explanation of what's happening, or in the even that it's solely my project, just reading over the code comments. I ALWAYS try to leave verbose comments for myself, even if the code is already pretty readable.

betterCoding();

}

def betterCoding(self);

{

Out of necessity, I have developed better coding habits the more I work. I've gone from nonsensical variable names and magic numbers everywhere to practically creating everything ahead of time in the top of my classes. Properties, formulas, colors, sounds, strings, etc., anything that I am going to want to refer to inside of a function. I also try to write all of my code in as much plain language as possible. For example, "currentHP = currentHP - (incDamage - damageResist)"

I've also started moving away from cramming as much stuff as possible into the Update on a component, and for that matter - making an effort to separate my functionality into as many reusable components as possible. Obviously a single component with 10-20 lines of code is way easier to write, modify, and decipher than digging through a single script with a few hundred lines of code that are doing 10-20 different things all at once.

nextSteps();

}

def nextSteps(self);

{

Moving to a more message / event driven approach is the next step in improving my programming ability, but this will also come at a price. With less obvious relationships, it won't be as simple going through code and components and determining their functionality. I still have some more hurdles to overcome before I can try to break away from the comfort of the Update loop. Until then, becoming more familiar with the languages that I am using and their nuances should hopefully prove immensely beneficial in reducing the amount of time I spend trying to get back into the swing of things.

}