Torque IDE
by Sam Bacsa · in Torque Game Engine · 07/18/2005 (5:12 am) · 75 replies
So I bought Torque a while back, then bought TSE, and I've found myself growing increasingly frustrated due to the severe lack of GUI available in Torque.
I've set out to design an IDE which I will gladly make available to everyone (free of charge, obviously) if people are interested. I am posting this here because I'd like some feedback from you guys ... as in, what would you like to see in an IDE? Would an IDE make your lives easier?
Here are some screenshots that I whipped together really fast, of what I have currently. Click on the thumbnails for a larger view.

This is the main interface. You can see the project explorer on the left, a rudimentary toolbar at the top, open file listing at the bottom, and the editor in the center. The editor is currently displaying an on-demand helper tip, which can be obtained whenever you press CTRL+SHIFT+SPACE, just like in visual studio. It will display help for the current function, so long as you're in its parentheses or right next to them.

Identifier tokens can also be moused-over to get brief information in a nice tooltip.

You can right-click on any identifier and have the editor take you straight to the definition of the function (so long as it's user-defined. Built-in functions can't be jumped to, of course).

Here's a view of the project explorer and the file properties dialog (which can be obtained by right-clicking on a file and selecting properties). The project system in the IDE is all "virtual". In other words, directories aren't really there, and files can take on different names from what they really are. You can even have two files of the same name if you wanted to. The paths are also all relative allow you to easily ZIP up your project definitions and distribute them if necessary, without breaking the links. Files can be dragged & dropped into individual folders. Deleting a file from the list won't delete it completely.

Custom functions have their own special tooltips on mouseover and quickinfo.

There is also a useful export feature for exporting formatted source code to either RTF or HTML.

Here's an exported block of code formatted to HTML.
Now that you've seen most of the features of this IDE, is there anything you'd like to see specifically? Please let me know and I'll do my best to code it in.
I'm already planning to have auto-complete for built-in events, interfacing with the Torque debugger, and other minor UI changes.
Let me know :)
Update :: July 19th

Added intellisense support and tidied-up the sidebar interface.
I've set out to design an IDE which I will gladly make available to everyone (free of charge, obviously) if people are interested. I am posting this here because I'd like some feedback from you guys ... as in, what would you like to see in an IDE? Would an IDE make your lives easier?
Here are some screenshots that I whipped together really fast, of what I have currently. Click on the thumbnails for a larger view.
This is the main interface. You can see the project explorer on the left, a rudimentary toolbar at the top, open file listing at the bottom, and the editor in the center. The editor is currently displaying an on-demand helper tip, which can be obtained whenever you press CTRL+SHIFT+SPACE, just like in visual studio. It will display help for the current function, so long as you're in its parentheses or right next to them.
Identifier tokens can also be moused-over to get brief information in a nice tooltip.
You can right-click on any identifier and have the editor take you straight to the definition of the function (so long as it's user-defined. Built-in functions can't be jumped to, of course).
Here's a view of the project explorer and the file properties dialog (which can be obtained by right-clicking on a file and selecting properties). The project system in the IDE is all "virtual". In other words, directories aren't really there, and files can take on different names from what they really are. You can even have two files of the same name if you wanted to. The paths are also all relative allow you to easily ZIP up your project definitions and distribute them if necessary, without breaking the links. Files can be dragged & dropped into individual folders. Deleting a file from the list won't delete it completely.
Custom functions have their own special tooltips on mouseover and quickinfo.
There is also a useful export feature for exporting formatted source code to either RTF or HTML.
Here's an exported block of code formatted to HTML.
Now that you've seen most of the features of this IDE, is there anything you'd like to see specifically? Please let me know and I'll do my best to code it in.
I'm already planning to have auto-complete for built-in events, interfacing with the Torque debugger, and other minor UI changes.
Let me know :)
Update :: July 19th
Added intellisense support and tidied-up the sidebar interface.
About the author
#22
> Search/replace in all open documents (in files would be even better)... Not sure if yours does that?
Pending
> Macros. Like Todd said, these can really come in handy.
Done
> Customizable syntax and syntax highlighting.
Definitely going to be added, but not in the first betas
> Custom fonts.
Going to be apart of the syntax customization addition
> 100% customizable keys and toolbars
A bit more tedious to add, but I'm open to it
> Sort selection
I don't know what you mean by this?
> Workspaces
How would you suggest this be done? I don't believe I've worked with an IDE that had workspaces configured; unless you're talking about consistency across sessions, which is already implemented.
> Change case
Consider it done
> Custom tools
Like plugins? Yeah I can do that. I've written plugin-interfaces for some other apps I coded... it's not *too* difficult... definitely something I'll put on my list.
> Oh, and... any idea when we can get our hands on this and try it out? =)
Hehe, I'm going to be emailing a few people in this thread to test out the beta. I want to wait till I have debugger capabilities implemented before I release a public beta. Consider yourself on the e-mail list; I'll be sending out notifications as soon a I've worked out the random kinks.
@Hokuto:
> That short time and you got so much done?
Yeah, well being a college student and freelance programmer with lots of free time during the summer, I spent basically *all day* coding it, plus yesterday, and today ... so 3 days total so far. *grin*
Lastly, I wanted to show off what I've got finally. The last step will be the integrated debugger... the interface is pretty much final:

It includes completely customizable macros, editor split control, bookmarking, designating breakpoints (as you can see from the red dot; although they don't do anything yet), auto-complete, smart indent, automatic regionizing (along { and }), custom-defined regions (similar to C#'s "#Region...#End Region" block), persistent bookmarks (across closes/opens), printing, print preview, definition auto-jump, virtual hierarchical project filesystem, function hints, mouseover hints, regular expression search/replace, export formatted code to RTF/HTML, and other little features I can't begin to name.
Any other final little feature suggestions are welcome. I plan on rolling a beta out today to those who have requested I send them a copy ... I know I said that yesterday, but I've been busy fixing bugs :)
Many thanks again for all your suggestions and comments :)
- Sam
Edit -- Here is the full screenshots gallery, which I meant to post earlier.
07/20/2005 (3:50 am)
@Kevin:> Search/replace in all open documents (in files would be even better)... Not sure if yours does that?
Pending
> Macros. Like Todd said, these can really come in handy.
Done
> Customizable syntax and syntax highlighting.
Definitely going to be added, but not in the first betas
> Custom fonts.
Going to be apart of the syntax customization addition
> 100% customizable keys and toolbars
A bit more tedious to add, but I'm open to it
> Sort selection
I don't know what you mean by this?
> Workspaces
How would you suggest this be done? I don't believe I've worked with an IDE that had workspaces configured; unless you're talking about consistency across sessions, which is already implemented.
> Change case
Consider it done
> Custom tools
Like plugins? Yeah I can do that. I've written plugin-interfaces for some other apps I coded... it's not *too* difficult... definitely something I'll put on my list.
> Oh, and... any idea when we can get our hands on this and try it out? =)
Hehe, I'm going to be emailing a few people in this thread to test out the beta. I want to wait till I have debugger capabilities implemented before I release a public beta. Consider yourself on the e-mail list; I'll be sending out notifications as soon a I've worked out the random kinks.
@Hokuto:
> That short time and you got so much done?
Yeah, well being a college student and freelance programmer with lots of free time during the summer, I spent basically *all day* coding it, plus yesterday, and today ... so 3 days total so far. *grin*
Lastly, I wanted to show off what I've got finally. The last step will be the integrated debugger... the interface is pretty much final:
It includes completely customizable macros, editor split control, bookmarking, designating breakpoints (as you can see from the red dot; although they don't do anything yet), auto-complete, smart indent, automatic regionizing (along { and }), custom-defined regions (similar to C#'s "#Region...#End Region" block), persistent bookmarks (across closes/opens), printing, print preview, definition auto-jump, virtual hierarchical project filesystem, function hints, mouseover hints, regular expression search/replace, export formatted code to RTF/HTML, and other little features I can't begin to name.
Any other final little feature suggestions are welcome. I plan on rolling a beta out today to those who have requested I send them a copy ... I know I said that yesterday, but I've been busy fixing bugs :)
Many thanks again for all your suggestions and comments :)
- Sam
Edit -- Here is the full screenshots gallery, which I meant to post earlier.
#23
07/20/2005 (6:26 am)
Can I consider myself in the email list? ;)
#24
07/20/2005 (7:05 am)
Count me in, please!
#25
07/20/2005 (7:52 am)
I can't wait to see this. I'm getting quite excited. :-)
#26

Final interface. I've sent e-mails to most of you. It took this long because I basically redid the interface design so it looks more like the .Net IDE, although it's quite more flexible :)
Edit -- Those of you who don't have a public e-mail (ie, Tim), please e-mail me. My address is listed. I'll dispatch a link to you guys.
07/21/2005 (5:22 am)

Final interface. I've sent e-mails to most of you. It took this long because I basically redid the interface design so it looks more like the .Net IDE, although it's quite more flexible :)
Edit -- Those of you who don't have a public e-mail (ie, Tim), please e-mail me. My address is listed. I'll dispatch a link to you guys.
#27
Is there anything built into the application that generates the script intellesense, using the Torque executable itself? That would be insanely cool, and very possible to do, if you aren't already doing it.
07/21/2005 (6:50 am)
I want to test your application Sam. I have been beta testing Torsion, and I have already sent a lot of feedback to Tom Spilman. It would be nice if I could start testing this program too. I would love to give you a few ideas / feedback. It looks like things are coming along really good in your editor. It seems like the main feature you need to implement now, is script debugging.Is there anything built into the application that generates the script intellesense, using the Torque executable itself? That would be insanely cool, and very possible to do, if you aren't already doing it.
#28
I believe I sent you an e-mail with a link, as you expressed interest earlier. You may want to take a look to make sure you received it; if not, let me know.
The "exported" functionlist -- ie, the list of functions provided by the Torque engine -- was generated using the function dump command. The functions are provided in "autocomplete.txt" so you can add your own exported functions to the list. Due to me wanting the editor to be completely independent from the Torque engine, I have chosen not to programmatically retrieve function exports from the engine executable.
The user-defined script-side function list is generated using a rudimentary tokenizer which runs every time you save the file. It adds the functions and global variable declarations to a global function tree which the application then uses to generate the dropdown auto-complete list and the "infopop" (which is what I'm going to end up calling it) quick tooltip.
07/21/2005 (7:07 am)
@Ray:I believe I sent you an e-mail with a link, as you expressed interest earlier. You may want to take a look to make sure you received it; if not, let me know.
The "exported" functionlist -- ie, the list of functions provided by the Torque engine -- was generated using the function dump command. The functions are provided in "autocomplete.txt" so you can add your own exported functions to the list. Due to me wanting the editor to be completely independent from the Torque engine, I have chosen not to programmatically retrieve function exports from the engine executable.
The user-defined script-side function list is generated using a rudimentary tokenizer which runs every time you save the file. It adds the functions and global variable declarations to a global function tree which the application then uses to generate the dropdown auto-complete list and the "infopop" (which is what I'm going to end up calling it) quick tooltip.
#29
07/21/2005 (7:41 am)
Oh okay thanks a lot. I was checking the wrong email account. :)
#30
Sort selection: This simply allows the selected region to be sorted alphabetically or numerically, forward or backward. This is definitely an "icing on the cake" feature, but nice to have.
Workspaces: It looks like your Projects might work like the Textpad workspaces... these just save a list of all open files and settings. In Visual Studio the workspace (or solution) is far more powerful, allowing multiple projects to be placed in the workspace. This is probably overkill for Torquescript.
Oh, and I remembered one more cool feature that Textpad implements (and I wish every other editor/browser/etc out there would implement): Being able to scroll by pages by holding down Shift with the mouse wheel. Super-handy when you're trying to quickly browse through a file, especially a large one.
Since a picture is worth a thousand words, I suggest downloading Textpad and checking it out. It does a lot of things very well.
Looking forward to seeing your stuff! =)
07/21/2005 (11:44 am)
@Sam:Sort selection: This simply allows the selected region to be sorted alphabetically or numerically, forward or backward. This is definitely an "icing on the cake" feature, but nice to have.
Workspaces: It looks like your Projects might work like the Textpad workspaces... these just save a list of all open files and settings. In Visual Studio the workspace (or solution) is far more powerful, allowing multiple projects to be placed in the workspace. This is probably overkill for Torquescript.
Oh, and I remembered one more cool feature that Textpad implements (and I wish every other editor/browser/etc out there would implement): Being able to scroll by pages by holding down Shift with the mouse wheel. Super-handy when you're trying to quickly browse through a file, especially a large one.
Since a picture is worth a thousand words, I suggest downloading Textpad and checking it out. It does a lot of things very well.
Looking forward to seeing your stuff! =)
#31
Current script intellesense obviously support torque built in function quit well.
I'm just wondering if it will support function intellesense in the torque object level, ie -- in the dot(.)
level. For example, when I type MissionCleanup followed by a . then the add function intellesense
show up.
Is it possible to use the "autocomplete.txt" file to do this?
07/22/2005 (8:24 am)
@Sam:Current script intellesense obviously support torque built in function quit well.
I'm just wondering if it will support function intellesense in the torque object level, ie -- in the dot(.)
level. For example, when I type MissionCleanup followed by a . then the add function intellesense
show up.
Is it possible to use the "autocomplete.txt" file to do this?
#32
- Sam
Edit -- There is the scope-resolution operator (::) auto-complete, but it only lists user-defined functions for that specific object; nothing more. Again, a list would be helpful.
07/22/2005 (12:52 pm)
Currently there is not object-level autocompletion, due to the fact that I have not found any documentation whatsoever about what functions are available on a per-object basis. If you can point me in the right direction, adding it would be trivial.- Sam
Edit -- There is the scope-resolution operator (::) auto-complete, but it only lists user-defined functions for that specific object; nothing more. Again, a list would be helpful.
#33
07/22/2005 (1:05 pm)
The .dump() command on any object will reveal all the functions for it :)
#34
For Torsion i'm considering having some menu command that executes your game executable with a special script which will generate the autocomplete info from your particular Torque EXE. It would then use this as the project specific autocomplete set. It might even be something it can do when it creates a new project.
07/22/2005 (1:38 pm)
One issue which bothers me with autocomplete based on data extracted from the engine is that if you don't keep up to date with engine changes the autocomplete will be wrong. Especially for people who extend Torque with new scriptable features.For Torsion i'm considering having some menu command that executes your game executable with a special script which will generate the autocomplete info from your particular Torque EXE. It would then use this as the project specific autocomplete set. It might even be something it can do when it creates a new project.
#35
www.garagegames.com/mg/forums/result.thread.php?qt=25593
Use the dumpThatShiznit() function to dump all the objects'(or class) member fields and methods, including their usages(in debug mode) string. I've a revision of his function testing ok.
So another object methods description file, like the "autocomplete.txt" for console functions, would be sufficient for our purpose.
For Tom's concern about the engine change issue, I think tell the user how to update the above file is ok. One thing I think not so trivial is that it need to rember what class are the object variables, maybe. That's all I reach so far, I really hope someone will implement this(totally VS.NET IDE look and feel) and believe the community need this. Anyway, you really did a good job! A last step to be perfect.
07/23/2005 (8:42 am)
As Gonzo said in this thread:www.garagegames.com/mg/forums/result.thread.php?qt=25593
Use the dumpThatShiznit() function to dump all the objects'(or class) member fields and methods, including their usages(in debug mode) string. I've a revision of his function testing ok.
So another object methods description file, like the "autocomplete.txt" for console functions, would be sufficient for our purpose.
For Tom's concern about the engine change issue, I think tell the user how to update the above file is ok. One thing I think not so trivial is that it need to rember what class are the object variables, maybe. That's all I reach so far, I really hope someone will implement this(totally VS.NET IDE look and feel) and believe the community need this. Anyway, you really did a good job! A last step to be perfect.
#36
The reason this is close to being impossible, outside of the local scope (ie, % variables; and not including those that are passed over to functions), is because global variables can be declared multiple times to have different types; it just depends on what you use when. For example, if you have the variable $global, it can be declared as a TCPObject in one function, or as a GameConnection object in another. Unless the IDE verifies the flow of the program -- which is clearly outside of the scope of any IDE -- it is practically impossible to figure out which object type was used where.
This differs from a typed language which declares its datatypes before use; ie, C++'s "TCPObject myVar" would ease this ambiguity in variables.
Finding out the type of variable in local scope is less difficult. All one must look for is %variable = (what sort of object); however, suppose you make a function call? %variable = myFunction(); which returns an object. How is the IDE supposed to know what sort of object is returned. Again, not possible.
I have considered doing "pseudo-typing". For example, comments are parsed by the IDE, and if the comment structure in the local scope contains:
// Decl %var TCPObject
or something similar, it will automatically assume %var is a TCPObject; but this is only useful as a helper function and most of the time useless unless you want to take the time to declare all your variables in such a format... but it may be useful.
What do you guys think of that version of variable declaration? Good? Bad? Would it help if I had dot-style auto-completion on variables in such a manner?
Edit: Typos.
07/23/2005 (8:54 am)
@Steven:The reason this is close to being impossible, outside of the local scope (ie, % variables; and not including those that are passed over to functions), is because global variables can be declared multiple times to have different types; it just depends on what you use when. For example, if you have the variable $global, it can be declared as a TCPObject in one function, or as a GameConnection object in another. Unless the IDE verifies the flow of the program -- which is clearly outside of the scope of any IDE -- it is practically impossible to figure out which object type was used where.
This differs from a typed language which declares its datatypes before use; ie, C++'s "TCPObject myVar" would ease this ambiguity in variables.
Finding out the type of variable in local scope is less difficult. All one must look for is %variable = (what sort of object); however, suppose you make a function call? %variable = myFunction(); which returns an object. How is the IDE supposed to know what sort of object is returned. Again, not possible.
I have considered doing "pseudo-typing". For example, comments are parsed by the IDE, and if the comment structure in the local scope contains:
// Decl %var TCPObject
or something similar, it will automatically assume %var is a TCPObject; but this is only useful as a helper function and most of the time useless unless you want to take the time to declare all your variables in such a format... but it may be useful.
What do you guys think of that version of variable declaration? Good? Bad? Would it help if I had dot-style auto-completion on variables in such a manner?
Edit: Typos.
#37
The pseudo-typing seems of limited use as most code will not include these comments at all, but i guess some users might take the time to add commented declarations to their new code.
I'm gonna do a little more google research on intellisense/autocomplete on typeless languages... someone must have written something about this before.
07/23/2005 (9:43 am)
@Sam - I haven't gotten into autocomplete myself, so you can ignore my comments if they're stupid. But it seems like in cases of multiple types on the same global you should just treat the global as being multiple types. You would report members for one or more types that you've detected that global is over several script files and make it very clear to the user that you're not sure which type it is at that moment. Let the user make the decision... which he would have to do anyway. Still it seems the multiple type issue will be more common in locals than globals and the local scope seems easier to solve correctly.The pseudo-typing seems of limited use as most code will not include these comments at all, but i guess some users might take the time to add commented declarations to their new code.
I'm gonna do a little more google research on intellisense/autocomplete on typeless languages... someone must have written something about this before.
#38
So if you want another tester, you have one. :)
07/23/2005 (10:16 am)
Like Noolness, I would like to help test this IDE as well. Doing the same with Torsion, and I have a very strong interest in a script-specific editor (currently I have my scripts in Visual Studio as well as engine code, I'd like to keep them seperate).So if you want another tester, you have one. :)
#39
While I had considered that, there is still the problem of having a variable assignment from a function call, whether local or global.
For example, $global = MyInitFunction(); ... there is absolutely no way to tell what MyInitFunction returns. Then there remains the problem with arrays ... the way Torque treats arrays, they aren't "really" arrays, so I'd have to treat each "array" variable as a separate variable... plus this doesn't work for dynamic variables.
Typeless languages are difficult to perform intellisense on. Any ideas, of course, are appreciated. And thanks, Tom, for your input.
@Trent:
I've sent you an e-mail :)
07/23/2005 (10:32 am)
@Tom:While I had considered that, there is still the problem of having a variable assignment from a function call, whether local or global.
For example, $global = MyInitFunction(); ... there is absolutely no way to tell what MyInitFunction returns. Then there remains the problem with arrays ... the way Torque treats arrays, they aren't "really" arrays, so I'd have to treat each "array" variable as a separate variable... plus this doesn't work for dynamic variables.
Typeless languages are difficult to perform intellisense on. Any ideas, of course, are appreciated. And thanks, Tom, for your input.
@Trent:
I've sent you an e-mail :)
#40
07/23/2005 (10:42 am)
@Sam - Looking at languages like SmallTalk/Javascript/Ruby they only do minimal work to determine type and if no type is known it does nothing. Unless you can come up with an extremely clever trick, TorqueScript will not have full intellisense without changing it to strongly typed (which may or may not be a bad idea).
Torque 3D Owner Kevin Rogers
Here's a list of things that Textpad does that I find very nice to have:
* Search/replace in all open documents (in files would be even better)... Not sure if yours does that?
* Macros. Like Todd said, these can really come in handy.
* Customizable syntax and syntax highlighting. And I think it's important to be able to change the background color for the syntax as well; I've seen some editors/IDEs that only let you change the foreground -- not cool.
* Custom fonts. Oh, and please keep the font choice open to any font; many nice monospaced fonts are not flagged as monospace.
* 100% customizable keys and toolbars.
* Sort selection
* Workspaces
* Change case (Upper, lower, Capitalize)
* Custom tools
Oh, and... any idea when we can get our hands on this and try it out? =)
Thanks man!
Kevin