Enabling our artist to work faster

We are creating out first game using Unity 3D (Pro) and as I previously posted, tile based graphics.  The problem is that our artist does not have Unity 3D AND he is working just over 2000 miles away.  This means that each time he needs to see how a new tile looks in the game, he needs to upload the file to our shared folder, email us that there are new tiles, wait for us while we add it to the game, take a screenshot, and email it back.  Seems like it wouldn’t take that long, but since we left our previous jobs we have been trying to check our email less frequently because it can be a huge distraction.  Also, since he is 2 time zones away our work schedules don’t match up that well.

Our artist’s major hurdle is that the tiles he is creating look good at the size and resolution he is creating them at, but look completely different after importing it into the game.  Due to the distance and poor testing setup, it became obvious that the iterative process that game-art requires did not have the fast feedback that is a core part of the process.

As we slowly came to this realization, one of us came up with the idea to create a build that used replaceable art…. meaning that the build of the game would load specifically named textures into the scene at runtime.  This only took a few hours out of an afternoon (mainly because I hit a couple bugs), but it should help speed up how our artist can iterate on his work.

While putting the scripts together, I came across a few things that may help anyone that reads this.  The first, is that the www class in Unity makes it super simple to load textures from other locations.  Check out this bit of code:

IEnumerator LoadTexture(string i) { 
    m_location = m_baseDir + i + ".png"; 
    WWW someWww = new WWW(m_baseDir + i + ".png"); 
    yield return someWww; 
    loadedTextures[loadedTextures.Count - 1].wrapMode=TextureWrapMode.Clamp;
    loadedTextures[loadedTextures.Count - 1].Apply(); 

That’s all the import part of the script ended up being… it was simple and relatively painless.  A problem that I ran into was that I attempted to change the wrapMode on the someWww.texture prior to saving it to my loadedTexture list.  WWW.Texture is read only so that didn’t work and I don’t recommend trying it and adding other code-bandaids to try to cover it up, my attempt at unknowingly doing that wasted at least an hour.