July 2nd, 2008
They published the second article I cowrote with Eric Hartman on GameDev.Net. Go read MAME Mine: Wacky Sports. It’s about the game design lessons to be found in the wacky sports genre. We talk about everything from Mario Kart to Pig Skin.
Our first article on MAME games is still up, too.
Enjoy!
Posted in General | No Comments »
June 12th, 2008
Say you’re working on some sort of reflection/deserialization system in Flex, Flash, or another ActionScript 3 technology. It would be nice to know the type of all the fields on an object or class, including accessors, so that you can automagically infer the right way to parse your serialization data. You can use describeType to do this but it has some overhead - dumping a full XML description of a complex type can’t be something you’d want to do frequently, and then you have to parse it again.
I present the ClassFieldCache. It contains one static method, getFieldsOfClass, which will return a dictionary of types indexed by field name. It returns every kind of property you can set - both fields and accessors. (And it ignores constants and readonly accessors.)
Usage is like this:
var dict:Dictionary = ClassFieldCache.getFieldsOfClass(myObject);
trace("Field boo is of type " + dict["boo"]);
Which outputs “Field boo is of type flash.geom::Point” - or whatever that field happens to be.
And the class itself is as follows:
import flash.utils.*;
/**
* Utility class to get list of fields on an object or class.
*/
public class ClassFieldCache
{
/// Indexed by Class, this contains dictionaries mapping name to type (string).
private static var smFieldInfoCache:Dictionary = new Dictionary(true);
/**
* Return a dictionary describing every settable field on this object or class.
*
* Fields are indexed by name, and the type is contained as a string.
*/
public static function getFieldsOfClass(c:*):Dictionary
{
if(!(c is Class))
{
// Convert to its class.
c = getDefinitionByName(getQualifiedClassName(c));
}
// Is it cached? If so, return that.
if(smFieldInfoCache.hasOwnProperty(c))
return smFieldInfoCache[c];
// Otherwise describe the type...
var typeXml:XML = describeType(c);
// Set up the dictionary
var typeDict:Dictionary = new Dictionary();
// Walk all the variables...
for each (var variable:XML in typeXml.factory.variable)
typeDict[variable.@name.toString()] = variable.@type.toString();
// And all the accessors...
for each (var accessor:XML in typeXml.factory.accessor)
{
// Ignore ones we can't write to.
if(accessor.@access == "readonly")
continue;
typeDict[accessor.@name.toString()] = accessor.@type.toString();
}
// Don't forget to stuff it in the cache.
smFieldInfoCache[c] = typeDict;
return typeDict;
}
}
Hope this is useful for you. You’re free to use it however you like. Attribution would be appreciated.
Posted in General | No Comments »
May 30th, 2008
Posted in General | No Comments »
April 14th, 2008
I’ve been reading articles like this interview of the Crytek guys lately. I feel bad for them. The interviewer really wants to hear how ray tracing is the future, and they don’t want to break his heart and tell him that it’s not going to be all that important.
Look, here is how the future will be. You don’t have to bug the CTO at Crytek to find it out. I can tell you just fine.
GPUs are fast because it’s easy to optimize for heavily vectorized code. GPUs are trending towards having general purpose computing abilities. Unfortunately, they suck at that because making general computation fast is a lot harder than running the same combinations of math and texture sampling on N pixels simultaneously. IBM and Intel have spent billions of dollars and man-centuries on this problem; it’s unlikely that ATI or nVidia is going to do anything groundbreaking here. And in fact when you start doing really general purpose stuff like geometry shaders, you quickly find that they run dog slow. Slower than the same calculations on the CPU.
Read the rest of this entry »
Posted in General | 2 Comments »
April 7th, 2008
For the first time in years, and for only a brief period of time, my personal inbox is completely empty. No new mail, nothing to reply to.
It feels really good.
Update: Well, it only lasted an hour. But it was a GREAT feeling while it lasted.
Posted in General | No Comments »
April 1st, 2008
Game Programming Gems 7, which has a chapter by me on clipmaps, is out. Very nice!
There’s errata - they forgot the sample app on the CD. You can download the missing app at this URL. Please drop me an e-mail if you run into any problems compiling or have any questions at all - I switched hard drives recently so it might not be the very latest code.
GameDev.Net also is running an article that I and Eric Hartman wrote titled Learning From The 3000 “Classics”: What can MAME teach us about game design?. Pretty cool! So far all the comments have been positive. Cut us down to size and tell us what we did wrong here.
Posted in General | No Comments »
February 26th, 2008
My talk at GDC this year went well! A bunch of people showed up, they laughed when I wanted them to, and asked some good questions. I hope my ratings are good enough I can go back next year.
The promised follow up page is ready to go. You can get my slides and find some links to useful Tamarin resources. Enjoy!
Posted in General | 1 Comment »
February 15th, 2008
They took this for a DVD product that never ended up making it to market - so now it’s up on Google Video. Enjoy.
(PS - If you’re into game dev, you might want to check out the other videos in the “more from user” tab on the full page version… Is there any way to link that page directly?)
Posted in General | 2 Comments »
February 12th, 2008
I posted a .plan at GarageGames on this subject.
Short answer: I’m presenting on Tamarin (the scripting runtime behind Flash 9) at GDC 2008. Steven Johnson of Adobe has been nice enough to let me give the talk at Adobe, too. If you’re in the vicinity of San Francisco and you don’t have a grand to burn on getting into GDC, this is the preferable choice. Just post a comment or drop me an e-mail and I’ll let you know exact time/place.
Posted in General | No Comments »
October 27th, 2007

It took a few years, but I finally released the fixed function GL forest renderer I was working on for Torque. You can find out all about it at my .plan on GarageGames. Various businessy things got in the way of releasing it (and perhaps a bit of apathy on my own part
… but it’s nice to have it out! Done with? We’ll see. There’s always a lot of question/answer and trouble-shooting to go with these things.
On a personal level, I like to think this heralds a new chapter of my life, where things Just Get Done a lot more often. We’ll see how that pans out.
Posted in General | No Comments »