Why Depth is Important

Generally speaking, your education will expose you to a lot of different ideas and make you a well-rounded individual. That said, while breadth is important, having an area of specialization can make all the difference in the world. As a newbie, the value of this isn’t inherently obvious: doesn’t a more varied skill set keep more options open? Sure, big teams might need focused specialists, but wouldn’t small teams favor generalists? It’s actually surprisingly simple: having a specialist on your team, or at least knowing someone to go to, makes things a lot easier when you get stuck.

When I was working on Carbon Conquest (an RTS being made in Unity3D), I had a lot of trouble optimizing the fog of war. Essentially, the fog was created by creating a semi-transparent black texture, then drawing fully transparent circles in it at each unit’s position. The texture was then projected onto the terrain. This looks exactly how you’d want it to, but generating the texture was a real bottleneck. The naive implementation I started with just created a 2D array of colors in code, drew the circles in all via C# script, then copied the color data over to the fog projector’s texture. Obviously, doing this every frame in a component script is going to slow things down.

As this looked perfect but just ran too slowly, I wanted to re-write the texture generation as a shader to speed things up. Couldn’t be too hard: you just need to go through a bunch of location data and change the texture’s color if it’s close enough to a unit at that location. I started to learn Unity’s shader language via a pretty awesome tutorial, but I got stuck: how should I get the unit position data over to the shader? Based on what little I’d learned, I had this dilemma: “I can pass data to the shader, but only via constants, and we have a variable number of units… huh.” And right there, I was stuck. To the internet! ….well, googling didn’t help whatsoever. To other human beings!

Alright, I’ve got friends who’ve done graphics programming, I’ll ask them! As it turned out, everyone I thought to ask had only really dabbled in graphics programming, so they weren’t really sure either. At that point, I was stuck with two options: 1. learn graphics programming in depth, or 2. hack it and actually finish the game before the deadline. Obviously, we went with option two. The fog of war would now only update once per second. Turns out this actually looks alright by virtue of older RTSes having similarly “choppy” fog of war (w00t!), but it would’ve been nice to have something more responsive.

Had either I or one of my friends had the appropriate depth of knowledge in graphics programming, we could’ve probably figured out a more efficient approach that would have ultimately led to a better gameplay experience. Instead, we had to settle on a hackish workaround. Generalists are good, but if you want to deliver the best possible product/game/experience, you’re going to want to have someone who really knows a given subject. Ideally, you’ll be someone with a broad skill set who also has an area of expertise; this is the “t-shaped” skill set that companies like Valve are looking for.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s