Alpha Accesswebsite_badges_steamwishlistwebsite_badges_steamwishlist

Tag results

A weekend retreat with play tests


My good friend and Y.A. published author Maurene recently organized a “work retreat.” This was basically a short weekend getaway for a bunch of friends from different disciplines – writers, illustrators, storyboard artists, concept artists, and game development – to gather and bounce ideas off each other. Rather than a quick meeting, hosting this in a private home far from the city was a perfect opportunity to hyper-focus in a relaxed informal environment.

I just wanted to list a few takeaways I had from this:

An external deadline can be a good thing
Having the weekend scheduled in advance was a good milestone deadline that was forced upon me. I wanted the project to be in as polished a state as possible for its stage in development since a bunch of people would be playing it over the weekend. This turned out to be an excellent motivator – I noticeably increased my amount of production in the weeks leading up to this.

Scrambling to make sure all the multiplayer was solid before the play tests

Scrambling to make sure all the multiplayer was solid before the play tests

Note everything
The amount of data you can get from real play tests with “real” people is invaluable, to say the least. You are in a bubble during development, and as soon as you begin working on a project, you lose all objectivity. No matter what you think about your own game, real play tests will give you the cold hard truth about everything from fun factor to unnecessary fat to bugs you may have missed. The most important thing is to note everything – no matter how insignificant it may seem. The way in which players feel or react (not just what they say) is a great gauge.

Allow time to respond
If you have the luxury, give yourself time to iterate on your build with the same group of testers. It’s definitely important to test with a wide range of people, but if you can respond to some of the feedback quickly and have them play again, you can more easily determine if some ideas are on the right track or not. As this was a weekend retreat, it allowed for me to organize play tests in the morning, work on updates during the day, and test some of the changes again at night.

Eat pizza
We were each tasked with covering a meal. I’m so glad I chose make-your-own pizzas.

Break up your routine
Based in Los Angeles, we chose to drive out to Ojai and the change of scenery was a breath of fresh air (literally). I usually spend half my week working at home on development, music and audio, and the other half at our shared office space focusing purely on coding and art tasks. Although I love both environments, a break in routine is super healthy, inspiring, and energizing.

A quick break during the work retreat

Some friends on a quick break during our work retreat

Always, always, always: have fun! You’re in the business of making fun, and you can draw from your real-world experiences.

Trello: simple task management for a tiny team


I just wanted to write a quick post about a very useful, indispensable, task management tool – especially for small teams: Trello. On the surface, it appears to be a simple todo list, but it’s very open-ended and fun to use, and has terrific mobile apps to boot!

Some of the completed todos on Hawken during crunch

Some of the completed todos on Hawken during crunch

When I worked on Hawken at Adhesive Games, we used some more robust and deeper tools out of necessity. The team grew quite large over time, which required our task management system (Atlassian JIRA) to be tightly integrated with our source control system (Perforce). However there were many periods of intense crunch, and for some of the strictly bug-squashing weeks we needed to be more agile and moved to a quick system of using post-it notes on a big wall. There is a real visceral sense of accomplishment when you grab a note and move it to the “done” stack, and it’s easier to see the massive progress from the team as a whole – a great morale booster. Trello mirrors this approach, and that’s why it’s so satisfying. As a fun fact: the Hawken team started out using Trello when we were only about 9 people or so.

As Sombr is an extremely small (as small as it gets) studio, I like to organize my Trello boards as such:

Trello Boards

  • Company Tasks (business items, marketing, legal, registrations, etc)
  • Game Dev (engineering tasks and bugs for the project)
  • Game Ideas (any feature ideas still in consideration before going to implementation)
  • Game Assets (todos for asset production such as audio and graphics)
  • Game Tools (todos for in-house tool development and tool bugs)

Check it out for your own project. It’s free to use, with paid plans for larger needs, so there’s no risk in seeing if it accommodates your team’s workflow.

Custom Build Tools


While it’s easy enough to use Unity’s built-in build tools, you can make more customized build commands that are specifically tailored towards your game. This allows you to perform some tasks prior to exporting the final build, such as dynamically generating data files, or dynamically building a list of scenes to include.

buildTools

I have a custom class extending EditorWindow, and on that window I have some simple buttons that perform build-related tasks for me. Here are some simple examples, and I’m sure you can think of more that apply to your own game to save you some time:

Generate a dynamic, custom data file used by the game:
In my example, I will have many “maps” which are Unity scenes loaded into a main scene by LoadLevelAdditive(). I have a build tool that opens every single map, gets information about it, and saves all this data (width, height, supported game modes, etc) to a master maps.json file. That way, my game menus and logic can pull this info from the file at runtime.

Define build scenes in a Constants file, and add them to the build when generating:
This is useful if you have tons of scenes that will be loaded additively (such as my maps from above), and you don’t want to add them all to the build settings dialog manually. If you have a lot of churn during development, with maps being deleted and created continuously, this is a big time saver. I have my main build scenes defined in a Constants.cs file, and I combine this list with all my maps not in the list at build time. Here’s a quick example that doesn’t work on its own as a lot of surrounding code is missing, but gives the general idea:

//---[ Constants.cs ]--------------------------------------

// scenes to include in build (in Constants.cs)
#if UNITY_EDITOR
public static string[] BuildScenes = {
	"Assets/Scenes/TitleScene.unity",
	"Assets/Scenes/OptionsScene.unity",
	"Assets/Scenes/PlayerSetupScene.unity",
	"Assets/Scenes/BattleScene.unity"
};
#endif

//---[ build tools ]---------------------------------------

// combine all the scenes to include:
List allBuildScenes = new List();
allBuildScenes.AddRange(Constants.BuildScenes);
allBuildScenes.AddRange(otherScenesToInclude);

// finally, generate the build:
BuildPipeline.BuildPlayer(
    allBuildScenes.ToArray(),
    buildExportPath,
    buildPlatformTarget,
    BuildOptions.None
);

Pull in information and data from external sources:
I have a data file hosted on a web server that makes it easy for myself and others to continuously contribute to it whenever we have ideas. I can pull down this file in my build process and sync it with the game’s version. That way, we can contribute to it at any time, and it will be included in the next build:

// import external data file
WWW dataFileWWW = new WWW(dataURL);
while (!dataFileWWW.isDone)
{
    EditorUtility.DisplayProgressBar("Importing data...", dataURL, dataFileWWW.progress);
}
File.WriteAllText(Application.dataPath + "/Resources/data.txt", dataFileWWW.text);
AssetDatabase.Refresh();
EditorUtility.ClearProgressBar();

Tiled map tools with Unity


The arrival of Unity 4.3 brought solid 2D support. Though some issues are being fixed with dot releases and some support is still outstanding, it already provided a solid foundation to prototype (and continue development on) this project. Without giving too much away, one thing that I needed from the outset was an easy way to build tile-base maps quickly, with variable flexibility.

Of course, I began researching existing tools, which are quite mature at this point. One of the favorites is Tiled, and another relative newcomer is Pyxel Edit (which I’ve been using for design and animation production). Getting Unity to play with Tiled was pretty painless and surprisingly simple. I saved my Tiled maps in .json format, and wrote a simple loader (using SimpleJSON) that would import a map into my project. Here’s some example code for the importer:

public void LoadMap(string mapPath)
{
	// read in and parse the .json map file exported from Tiled
	TextAsset mapData = (TextAsset)Resources.Load(mapPath);
	JSONNode json = JSON.Parse(mapData.text);
	
	// bitmasks defined from the Tiled map format specification
	uint flippedHorizontally = 0x80000000;
	uint flippedVertically = 0x40000000;
	uint flippedDiagonally = 0x20000000;

	int width;
	int height;
	int row;
	int column;
	uint tileID;
	int tileIDOffset;
	float xscale;
	float yscale;

	// for each Tiled layer
	for (int layer = 0; layer < json["layers"].AsArray.Count; layer++)
	{
		// get the width and height of the layer (in tiles)
		width = json["layers"][layer]["width"].AsInt;
		height = json["layers"][layer]["height"].AsInt;
		
		// for each tile in the layer
		for (int i = 0; i < (width * height); i++)
		{
			// pull the tileID, and use bitmasks to determine any transformations
			tileID = json["layers"][layer]["data"][i].AsUInt;
			xscale = ((tileID & flippedHorizontally) != 0) ? -1.0f : 1.0f;
			yscale = ((tileID & flippedVertically) != 0) ? -1.0f : 1.0f;
			tileID = (tileID & ~(flippedVertically | flippedHorizontally | flippedDiagonally));

			if (tileID != 0)
			{
				// get tile information
				tileIDOffset = json["tilesets"][0]["firstgid"].AsInt;
				row = (int)(i / width);
				column = (int)(i % width);

				// do stuff pertaining to your game with your tileID here
				// ...
			}
		}
	}
}

The issue I had with these (and most other) tilemap editors is that they are based on single tilemap image atlases. This is understandable for their purpose, but it also assumes that during an entire development cycle, your tilemap shouldn’t change and is complete from the start. If you have a bunch of maps based on a certain image atlas, the entire system becomes fragile. Unless you are simply adding new sprites, you don’t have the option of rearranging tiles, or replacing content, without affecting all maps based on it. Not only that, but Unity Pro supports automatic image atlasing, which means my tilemap image shouldn’t have to be pre-determined – I don’t need a tilemap atlas. I needed an editor that was based on soft-links to tiles, and in Unity’s case, prefabs.

I began exploring the notion of creating my own editor panel, and in just a few days, I had a completely working, flexible prefab-based tile editor that suited my needs perfectly. The nice thing about this is that it is easily extendable to support more features that this specific project requires without finding workarounds using other tools, or being “locked in” to a specific workflow.

Custom prefab-based tiled map editor using Editor Window in Unity.

Custom prefab-based tiled map editor using Editor Window in Unity. I know it’s weird that the “Bottom” layer is actually on top. :)

Some research brought me to an excellent tutorial by Daniel Branicki for tuts+ with the basics of creating your own editor window, drawing a grid, and snapping prefabs to the grid. I started my work extending Unity’s Editor Window class using this tutorial as a guide, and here are just a few notes that might help you in your tools:

DrawLines()
Rather than use the Gizmos.DrawLine() method, I used Handles.DrawLine() instead. The reason is that Gizmos.DrawLine() seems to be called continuously, slowing down execution, and if you draw transparent lines they quickly stack to create solid lines.

Clean OnGUI()
I like to break out my OnGUI() code into functions based on sections of the UI, for easier editing and maintainability. As an example, you can see how these match up to the UI screenshot above:

void OnGUI() 
{
    SectionFileOperations();
    SectionMapInformation();
    SectionLayers();
    SectionSettings();
    SectionTools();
    SectionTiles();
}

Easy Layers
My “layers” are based on Unity’s Renderer.sortingOrder. This is just a series of GUILayout.Toggle() controls that map to sortingOrders .

Respond to the Scene
To listen for input and respond to events in the Scene window (in my case to “paint” with prefabs and use keyboard shortcuts to activate tools), you need to add your Editor Window class as a delegate to OnSceneGUI, then implement the OnSceneGUI() function for your custom logic.

void OnFocus()
{
    SceneView.onSceneGUIDelegate -= this.OnSceneGUI;
    SceneView.onSceneGUIDelegate += this.OnSceneGUI;
}

void OnDestroy()
{
    SceneView.onSceneGUIDelegate -= this.OnSceneGUI;
}

void OnSceneGUI(SceneView sceneView)
{
    // custom scene & drawing logic here
}

Snap to Grid
In your Update() function, you can easily snap the selected object to a grid by setting the Selection.transforms position:

private Vector3 Snap(Vector3 point)
{
    Vector3 snappedPoint = new Vector3
    (
        (snapValue * Mathf.Round((point.x / snapValue))),
        (snapValue * Mathf.Round((point.y / snapValue))),
        (snapValue * Mathf.Round((point.z / snapValue)))
    );
    return snappedPoint;
}

void Update()
{
    foreach (Transform transform in Selection.transforms)
    {
	    transform.transform.position = Snap(transform.transform.position);
    }
}
©2017 Sombr Studio LLC