Friday, April 17, 2015

Debugging – The Importance of DIY

As with any game in production, we at GravTech Games have encountered our share of bugs. Some going from having the wrong value being plugged in all the way to needing to look into the Unreal Engine 4 source code to find the one thing that messes up the code and keeps us from compiling. And like any other game these can take time to fix, it’s unavoidable. However the real topic I want to touch on is the importance of fixing your own bugs and issues before asking for outside help, even if you aren’t the one who made the bug. Doing so can make you into a stronger programmer, less dependent on others, but also (and this part is probably most important) the issue becomes less of a time sink for the team. While this is a good practice in any work environment it is especially important while working on NORA because our team works remotely.

In most normal work environments I could lean over and talk to a fellow teammate about an issue I’m finding with their code and get a more immediate answer to the problem. However, when working with different people all living in different places and even time zones this becomes difficult. Instead of being able to lean over to my teammate I instead have to write a message with the problem in Skype, and then wait for what can be hours and hope I get an answer to the question, which might not even happen. Even worse, this can take up the other person’s time when helping. One person spending 1 hour on a bug is 1 hour of dev time spent. But two people both spending 1 hour on a bug is 2 hours of dev time spent. This slows down the productivity of the team and the turnover rate for getting tasks done. This is where fixing your own issues comes into play; with it our productivity can increase by not wasting time waiting on an answer. With that in mind here is my debugging process for when these situations arise:

Talk it through:


Talk it out with yourself, try to envision the problem, know what’s going on, and then find where it’s messing up. Sometimes just reviewing the code you have written can give you the “Oh that’s what it is, of course” moment and then you move on. When you explain something to someone you go in detail about whatever you’re explaining and sometimes when programming going into every little detail can show you what the issue is.

Knowing how to read code:

Credit

This goes beyond being able to read your own code but just to all code in general. Imagine a scenario where you write a function and it works fine for every application you have for it. Now imagine that it’s months later and you’re finding issues with it and you’ve completely forgotten what it is that you did in the function and said “My code is perfect, there’s no need to comment it”. Knowing how to read code comes in here to help even with your own code, because I for one will admit that I have had this happen to me and I was very thankfully I could read the very poorly written code so I could see the issue. This also works well when debugging other people’s code because other people think differently and therefore code differently, so being able to understand what they’re doing is the first step to finding the issue.

Don’t be afraid to learn:
Credit
Knowing what the issue is and knowing how to fix it are two different things. And with a new engine like the Unreal Engine 4 there are bound to be issues with implementing your own functionality. Thankfully for us there is a plethora of forums with people attempting similar things to us who have found different solutions. Several months ago we were having an issue with the project only building from Visual Studio on certain machines. The issue being that to build the project the project was looking for a build.bat file in the install folder for the engine and we had it installed in different locations. Since the engine is still moderately new and not many people have worked on big team projects with it while using source control there wasn’t an easy solution to this problem. However after about an hour of searching on the internet for people who had similar problems I finally found one person who said he fixed the issue by using environment variables to store the file path for the install folder. From there I had to learn how to use environment variables in Visual Studio for how we needed it and then the problem was fixed. This would have been very problematic to the team had it remained an issue.

Ask for help:

Credit
Yes, I started this as a do it yourself, but some problems you just can’t solve alone. However this should be the second to last thing you do. And if you’ve done your research, you’ve stared at a screen for hours and still nothing then sometimes a fresh pair of eyes is just what you need. You need a different perspective and someone to talk things through with. Even if it takes up their time as well as yours if it’s a problem you can’t fix on your own then it’s a problem you can’t fix on your own and you need help. And if after getting help and you still haven’t made progress on the issue then you might have to go to the last resort, rewriting the code. I had an issue on a past project where the entire collision system was broken and the person who wrote it was no longer on the team. We spent a full day looking at his uncommented and very confusing code and it got us nowhere. We eventually had to rewrite the entire system to fix everything.


In the end problem solving is a time consuming and not-always-fun mini-game we have to play. But if you can learn how to play it correctly then it becomes less of a hassle and it makes you all the stronger for doing it.

Wednesday, April 1, 2015

Maintaining Motivation

Today I thought it would be an interesting discussion to write up about one of the most important skills in life. Motivation is one of the most valuable tools in an artists, or anyone’s, toolbox, and yet, so few people seem to truly have the drive to work at it.
Credit
I know what you are thinking, the hand raising in the back of the classroom “uh, Patch…motivation is a noun describing a reason to do things, not a skill which normally is described in verbs, such as drawing.” On this, I choose to strongly disagree. Acquiring motivation doesn't happen overnight, it doesn't come out of nowhere. I liken it to when you are drawing out in public someplace “trendy,” Starbucks or something, or people view your work, and they are like “O-M-G, you are so-o-o-o talented, I wish I could draw! Less-than-three.” Every artist hears that and they appreciate the sentiment, the compliment, the kind words, and uplifting intention, but really “talent” didn't get the person where they are. Hard work did. Countless hours of hard work, and to simplify it down to a quality that people colloquially akin to someone being born with such as “talent” is to diminish all of that effort. Motivation is very similar. You aren't just born with it and never again have another chance to roll the d20 and get a critical hit from your previous critical fail.

“Okay Fine, it’s a “skill,” but if it’s a skill, how does one get better at it?”

Credit
I am glad you asked voice in my head, thank you for not speaking a language I don’t know this time!   Well, to be someone that people refer to as “motivated,” I would say you need to develop a habitual work ethic.  If you truly are going from ground zero, due to depression, or years of laziness, then feel free to start small.  Maybe just tell yourself that every single day, before you leave your bedroom, you will draw a circle.  EVERY DAY. Something that small.  Or you could just take a deep breath and be like, “Thou shalt not wallow in bed for an hour deciding to get up on days after a really good party when I have the day off and I have plenty of stuff to do, but I want another 5 minutes of sleep, that never ends up another 5 minutes of sleep, and I know that but the covers are so warm, and just 5 more minutes, okay time to get up, just 5 more minutes.” Then realize you wasted 3 hours of your day, and did nothing you wanted to do. Start on working on these things, these little (or sometimes bigger…) pushes to get out of bed. Breaking these little lazy habits. Then grow from there. Truly kick yourself if you fall back into these negative space bad habits.

Like all skills in life that a person wants to practice, you need to objectively look at your behaviors, and decide which qualities to keep, and which to throw away. Do you have bad line quality? Then you need to restudy it, redraw it, restudy it, correct it, redraw it, practice, practice. Critically assess your mistakes. Are you unmotivated? Critically assess the areas that time is being thrown away from doing things you “want to do, but never get around to” like that book, or that drawing, that’s been on the backburner for 2 years while you tell people about it, but it’s so hard to pin point down that key plot point that’s missing while you are playing League of Legends.  Which brings up another, very quick topic.  Plan your day. Play league, great, it is fun. But plan the time around it. If you want 2 hours of League time, and you need to practice drawing, and you have a day job, how can you make that all work? I would say proper planning of your day is definitely part of developing motivation.

Credit
“Alright, I’m convinced, but what does that have to do with art and vidya garmes…”

Seriously, if that was your thoughts, I will find you. I will FIND YOU, and I will paint yellow daisies and ice cream and unicorn farts all over your super edgey grim dark depression piece that represents the void in your soul since he walked out of your life. Being self-motivated is a HUGE part of art, and if its even possible, it’s an even bigger part of indie game design, when you have no boss staring you in the eyes every day, no “beatchu” sticks to keep you in line, and all long term glimpses of glory, but you have deadlines to hit.  It is one of the hardest mountains to climb in that kind of work environment, and its one that everyone needs to scale. So get out there and start scaling…preferably in Y.

Want to help us stay motivated? Check out our Indiegogo campaign and help us Save the NORA! Click here for the Indiegogo Page

--
By Patch Johnston, Character Art Lead for NORA