Game Development Community

Viewing TorqueScript VM assembly...

by Stephen Nichols · in Torque Game Builder · 03/20/2009 (9:25 am) · 3 replies

Does anyone know of a method for viewing TorqueScript VM "assembly code"? I've found the compiler / interpreter code in the engine without trouble. Pretty straightforward stuff...

However, I'm looking to formulate a set of best practices for writing "fast" TorqueScript. To that end, I'd love to view the disassembly of my compiled scripts.

Anyone know of such a tool? If not, I guess the worst case is that I'll write my own.

steve

#1
03/20/2009 (10:53 am)
I think there may be some tribes hacking tools and docs floating around the net. Do you really need to do this though? I mean you could use C++ instead. Hacking around with TorqueScript at that level seems like a waste of time to me, but knock yourself out ;)
#2
03/20/2009 (3:31 pm)
Joe:

Do you know of any links to such tools? Any info would be great.

Do I really need to do this? I think so. I've worked with many scripting languages over my game programming career: SCI, lua, ActionScript, UnrealScript, PHP, Perl, Python, etc. One of the things I've learned through my experience with these languages is this: Understand the performance implications of writing code in them.

Scripting languages are a godsend... they allow for more rapid iteration and open up opportunities for "noob" programmers (i.e. game designers and artists) to contribute to the logic of the game. In my experience, non-programmers take more easily to scripting languages than C++.

That being said about scripting languages; they can also be a terrible burden. Any code can be written poorly and run slower... but poorly written script code can be excessively underperforming. I want to take a peek under the hood of the VM to see what kinds of patterns would be poor performers. And, from that information, we can determine how to write efficient script.

steve
#3
03/20/2009 (11:43 pm)
I don't know of any TorqueScript disassembly tools... but i'd love to see one thrown together.

Honestly it shouldn't take too terribly long to do... i would jump at it if i wasn't in GDC crunch time.