I recently came across a forum post, not directed toward me specifically, which looked a lot like other posts that I see reoccurring on developer sites. It comes from a new hobby videogame creator unsure how to stay focused on one project long enough to complete it.
Since this is such a common issue, I thought sharing my response here may be of use to some other folks just getting into the craft. A followup question asked about some debugging and CS practices, my reply to which I’ve included here as well.
> I get a game idea, lock myself in the basement with snacks, and intend to program for months. But then I lose my motivation. How do people manage to stick with it?
Avoid the temptation to rely on junk food when trying to power through it. It’ll lead to an energy crash quite aside from (and probably well before) your attentional limits.
Likewise “locking yourself in” so to speak may occasionally make sense for a short sprint, game jam style, but when attempted over a period of weeks or longer, it can do more harm than good. It’s important to still interact with the outside world. Going bonkers with restlessness isn’t good for the project. Go outside, talk to other human beings to keep perspective, and if done right, you’ll be able to return to the work with renewed energy.
Practice finishing projects, even if that means taking on some little projects that maybe aren’t the main things that you dream about making. First shoot for making a project that you know you can finish, and stick to finishing it. That requires turning off the ideas valve at some point in the project long enough to wrap it up. Set a deadline, and prefer to make a less fancy finished game than a more fancy unfinished one by that date.
If you’ve never finished anything yet, go for something minimal like Pong, Simon Says, or Tic-Tac-Toe. There’s a set of skills involved in finishing something that can only be discovered and mastered by getting experience finishing things. Then incrementally ratchet up the complexity of your projects little by little, until you’ve got a clearer sense for what it’s going to actually take to implement your cool idea in a way worth doing, and/or until the cool ideas you get are within the complexity of projects that you’ve been completing before. Allow however that any time you’re taking on a design that’s a work-in-progress (this is always the case when working on your own ideas), there will be additional overhead, complication, and floundering as you figure out the idea while working on it, as compared to for example when you’re able to base a design heavily on a classical example.
Commit to completely dealing with the hard, boring, or mundane chore parts of the program development that you’ve otherwise previously avoided. Those have to happen for your game to be complete. Some people mistake a feeling of “I don’t want do certain essential parts of the project” with a change in their motivation level when those are the only parts left, but that’s not really what’s happening. It’s just a fear of the unknown or an unwillingness to power through it. Power through those parts, because that’s the only thing that will make them less uncertain, time consuming, or annoying on the next game project. You’ll be glad you did.
As a simple but foolproof bit of process advice that I repeat frequently, because it really solves a lot of problems: make a list of everything left to be done on the game before it can be released as complete. Only allow that list to get shorter, whether from doing an item on it or by deciding that you don’t need something on it after all. For your very first completed project(s) this could happen very early in the game; as you start completing larger projects, consider doing this around the halfway point, and eventually, just when you hit the final stretch for a game.
[Reply to a followup question from another user follows.]
> So what do you do when you have a bug that you can’t fix…
I reorganize the code and break it down into smaller, testable parts until it turns into a bug that I can fix.
>…or you need to optimize your code in a way that you don’t know how to optimize it?
Look for example code, give it trial and error, Google for other people in a similar situation, ask forums, and time allowing, study CS. Alternatively, accept that it’s a limitation of either the current platform or at least your current ability to make the most of the platform, design it out of existence by instead doing something simpler, and move forward. Plus in many cases on a modern machine you can get away with brute forcing something, at least in a prototype or a simple game, that 15+ years ago required being pretty clever about it.
> Let’s say you need to write an algorithm to cut down on memory by combining similar tiles in a tile map. What do you do to write your own algorithms for such things? Do you use your general knowledge?
That sounds like a fairly universal and common exercise that has been going on for a long time, so I’d suspect that there are existing implementations, examples, and probably some documentation or discussion out there to be learned from, potentially even adopted and used. But if I need to write my own algorithm for things I tend to rely on my experience having solved similar or less complicated problems (many years of practice in context), on what I was required to learn to obtain my CS degree, and if those aren’t enough, then hacking with lots of debug output to compare against hand-solved test cases until I’ve got something that holds up well enough for my purposes.
> If so, where on the internet might someone gain the knowledge to learn to write advanced algorithms?
Depending on how advanced we’re talking, this is potentially comparable to asking where on the internet someone gains the knowledge to do chemical engineering work. It’s university material. Resources exist, but they require a serious time commitment, and if they’re effective are more or less much of the same content you’d be exposed to through computer science curriculum (undergrad and/or grad level).
Very, very, very little of videogame programming at this point in history actually requires inventing new algorithms though (assuming you’re at indie-scale, and not a specialized graphics engineer doing next-gen console work as part of a huge team creating the latest version of the Unreal engine or something like that). For the most part it comes down to instead relying on a big pile of plain arithmetic or vector geometry+trig (potentially up to knowing how to use, though not how to hand solve, linear/matrices/quaternions if you’re in 3D) stuff that just needs to be organized in such a way that it can interact with other things, be placed/configured without programming while doing design work, and have all the necessary art/audio assets authored and connected for it.
Sometimes a whole game idea can be built out of a single unusual algorithm or data structure at the center of the game’s design, in which case even then it often isn’t so much an insanely advanced discrete math challenge so much as it’s just a novel way to hang things together, a lazy optimization that relies on an accepted constraint of the engine, or some brute force calculation that doesn’t need to happen frequently enough to affect performance (ex. only at the start/end of round, when a certain power-up gets collected, etc.).
Learn and practice team game development with Gamkedo Club.
Membership worldwide. Professional support. Proven process.
Subscribe by e-mail to receive weekly updates with Gamkedo.Community interviews and YouTube training videos for game developers!