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: | or 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 BrowserThe 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 CompletionThis 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. =)
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 your own resources!| Jonathon Stevens (Mar 21, 2006 at 21:26 GMT) |
| Anton Bursch (Mar 21, 2006 at 21:33 GMT) |
| James Urquhart (Mar 21, 2006 at 22:06 GMT) |
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) |
| Mike Lilligreen (Mar 21, 2006 at 22:17 GMT) |
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) |
| Brandon Maness (Mar 21, 2006 at 23:41 GMT) Resource Rating: 5 |
| Gavin Bunney (Mar 22, 2006 at 00:03 GMT) |
| Treb Connell (formerlyMasterTreb (Mar 22, 2006 at 00:36 GMT) |
| Joe Rossi (Mar 22, 2006 at 01:00 GMT) Resource Rating: 5 |
| Daniel Eden (Mar 22, 2006 at 01:01 GMT) |
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 |
@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) |
| Tek0 (Mar 22, 2006 at 06:02 GMT) |
| Joe Rossi (Mar 22, 2006 at 07:16 GMT) Resource Rating: 5 |
| Stefan Lundmark (Mar 22, 2006 at 10:29 GMT) |
| Keith Frampton (Mar 22, 2006 at 12:55 GMT) |
| Ray Noolness Gebhardt (Mar 22, 2006 at 15:36 GMT) |
| Tom Spilman (Mar 22, 2006 at 15:51 GMT) Resource Rating: 5 |
| Mark Storer (Mar 22, 2006 at 17:11 GMT) |
#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) |
| Daniel Eden (Mar 23, 2006 at 03:31 GMT) |
| Joe Rossi (Mar 23, 2006 at 05:17 GMT) Resource Rating: 5 |
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 - 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 |
| Bardur Mikladal (Mar 31, 2006 at 13:34 GMT) |
| Tom Spilman (Apr 02, 2006 at 02:23 GMT) Resource Rating: 5 |
| Bardur Mikladal (Apr 02, 2006 at 11:06 GMT) |
but thanks for replying
| Shai Perry (Apr 20, 2006 at 01:05 GMT) |
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 |
It's fixed and will be in the next build.
| n8man (Jun 25, 2006 at 03:34 GMT) Resource Rating: 5 |
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) |
it is been a great IDE!
Congrats to the developers!
matt.
| Tom Spilman (Jan 04, 2007 at 00:06 GMT) Resource Rating: 5 |
| Ty Christopher (Feb 02, 2007 at 20:08 GMT) |
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) |
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.



5.0 out of 5


