Monday, March 7, 2016

Pushing through to the starting line

Unity is an excellent engine for game development.  It is powerful, flexible, intuitive, well-documented, and widely-used.  Just as importantly, it is free to use and free to publish with if you're an independent or small-time game developer.

It also has a very steep learning curve.  This is not because Unity is particularly difficult to wrap your head around, but rather because of the sheer amount of knowledge that must be absorbed.  I started DevGame with extensive experience in both programming and game modding, so I wasn't entirely a fish out of water, but I was unfamiliar with both the environment and the association of particular tools with particular tasks.

The way I initially got started with game modding is by taking an existing level from a game and seeing how I could modify it.  I highly recommend this approach if you know what you're trying to figure out and you can find something approximately similar.  Start by tweaking minor details: flags, properties, attributes, and even scripting if the level uses it.  From there, identify the various building blocks that the level is composed of, and see if you can use those building blocks to make something new.  Eventually, you'll be writing your own levels from scratch.

Krag Vargenstone didn't lend itself well to this approach, however.  I therefore used a strategy of blasting through the Unity video tutorials and searching for any text-based tutorials I could find online.  This can be just as effective as the above method, but it can take much longer, as video tutorials are not a very time-efficient way to learn new information.  I found myself watching a lot of the videos on 1.25x or 1.5x speed.

As mentioned earlier on this blog, the Roll-A-Ball tutorial is the recommended starting point for new Unity users and is an excellent introduction, though it does not cover the 2D techniques used in Krag Vargenstone.  The UFO Game tutorial is the 2D equivalent, as it's basically building Roll-A-Ball all over again in 2D, but it can still be useful to do them both.  First, because UFO Game describes several topics implicitly while Roll-A-Ball describes them explicitly; second, because UFO Game condenses certain details while Roll-A-Ball enumerates them step-by-step; and third, because going through an unfamiliar exercise twice is better than doing it once.  On the other hand, if you have no intention of using the 3D features and don't want to spend the extra time doing Roll-A-Ball, feel free to skip it and save yourself the detour.

One very important thing for new users to keep in mind is that Unity does not play well with source control out of the box.  This page does a good job of covering the various peculiarities and describes how to fix them for Git.  (Be advised that it was written for Unity 4; the only difference for Unity 5 is that the Version Control -> Mode option should be set to "Visible Meta Files".)  For Subversion, the process is similar but shorter.  This page on the Unity site has a quick nine-step procedure, but you should still read the first article to gain a full appreciation of the problem.  In any case, all of the DevGame projects are using Git.

Since I develop on Windows, I also had to edit the template text file line endings from LF to CRLF as described in the aforementioned Git article.  Since these template files reside under Program Files (x86), it was necessary to launch the text editor - in my case Notepad++ -  as an administrator.  In Notepad++, I then had to run Edit -> EOL Conversion -> Windows Format on every file in the ScriptTemplates folder.

As an aside, I enjoyed figuring out that the name Krag Vargenstone was not chosen arbitrarily.  See if you too can figure out why.


  1. I completely second your point about watching multiple videos about the same unfamiliar topics. Totally worthwhile. Just hearing the vocab over and over is useful.

  2. Thanks! Appreciated! Never modded before, always just been an embedded C++ code monkey, so this is all new to me. Partway through the roll-a-ball one, will go to the UFO one next. :)

  3. You can set up git to automatically convert LF to CRLF, so you don't have to do it on your end.

    Also I haven't particularly noticed a difference running visible meta files vs invisible - git still appears to pick up the meta files regardless.