Game Development Community

dev|Pro Game Development Curriculum

FrameTemp template class and COM in Torque

by Pat Wilson · 04/30/2005 (1:54 pm) · 8 comments

Yikes, it's been way over a month since my last .plan. The last one, I think, broke some records as far as the ratio between the length of the .plan and the number of comments.

What have I been up to? Well yesterday Marble Blast Xbox passed Xbox compliance testing and is going on to functional testing. I'm saving the serious celibration until I see the game up for download, but I do have the cover page of the compliance report with "PASS" circled in hi-lighter. With any luck the game will be out on Xbox Live Arcade before our next exciting announcment.

I can't talk at all about what I'm working on right now, unfortunatly, but it is a good thing for GarageGames and a good thing for indies. So instead I'll just ramble on about other things so I don't have a pathetic .plan length. Announcements will be made pretty soon with any luck. Here's a little teaser though...
public.garagegames.com/patw/omgwtfbbq.jpg
I've been adding to TDN so that when the doors open on it there will be articles already there. Thismorning I added one on the FrameAllocator, so you all can look forward to that when TDN opens. I also added a new support-class to the FrameAllocator. It's called FrameTemp and it's a templatized class. You use it like this:
FrameTemp<char> foo(32);
dStrcpy( foo, "Foo!" );
Which is the same as doing...
char *foo = new char[32];
dStrcpy( foo, "Foo!" );
delete [] foo;
The cool thing about the FrameTemp class (like the FrameAllocatorMarker) is that it will manage the watermark on the FrameAllocator by using scoping. It's really useful. I added it to support another class I wrote...

The other thing I started working on a bit is called ComConsoleObject. I'm not sure how familiar any of you are with Win32 COM, but it's a TorqueScript wrapper for COM objects. You can actually get an instance of a COM object, list the methods, call methods on it, etc...all from script!! So for example I can type:
new ComConsoleObject( itunes, "{0xDC0C2640,0x1415,0x4644,{0x87,0x5C,0x6F,0x4D,0x76,0x98,0x39,0xBA}}", "{0x9DD6680B,0x3EDC,0x40db,{0xA7,0x71,0xE6,0xFE,0x48,0x32,0xE3,0x4A}}" );
itunes.invokeMethod( "pause" );
And iTunes will pause! It's pretty sweet. (If you are wondering what that huge hex string is, it is the CLSID and IID of the iTunes COM object. Yes it is ugly.) Right now you can't pass arguments to functions (hehe) but I'm going to tinker with it, and maybe at some point you will be able to. Why do this? Why not provide scripters with the ability to tap into something like iTunes in Game Mods? I mean, hell, that's all I wanted to do was control iTunes while inside World of Warcraft. So now, in Torque, after I make it a bit more feature-complete, I could easily make, with 100% scripts, a little GUI window that would control iTunes. How cool is that?

Alright so you may be thinking, "You have too much free time," well, it's true. I got hurt playing soccer and I won't be able to do yoga or soccer or bike or (cry) dance at 80s night for a good long while I think. So until then, though, I'm going to go back to swimming, which I used to compete in when I was little (and not as engulfed by evil) and program silly things, and work on my Ultramarines. Anyway, enough about non tech stuff. If you want more of that you can always visit my blog for the latest in non-GarageGames, and innappropriate things.

#1
04/30/2005 (4:42 pm)
Pat, your blog is quite entertaining. :) Glad you linked to it.
#2
04/30/2005 (4:43 pm)
Not to mention that COM will only work in windows :)
#3
04/30/2005 (7:44 pm)
Your personal blog rocks.
I didnt even know you were that young. (23)
#4
05/01/2005 (8:36 pm)
Great news on the xbox front.
#5
05/02/2005 (7:30 am)
Yeah the Windows only COM thing sucks. I wonder is mozilla's XPCOM might help you (I have no clue).
#6
05/02/2005 (10:46 am)
The problem is, I wrote it for iTunes (primarly) and it uses regular COM. I'm not sure what the Mac equivilant is, if there is one. It seems like XPCOM is a bit fringe. I'm really not sure.
#7
05/03/2005 (1:12 pm)
On Macintosh the equivalent iTunes hooks come via AppleScript, I believe. But I think sample code is in some darker corner there to find a decent example of interacting with iTunes.
#8
05/26/2005 (9:10 am)
That COM control is right up the alley of something we need to do. Any chance of seeing it as a resource anytime soon, even an incomplete one some of the rest of us could work on?