X

Geertjan's Blog

  • September 5, 2007

Interview: Author of New TorqueScript Editor

Geertjan Wielenga
Product Manager
I've been in touch with Mohamed El Shami recently, a programmer who is creating an editor for TorqueScript. If you're wondering what that is, read on and you'll find out some things about Mohamed too!

Mohamed, tell us who you are, where, and what you do there?

My name is Mohamed El Shami. I work as a Senior Software Engineer for Nokia Siemens Networks, in Kuwait, but I'm originally from Egypt. I hold a computer engineering degree from the Arab Academy for Science and Technology in Egypt.

Here's a pic of me:

At Nokia Siemens Networks, we rely heavily on Java and J2EE. We develop and customize software applications and services relating to IMS, 3GPP protocols, and 3G services, including mobile gaming and locational-based services. We also provide solutions for integrating heterogeneous systems, as there are always customer-specific needs in this area.

What about your hobbies?

My hobbies are generally sports like squash, swimming, and biking. I also enjoy game programming as a hobby. What I like about programming is the creative process behind it, always being faced with challenges that make the brain active, exactly like when you solve a puzzle. And since an early age, about 7 or so, I knew I'd love being a programmer.

Do you use NetBeans IDE at work? Or a different IDE? And what are your experiences with the IDE that you use?

Personally I use NetBeans IDE at work and prefer it big time over Eclipse, especially since NetBeans IDE has seen revolutionary growth lately. Other developers use Eclipse because it's what they're familiar with. Our projects are still portable, though, because we use Ant-based projects.

When and why did you start using NetBeans IDE?

In my 4th year at university in Egypt, which was about 2002, I was still learning Java and was happy with a text editor and command-line compilation. Then I came across Forte IDE, the precursor to NetBeans IDE. I tried to use it on my Pentium 3 with 256 MG RAM Compaq Presario, which was totally impractical. Forte was very heavy and buggy, almost taking all the system resources. So I dropped it until I had my first job in 2004 as a Java programmer. I gave it a second try and that was at the time of NetBeans IDE 3.6. I've been happy with it and used it since then.

So what are your favorite NetBeans IDE features? And what areas could be improved?

I'm no expert of every NetBeans IDE feature and neither have I really utilized it to the maximum, but I must say that since picking up NetBeans IDE, I've never looked back. I've used JBuilder, JDeveloper and have evaluated Eclipse, but the unique thing about NetBeans IDE is that it was, from the very beginning, written specifically for out-of-the-box Java development, unlike the others, which makes NetBeans IDE more convenient. I like features like the management of servers and databases, as well as features such as libraries and Java platform management. These make it really easy for me when I develop for different JDK versions. I also like editor features such as "Go to Declaration" and "Go to Source", which let you jump within the editor to a declaration or to the source of an extended or implemented class.

It's very difficult to think of improvements in NetBeans IDE, especially with the upcoming NetBeans IDE 6.0, but I'd like to see more performance improvements and faster loading time. I can also see that a lot of improvement could happen in the web service development area, for example, I'd like to see support for Apache Axis2.

Do you use NetBeans Mobility at work for your mobile development work there?

No we haven't used it, but the possibility is there in the future. However, I played around with it at home, looks promising, I especially liked the Game Builder for Java ME Development. (Also see here.)

Now finish this sentence: "The very best thing about NetBeans IDE is...

...definitely the amazing community behind it. It is truly made by developers for developers."

Now, you've been working on an editor for TorqueScript. What's that?

TorqueScript is the scripting language of the Torque Game Engine and the Torque Game Builder (TGB) by GarageGames. TorqueScript has a C++-like syntax and includes features like Datablocks, Objects, and Namespaces. I come from a C++ programming background, but for the past 3 years Java has been my major programming language. I have also developed with other languages like C#, Visual Basic, and Pascal.

In my free time, I like working on game development and I use TGB with TorqueScript. I never actually planned to write an editor, as I was always able to find the necessary tools, made by the TGB community. For example, TorqueScript Syntax Highlighting support has been added to JEdit, and a great job has been done by writing a complete editor from scratch, called TorqueDev. However, even the latter is missing important features, such as an integrated version control, and in-editor grammar checking. The other good alternative is the commercial Torison.

So how did you get to writing your editor on the NetBeans Platform?

The reason I decided to write TorqueScript editor support for the NetBeans IDE goes back to when I had a discussion with a friend who recently teamed up with me to develop games with TGB. He wasn't happy with the lack of help he was getting via text editors to edit TorqueScript, and he said it would save him a lot of time if he had a better IDE.

So at that point I started to think about NetBeans IDE and remembered the C++ language pack plugin, and started to wonder how easy it might be to develop a TorqueScript pack for NetBeans. After some quick research, I luckily found Project Schliemann (also known as the Generic Language Framework) and, knowing that the support for Schliemann has become part of the core NetBeans IDE 6.0 builds, I downloaded NetBeans IDE 6.0 M10 and started to explore the many examples of the new languages added using Schliemann, which can be found in the languages and scripting folders in the NetBeans sources. Here is an example of some TorqueScript in the editor that I'm creating:

Where are things so far with your TorqueScript Editor?

What I've done so far with TorqueScript is only a start and I've basically been learning along the way while developing it. So, I'm firstly aiming to complete the grammar rules, then I'd like to be able to run the game from within the editor. I'd like also to add a project template for a new TGB game project which creates the game project structure. Then later on I want to have more advanced features like debugging, refactoring, and a dynamically populated auto-complete list from the game engine API's.

But, to be quite honest, I'm not exactly committed to complete all what I've mentioned above as I've only saved little free time to work on this. But I'm really glad to see people from the community are interested and really helpful and I'm definitely more encouraged now to complete what I've started!

Before you began creating your TorqueScript Editor, did you have any experience of creating other plugins for NetBeans IDE?

No, this is my first experience to write a plugin for NetBeans IDE, which is one of the reasons why I started writing this editor. I am greatly surprised with how easy it is. In future I have other plans for other plugins, such as adding plugins for our project structures and templates.

How are you defining the grammar rules for your editor? What is the process that you're using? Did you find some official language definition, in ANTLR or JavaCC to start with, or are you using some other approach?

I'd have liked to have used ANTLR or JavcCC to generate TorqueScript grammar, but I haven't yet had the chance to work with it. So my approach is simple: I used the javascript.nbs file from the NetBeans sources as a starting point, because the syntax is very similar to TorqueScript. Then, based on my own understanding of the TorqueScript language grammar, I break down every grammar rule and put it in NBS declarations.

How do you plan to run the game from within the editor? What will you need to do to make this possible? What code will you need? Is there a Torque API for this?

Running the game from within the editor could be thought of as two separate ideas. The first idea is to run the game by enabling the IDE "Run" command, using Schliemann ACTIONs. Then implement the the run action in Java, which is done by using Runtime.exec() to call Torque executable. My second idea is to embed TGB as ActiveX inside a new IDE window tab. Neil at GarageGames has a similar idea.

What is your personal experience with TorqueScript? How long have you used it, what have you
done with it? How important is it to have a good understanding of TorqueScript when you are creating an editor for it?

About three years ago I joined a team developing a sequel for the King's Quest adventure series, which is now, due to copyrights reasons, called The Silver Lining. When we moved to the Torque Game Engine, I worked as a scripter, and did some level of scripting. Then, due to being busy at work, I had to leave the team while keeping an eye on game development stuff in general, with a plan to get back to it later.

However, what I'm doing right now is, in my little free time, prototyping games using the Torque Game Builder with a friend. Currently there isn't much to talk about on this point yet, and I must say I haven't finished a product yet with TGB, but we are slowly progressing to getting a solid level of experience with the overall game development process. So we are starting small.

Any programmer with Java or C++ background would easily pick up TorqueScript, the learning curve is only spent on learning the engine features itself. Importantly, though, I think you have to be completely familiar with all the language aspects in order to write an editor for it.

Who do you expect or hope your users to be? And when do you think you will have something that people will be able to use?

It'd be great to give something back to the community, so once I have something that is functional I would like to be able to contribute it to the NetBeans community. Then hopefully Torque Engine users would find it useful, especially those who are like me, who use NetBeans IDE on a daily basis.

It's unlikely that it will be possible to release my TorqueScript support before the NetBeans IDE 6.0 release comes out. That's why I've given myself a relaxed time-frame for this project, but what I'm aiming for anyway is to release the basic features by the end of this month, which will consists of basically the complete grammar rules and the ability to run game from within the editor.

All the best with your TorqueScript Editor, Mohamed... looking forward to being introduced to TorqueScript via your editor!

Join the discussion

Comments ( 1 )
  • William Shultz Friday, January 7, 2011

    This was a great interview and article, albeit several years old now. I have recently begun programming again and I would like to know if you finished the TorqueScript plugin. That would be of great help to my work. Thanks!


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.