Tuesday, March 24, 2009

Volition at GDC 2009

Hey if you're at this year's Game Developers Conference, be sure to check out the talks from my co-workers. Volition has a strong showing this year, with plenty of great tech artist material.

Blowing Up the Outside World: Destruction Done the Next Gen Way
by Eric Arnold and Jeff Hanna
This session presents an in-depth look at the tools and technologies used to make a truly destructible world for RED FACTION: GUERRILLA. The presenters will share the lessons they learned and the problems they had to overcome in order to have destruction in their game.

Technical Artist Roundtable
by Jeff Hanna
This roundtable will be an animated group discussion about being an effective technical artist. Topics of discussion will include what skills a technical artist should possess, how the role differs from company to company, scripting content creation applications, shader development, asset management, and improving production pipelines.

Technical Art Techniques Panel: Tools and Pipeline
Robert Galanakis, Jeff Hanna, Seth Gibson, Christopher Evans and Ross Patel
As game pipelines, their tools, and content become more complex, technical artists have become the developers of choice for much of the planning, overseeing, and implementation of pipelines. Technical artists from BioWare, Bungie, Microsoft, and Volition discuss their solutions and practices for tools and pipeline.

Breathing LIFE into an Open World
by Scott Phillips
Examine the history of populating open worlds and a detailed description and post-mortem of the LIFE system developed by Volition for SAINTS ROW 2. Attendees will learn about the inspiration, organization, methodology, successes and failures of the LIFE system used to add life to the open world city of Stilwater.

Universal Character System in SAINTS ROW 2
by Chris Fortier
Attendees will learn how SAINTS ROW 2's character customization and random NPC generator work. Some things that will be discussed include the universal body mesh, character morphing, normal map blending, layered clothing, shader-based customization features, how we assemble NPCs and how all this character variation affects animation.

Tuesday, March 17, 2009

Python cheat sheets

I'm out of hibernation, time I posted something.

As much as I use Python these days, there's a few things I find myself looking up regularly. At one point I just made a small crib sheet and stuck it to my monitor. I have examples on it for list comprehensions, filter, and map.

List Comprehensions
These are useful for creating modified lists from existing data without a lot of fuss. They aren't all that hard to remember, but the syntax was a bit alien to me for awhile. They're basically an expression followed by a for clause.

The below example takes an existing list, my_list and builds a new list with only the elements that are greater than 2. In this case the result is assigned right back to my_list.

my_list = [x for x in my_list if x > 2]
Filter
Using filter is a powerful way to remove undesired elements from a list. You pass a function as the first argument, which generally returns True/False based on some criteria. The second argument is the sequence to be filtered (or any iterable object). Only the elements that return True when passed to that function will remain in the newly returned list.

Filtering is often done with a lambda as the first function argument. A lambda is a one-off function that's defined and used in the same place. Since it's only used once, it doesn't need a name. It's so common to see filter and lambda together, the fact they were seperate didn't occur to me when I was learning the language.

In this example, we have a list of filenames, my_files, and we want to remove any that aren't Python scripts, ending in '.py'.
my_files = filter(lambda f: f.endswith('.py'), my_files)
That is the shorter equivalent of:
def is_py_filename(filename):
   return filename.endswith('.py')

my_files = filter(is_py_filename, my_files)
With filter, passing None as the first argument instead of a function automatically removes any elements that don't evaluate to True. That includes integers or floats that are zero, as well as occurrences of False or None.

my_files = filter(None, my_files)
Map
Mapped functions let you apply a function to every element in a sequence.
def add_ten(x):
   return x+10

result = map(add_ten, [1,2,3,4,5])
The value of result would be [11, 12, 13, 14, 15]. Of course you could also use a lambda here, too:
result = map(lambda x: x+10, [1,2,3,4,5])
So what's on your cheat sheet?