Previous Blog Next Blog
Prev/Next Blog
by date

Torsion Updated!

Torsion Updated!
Name:Tom Spilman
Date Posted:Mar 21, 2006
Rating:5.0 out of 5
Public:YES
Comments:YES
RSS Feed:GarageGames Blog feedor Subscribe with .
Profile Page:View profile page for Tom Spilman

Blog post
First off I'm at the GDC this week. If anyone wants to meet up just drop me a name and phone number to tom AT sickheadgames DOT com and I'll give you a call back. I hope to spend some time with the GG guys talking Torsion and checking out all the cool new stuff they're about to unleash upon us. =)











So aside from contract work Torsion has been my primary focus of late. Today I released a new version that has a significant amount of improvements. I think this will be the final alpha release. The next release will be a beta and be 100% feature complete.



A few notable changes:
  • New project setting allows ignoring of select mod folders in both the project tree and for code completion.
  • Enabled code completion for fields within object and datablock declarations.
  • Script compiler errors are highlighted in the output window and they are double clickable.
  • New error display within output window for spotting errors quickly.
  • Added visibility toggle of left and bottom panes in view menu.
  • Added preferences dialog exposing all customizable IDE settings.
  • New optional pre-compile dumps the syntax errors of modified scripts into output window before execution.

Precompiler
IMO the coolest thing in the new release is the script precompiler.



When enabled it will compile any changed scripts before you launch your game. If you have any syntax errors they will be caught and reported in the output window. It works by calling your game executable with a special script file which just compiles a list of scripts. Since it uses your Torque executable it's always accurate and never misses or reports false errors. Say goodbye to alot of wasted time with this one feature.

The down side is that it assumes your Torque executable will run the script passed to it. If you have disabled this feature in your executable it won't work. I've added the ability to toggle it off per config to deal with that case.


Code Browser
The code browser has started to get a face lift, but it's not finished for this release. I've started to add filtering for different classes of identifier, but the mix isn't final yet. It now also shows the base class/datablock when you expand an object which is pretty handy. When you double click on an item it will take you to the script and line that identifier is declared in or will show you a list of locations to choose from.

I could use some feedback on this area of Torsion. There is a ton of data to display here and it's been challenging finding a way to display it all. I'm starting to think i need to do something different that what is normally seen in most IDEs.




Code Completion
This release has my third and final refactor of the code completion scanner engine. It took me a couple of tries before i got the design right as when i started the Torsion project i was pretty much a TorqueScript neophyte. Aside from the internal changes and performance improvements i added dot completion for the special %this local. I didn't get time on this pass, but it's all ready now to finish off all the other typical code completion features. I'll be on this right after GDC.





Preferences
Finally i've begun the process of exposing the preferences stored in the xml file to the IDE. All the coloring stuff is there as well as a few other toggles including tab size and type, disabling code folding, and code completion. There will be more options added now that the framework is in place to easily edit them. If you have a pet option go ahead and log it into our bug tracker.

Well... gotta get some lunch and rub elbows with industry folk. =)


Download Torsion
v1.0.544 Alpha

Recent Blog Posts
List:03/03/07 - Sickhead is hiring!
05/31/06 - Torsion Update
04/03/06 - Torsion Update & TelnetDebugger Fix
03/21/06 - Torsion Updated!
02/28/06 - Precipitation for TSE
07/18/05 - Plan for Tom Spilman
05/26/05 - Plan for Tom Spilman
05/21/05 - Plan for Tom Spilman

Submit ResourceSubmit your own resources!

Jonathon Stevens   (Mar 21, 2006 at 21:26 GMT)
in the words of a great leader and inspirational speaker, Cartman from SouthPark, "keeeeeeeick assss"

Anton Bursch   (Mar 21, 2006 at 21:33 GMT)
The best decision I have made since purchasing the Torque license has been using Torsion.

James Urquhart   (Mar 21, 2006 at 22:06 GMT)
Nice work, Tom.

Can't wait for a mac version, which would be helpful as i am planning on getting one of those new intel macs soon :)

Hokuto   (Mar 21, 2006 at 22:13 GMT)
Great Stuff Tom, Torsion rocks!

Mike Lilligreen   (Mar 21, 2006 at 22:17 GMT)
Thanks for the update Tom, Torsion is great.

Can't get this new version to run under WinXP though, loader error message is: "The procedure entry point GetProcessId could not be located in the dynamic link library KERNEL32.dll"

Oh well, back to the old alpha for the time being.

Matt Huston   (Mar 21, 2006 at 22:29 GMT)
Just started using Torsion last week after using Textpad for the last year. Excellent IDE for TS :)

Brandon Maness   (Mar 21, 2006 at 23:41 GMT)   Resource Rating: 5
Outstanding work as always! External window concept sounds useful, downloading now..

Gavin Bunney   (Mar 22, 2006 at 00:03 GMT)
torsion just rocks!

Treb Connell (formerlyMasterTreb   (Mar 22, 2006 at 00:36 GMT)
Torsion has made torque script so much easier, thanks.

Joe Rossi   (Mar 22, 2006 at 01:00 GMT)   Resource Rating: 5
I've been using Codeweaver but I'll give this a spin, the precompiling feature sounds useful. As it is I'm still using Dev-Cpp for my scripting IDE :o I know, I have to move on...

Daniel Eden   (Mar 22, 2006 at 01:01 GMT)
"Since it uses your Torque executable it's always accurate and never misses or reports false errors."

I don't know if this statement is intended how I read it, but as I see it, it's not exactly true. I've been using a similar script-based method of precompiling scripts and checking for syntax errors through UltraEdit 32 for about three years now and one thing I've noticed is that once you actually get into the nitty gritty of things, you'll eventually get "false" syntax errors occurring due to script dependencies.

For example, if I have a datablock that inherits/derives/copies its values from another and I haven't loaded it, it'll pop up an error. Similarly if I define a global variable in another script (say a filename or a setting) and attempt to use it without first calling that script, it could error -- or not report an error at all.

Even executing a list of scripts isn't really an answer to the problem since there's no easy way to define which scripts require which others. Executing them all can be painful -- especially if you're doing anything even remotely tricky with execution order (like say, only having the scripts that are necessary for the engine to host a server execute just prior to launching the server itself).

Still... If you've thought of any way around these issues, I'd like to hear it. I'm always up for improving the coding pipeline (it's like an art pipeline but geekier). Because of the limitations of command-line compiling, I only use it once in a while now. It's generally been easier and required less fiddling just to get the game running and to re-execute the scripts mid-play.

Tom Spilman   (Mar 22, 2006 at 01:09 GMT)   Resource Rating: 5
@Joe -Any particular issue that keeps you using Dev-Cpp instead of a TorqueScript targeted IDE?

@Daniel - The trick is that i'm not using exec(). exec() executes the scripts and as you say it would cause tons of false errors because of script dependencies. What i do is call compile() on the scripts... this only generates a DSO or produces syntax errors. It does not load or execute the script.

So it's doing exactly what it says... compiles the scripts. It does not attempt to spot runtime errors.

And thanks for all the praise guys!

Tom Bentz   (Mar 22, 2006 at 03:34 GMT)
Awesome! Torsion is excellent for Torquescript and it keeps getting better and better!

Tek0   (Mar 22, 2006 at 06:02 GMT)
@Tom, I'm really happy Torsion! You have done a great job with it and like what "Master Treb" said, Torsion makes torque script so much easier. Thankyou so much!

Joe Rossi   (Mar 22, 2006 at 07:16 GMT)   Resource Rating: 5
@Tom, the main reason is external tools support. I currently run .bat files that call GCC over my script(s) before running them, because I use the GCC preprocessor for macros and to strip comments from the final code. The only other reason is familiarity, I've used it for years :)

Stefan Lundmark   (Mar 22, 2006 at 10:29 GMT)
This looks really great! Keep going.

Keith Frampton   (Mar 22, 2006 at 12:55 GMT)
Looking good! Even better is the mention of a Linux version down the road. I look forward to trying it out!

Ray Noolness Gebhardt   (Mar 22, 2006 at 15:36 GMT)
@Tom, Just so you know, the new Torsion is awesome. I like that I can change my background color and fonts with a lot of flexibility. I was using Vim to editor TorqueScript files before this release, but now I think you have me sold.

Tom Spilman   (Mar 22, 2006 at 15:51 GMT)   Resource Rating: 5
@Joe - Humm... so what you need is a preprocesss step that occurs before the precompile and execution of the script. Anyone see other uses for this if i would add it?

Mark Storer   (Mar 22, 2006 at 17:11 GMT)
@Tom: All the usual stuff you can do with a precompiler:
#define setXY( vector, x, y ) ...
#ifdef _DEBUG
//dump all kinds of stuff to the console, draw collision boxes, whatever
#endif
#include <pile_of_precompiler_settings.h>

Macros might be useful because I don't think TorqueScript does any "compiler inlining" or other spiffy optimizations of a heavy duty compiler like GCC or its ilk.

#define PLAYER_HEALTH 100
REAL CONSTANTS!

"#if FOO" could be useful in a wide variety of settings (debug vs demo vs release scripts).

If you add a true precompiler (gcc's for example), you can make use of some of the Crazy Stuff going on in boost.org's precompiler library.

http://www.boost.org/libs/preprocessor/doc/index.html

A fair amount of the preprocessor library is C++ specific, but enough of it isn't to be worth a second look. Preprocessor arrays, supporting insert/delete/push/pop. And it's all done by the preprocessor, so looking up elements of the array costs ZERO at run time. Sure, it's only good for arrays of constants, but still quite handy.

They also have facilities for code generation (creating many nigh-identical versions of a function), among other things.

Eric Elwell   (Mar 22, 2006 at 19:47 GMT)
I always hear how awesome this game is, it's just that i don't know how to play.. :(

Daniel Eden   (Mar 23, 2006 at 03:31 GMT)
Doh. I was hoping you'd have some way to make doing it actually worthwhile... Oh well. =)

Joe Rossi   (Mar 23, 2006 at 05:17 GMT)   Resource Rating: 5
@Mark:
I'm doing most of that, no boost stuff yet but that sounds interesting. #define "constants" are great for my little integer based "message system". Another thing is being able to #ifdef DEMO //skip some code...

@Tom:
If you are considering adding this feature I will really appreciate it! But writing a preprocessor is no fun so incorporating GCC may be the easiest way. What I do is run a batch file over my scripts one at a time for now, with a command like this :

gcc -E -P -x c %1 -o %~p1%~n1 

And pass the full filename to this batch script. That will only preprocesses the source file, named with an extension .h.cs and outputs a .cs file of the same filename in that directory. It's cheesy but it works for me. However it can be tedious when I edit lots of files or frequently change one file...

Edit: Sorry to bug you but I tried the current alpha of Torsion and I got an error, "Loader Error - The procedure entry point GetProcessId could not be located in the dynamic link library KERNEL32.dll". It could just be my system since I installed lots of stuff over the past few weeks...
Edited on Mar 23, 2006 05:24 GMT

Tom Spilman   (Mar 23, 2006 at 05:34 GMT)   Resource Rating: 5
@Joe and Mike Lilligreen - I found this issue .... GetProcesssId is a feature added to WinXP Service Pack 1. If you want to get Torsion working right away you'll have to update, but i need to remove this dependency as i don't want to screw Win 9x people. Thanks for reporting this guys.

@Joe - Well... i thought i could maybe add an option in the project preferences to execute a user specified command before executing any game code. This way you could launch GCC to do whatever you like.

Joe Rossi   (Mar 23, 2006 at 23:39 GMT)   Resource Rating: 5
Awesome Tom, that way will be more flexible. If you end up doing this would it be too much to ask for a way to pass the filename, directory path, etc in with that command?

Bardur Mikladal   (Mar 31, 2006 at 13:34 GMT)
can torsion do the same as visual basic?.. i mean.. can i do ALL my scripting in Torsion and what about compiling.. don

Tom Spilman   (Apr 02, 2006 at 02:23 GMT)   Resource Rating: 5
@Bardur - Torsion is a complete environment for editing and debugging TorqueScript for use with any of the Torque engines. It does not have anything to with Visual Basic and it does not compile C++ code.

Bardur Mikladal   (Apr 02, 2006 at 11:06 GMT)
Ok.. thanks Tom... i kinda figured that out yesterday... after posting hehehe

but thanks for replying

Shai Perry   (Apr 20, 2006 at 01:05 GMT)
Hey Tom,

The new torsion doesn't let me type in a question mark. I.e., try to type '?' in any script in torsion...
It worked in the old version, what happened??? :^)

Tom Spilman   (Apr 20, 2006 at 02:14 GMT)   Resource Rating: 5
@Shai - I either subconsciously decided that question marks are unnecessary or that was just a stupid bug on my part. =)

It's fixed and will be in the next build.

n8man   (Jun 25, 2006 at 03:34 GMT)   Resource Rating: 5
I love Torsion! Seriously, we're getting married. We're in love and we're not going to let anybody get in our way!

So we're using Torque with Torsion (not to be confused with Certs w/ Retsyn) in my Game Dev class at BCC (see sporadic notes of nominal quality at http://riki.thegameaddicts.net). There was a few of us who... don't read instructions. So there were problems in setup. But once it's up and running Torsion is a dream to use! I was editing most of the things in notepad before and it's just not cut out for the job. After using Torsion I don't get confused about which file I'm in anymore which is SOOOO nice.

One request, though (and somebody chime in if you agree or disagree), can you make the window scroll effective on mouse-over? Currently you have to click in the window that you want to scroll, and it's a bit annoying. It's a small thing, but it can make Torsion that much friendlier. Is "friendlier" a word?

Thanks for the quality product.

n8

Matthews_30   (Jan 03, 2007 at 23:47 GMT)
does it have spelling check? i am using it, but i hate when "function" does not convert to "Function" or when "imagemap" is not the same to "ImageMap" :(

it is been a great IDE!

Congrats to the developers!

matt.

Tom Spilman   (Jan 04, 2007 at 00:06 GMT)   Resource Rating: 5
@Matt - No spellcheck yet... i'll look at that in 2.0.

Ty Christopher   (Feb 02, 2007 at 20:08 GMT)
First let me say I love Torsion! I bought it as soon as it came out. I am having a problem with the pre-compile step though.

I intentionally created a syntax error in a script to check out, and it works as expected in TGE 1.5. In the Shader / Advance EA Engine however it just blows right past the syntax errors and starts the game.

In TSE, however, Main.cs calls an init.cs that contains the exec calls. (IMO a better way to keep track of your scripts).

I even placed the syntax error as high as the >> GameName/main.cs and pre-compile never fails.

Ty Christopher   (Feb 02, 2007 at 20:17 GMT)
Tom says:
This is a bug in TSE/TGEA...

http://www.garagegames.com/mg/forums/result.thread.php?qt=56841

This should appear in the next TGEA release, but until then if you make that fix then syntax errors will reappear in Torsion.

PS Tom is my hero!

You must be a member and be logged in to either append comments or rate this resource.