by date
Development Journal for Torque X Builder 3D
Development Journal for Torque X Builder 3D
| Name: | John Kanalakis | ![]() |
|---|---|---|
| Date Posted: | Apr 07, 2008 | |
| Rating: | 5.0 out of 5 | |
| Public: | YES | |
| Comments: | YES | |
| RSS Feed: | or Subscribe with . | |
| Profile Page: | View profile page for John Kanalakis |
Blog post
In case you haven't heard, Torque X is an amazing game engine that sits on top of Microsoft's XNA Framework. XNA provides a great foundation for bringing graphics, 3D models, and sounds together into a game that can run on Windows and any retail Xbox 360. And Torque X builds upon that framework to offer important commercial game features, like scene graph, templates, spawning, GUI, level loading, particle effects, and so on. Torque X Builder 2D is a great editor for assembling game levels, but now that the Torque X engine supports full 3D functionality, what about an editor for creating 3D game levels?
Last year, I started working on Torque X Builder 3D. As its name suggests, it is meant for assembling game assets into complete 3D scenes that can be loaded by Torque X. It was originally revealed at GDC2008 and then recently announced here by Brett Seyler. Development has turned out to be a real challenge and with this blog, I want to share my experience with talks about some of those hurdles (and how we've overcome them) while offering a deeper sneak peek into this project.
The Goal
Every project needs to have a goal, and my goal was to create a very user-customizable environment for creating 3D levels leveraging the power Torque X. That's a very specific goal with three core objectives in just the priority I want them: user-customizable, creating levels, and leveraging the Torque X engine.
User-Customizable
Not every game designer is the same, so why should their tools be?!? User customization was my top objective, so dockable panels was a must. Some may want the Assets window on the left, others on the right, while the rest just don't care. With TXB3D, you get to choose with your preferred layout saved for your next use. Here are a couple examples ranging from the minimalist (left) to the information dominator (right).

TXB 3D also supports user-created Plug-Ins. There's nothing too fancy here. I just wanted a mechanism for anyone that can code in C# to create their own Plug-In that can be loaded by TXB 3D, be given some screen real-estate, and handed access to the viewport. So, you can create any Plug-In you like, from an AI editor to an online chat tool.

Lastly, TXB 3D needs to really support (and embrace) Vista. I'm still just getting used to Vista, but it's enough to appreciate an application that can really take advantage of its strengths by "playing nice" with its security guidelines as well as parking application data where it's expected. Allow or Cancel? Allow or Cancel? Allow or Cancel?
Creating 3D Levels
This is the real meat of the application. When I first looked at this project, I broke it out into five areas: WYSIWYG Viewport, Loading & Saving Scenes, Adding/Editing Objects, Editing Components, and Editing Materials. It turns out that although these sounds like easy tasks, XNA makes them a bit more challenging. Remember, XNA is essentially a game-creating sandbox with a lot of restrictions.
Editing 3D Scenes
WYSIWYG (or what-you-see-is-what-you-get) is pretty much the expected norm for any Windows application. So, creating an editor in C++/DirectX that creates levels for C#/XNA wasn't acceptable to me. I decided that TXB3D has to have an instance of Torque X running inside of it to render the scene in real-time. It turns out that this decision had a lot of benefits and a lot of headaches. The biggest benefit is that creating the editor is now like creating an elaborate Torque X game - and I can use the scene de-serializer to load the scene, and use TorqueComponents for all the scene design objects, viewing paticle effects in realtime, and so on. The challenges were more along the lines of working with the XNA content pipeline and bringing uncompiled assets into your project and modifying components already registered with the TorqueObjectDatabase. The result was worth it and when you use TXB3D, you can be sure that your game will look exactly the way it does within the TXB3D viewport.
Loading & Saving Scenes
Loading scenes was easy, I just need to call SceneLoader.Load(); But saving scenes was a bit trickier. I decided to be lazy and make the .NET Framework do the hard work for me. So, I created a Serializer class that goes through all of the scene elements and use reflection to get their public properties and values and then write them to the scene data file. Easily reading and writing scene data lended itself well to creating a built-in XML editor for hand-coding/editing scene data.
Adding and editing scene objects is easy within a Torque X game, so no problem there. In fact, given that the editor is running a Torque X game in realtime, you can instantly see the effects of your changes. The only challenge here was that new components couldn't be added to already registered TorqueComponents. Now, you can easily add, remove, and modify any component attached to any object within the scene.

Working with Materials
Editing materials is also easy because of the great built-in support for materials within Torque X. You can create simple materials, lighting materials that can point to a normal map, or even an all new material linked to a new shader that you write... hmmm... a shader preview plug-in...

3D Axis Gizmo
But it's not all a breeze... creating a 3D Axis Gizmo for positioning scene objects is a lot easier in DirectX than it is within XNA. There's a lot of work involved in drawing a simple line within 3D space, when it comes to XNA. So drawing the Gizmo proved to be a challenge, but fortunately, it was do-able. There are still many refinements going into the Gizmo today to make it easier to work with.

Overall, this has been a really fun project to work on. I've been building desktop applications for a while with C#, but this has to be the most fun one ever. It's a great testament to the power and flexibility of XNA as well as Torque X. As for Torque X Builder 3D, it's nearing the finish line and you should see a lot more to get excited about in the next couple months.
John K.
Last year, I started working on Torque X Builder 3D. As its name suggests, it is meant for assembling game assets into complete 3D scenes that can be loaded by Torque X. It was originally revealed at GDC2008 and then recently announced here by Brett Seyler. Development has turned out to be a real challenge and with this blog, I want to share my experience with talks about some of those hurdles (and how we've overcome them) while offering a deeper sneak peek into this project.
The Goal
Every project needs to have a goal, and my goal was to create a very user-customizable environment for creating 3D levels leveraging the power Torque X. That's a very specific goal with three core objectives in just the priority I want them: user-customizable, creating levels, and leveraging the Torque X engine.
User-Customizable
Not every game designer is the same, so why should their tools be?!? User customization was my top objective, so dockable panels was a must. Some may want the Assets window on the left, others on the right, while the rest just don't care. With TXB3D, you get to choose with your preferred layout saved for your next use. Here are a couple examples ranging from the minimalist (left) to the information dominator (right).

TXB 3D also supports user-created Plug-Ins. There's nothing too fancy here. I just wanted a mechanism for anyone that can code in C# to create their own Plug-In that can be loaded by TXB 3D, be given some screen real-estate, and handed access to the viewport. So, you can create any Plug-In you like, from an AI editor to an online chat tool.

Lastly, TXB 3D needs to really support (and embrace) Vista. I'm still just getting used to Vista, but it's enough to appreciate an application that can really take advantage of its strengths by "playing nice" with its security guidelines as well as parking application data where it's expected. Allow or Cancel? Allow or Cancel? Allow or Cancel?
Creating 3D Levels
This is the real meat of the application. When I first looked at this project, I broke it out into five areas: WYSIWYG Viewport, Loading & Saving Scenes, Adding/Editing Objects, Editing Components, and Editing Materials. It turns out that although these sounds like easy tasks, XNA makes them a bit more challenging. Remember, XNA is essentially a game-creating sandbox with a lot of restrictions.
Editing 3D Scenes
WYSIWYG (or what-you-see-is-what-you-get) is pretty much the expected norm for any Windows application. So, creating an editor in C++/DirectX that creates levels for C#/XNA wasn't acceptable to me. I decided that TXB3D has to have an instance of Torque X running inside of it to render the scene in real-time. It turns out that this decision had a lot of benefits and a lot of headaches. The biggest benefit is that creating the editor is now like creating an elaborate Torque X game - and I can use the scene de-serializer to load the scene, and use TorqueComponents for all the scene design objects, viewing paticle effects in realtime, and so on. The challenges were more along the lines of working with the XNA content pipeline and bringing uncompiled assets into your project and modifying components already registered with the TorqueObjectDatabase. The result was worth it and when you use TXB3D, you can be sure that your game will look exactly the way it does within the TXB3D viewport.
Loading & Saving Scenes
Loading scenes was easy, I just need to call SceneLoader.Load(); But saving scenes was a bit trickier. I decided to be lazy and make the .NET Framework do the hard work for me. So, I created a Serializer class that goes through all of the scene elements and use reflection to get their public properties and values and then write them to the scene data file. Easily reading and writing scene data lended itself well to creating a built-in XML editor for hand-coding/editing scene data.
Adding and editing scene objects is easy within a Torque X game, so no problem there. In fact, given that the editor is running a Torque X game in realtime, you can instantly see the effects of your changes. The only challenge here was that new components couldn't be added to already registered TorqueComponents. Now, you can easily add, remove, and modify any component attached to any object within the scene.

Working with Materials
Editing materials is also easy because of the great built-in support for materials within Torque X. You can create simple materials, lighting materials that can point to a normal map, or even an all new material linked to a new shader that you write... hmmm... a shader preview plug-in...

3D Axis Gizmo
But it's not all a breeze... creating a 3D Axis Gizmo for positioning scene objects is a lot easier in DirectX than it is within XNA. There's a lot of work involved in drawing a simple line within 3D space, when it comes to XNA. So drawing the Gizmo proved to be a challenge, but fortunately, it was do-able. There are still many refinements going into the Gizmo today to make it easier to work with.

Overall, this has been a really fun project to work on. I've been building desktop applications for a while with C#, but this has to be the most fun one ever. It's a great testament to the power and flexibility of XNA as well as Torque X. As for Torque X Builder 3D, it's nearing the finish line and you should see a lot more to get excited about in the next couple months.
John K.
Recent Blog Posts
| List: | 05/04/08 - Torque X Book Completed 04/22/08 - Torque X Builder 3D Progress: The Axis Gizmo 04/07/08 - Development Journal for Torque X Builder 3D 03/31/08 - Torque X 2.0 Tutorials Updated 11/04/07 - A New Casual Game 10/26/07 - Torque X: Progress, Pics, and Free Code 12/25/06 - Rocket Commander XNA 07/06/06 - Solitaire Blaster Preview Images |
|---|
Submit your own resources!| Davey Jackson (Apr 07, 2008 at 21:36 GMT) |
| David Blake (Apr 07, 2008 at 21:36 GMT) |
| Dave Young (Apr 07, 2008 at 21:51 GMT) |
| Russell Fincher (Apr 07, 2008 at 22:00 GMT) |
| Davey Jackson (Apr 07, 2008 at 23:12 GMT) |
| Chip Lambert (Apr 07, 2008 at 23:38 GMT) |
| Dave Young (Apr 07, 2008 at 23:53 GMT) |
| Jonathon Stevens (Apr 08, 2008 at 01:03 GMT) |
| John Kanalakis (Apr 08, 2008 at 01:11 GMT) Resource Rating: 5 |
John K.
| James Brad Barnette (Apr 08, 2008 at 01:20 GMT) Resource Rating: 5 |
| James Brad Barnette (Apr 08, 2008 at 01:24 GMT) Resource Rating: 5 |
| John Kanalakis (Apr 08, 2008 at 03:01 GMT) Resource Rating: 5 |
John K.
| James Brad Barnette (Apr 08, 2008 at 16:44 GMT) Resource Rating: 5 |
just some ideas
move
rotate
scale
UniversalEdited on Apr 08, 2008 16:46 GMT
| John Kanalakis (Apr 08, 2008 at 20:42 GMT) Resource Rating: 5 |
John K.
| James Brad Barnette (Apr 09, 2008 at 02:12 GMT) Resource Rating: 5 |
q=selection
w=move
e=rotate
r=scale
t=universal
| Edward F. Maurina III (Apr 09, 2008 at 03:12 GMT) Resource Rating: 5 |
Good luck in your endeavor.
-Ed
| John Kanalakis (Apr 09, 2008 at 03:52 GMT) Resource Rating: 5 |
James, I like the idea of hotkeys to streamline interaction. At the moment, w is mapped to "camera forward". I've mapped WASD to camera axis movement and the arrow keys to the pan and tilt rotations. But that shouldn't really conflict with W as a move key.
John K.
| James Brad Barnette (Apr 09, 2008 at 04:32 GMT) Resource Rating: 5 |
| Chris Kim (Apr 11, 2008 at 12:19 GMT) |
Any chance of seeing GUI editor along with Torque Builder like editor for 2D? There is TorqueX builder, and what's going to happen to it? Will it eventually merge with this 3D Editor?
Thanks.
| John Kanalakis (Apr 12, 2008 at 03:03 GMT) Resource Rating: 5 |
John K.
| Chris Kim (Apr 12, 2008 at 15:32 GMT) |
I guess it's upto TXB developer(who is the right person to ask?) to support it and further enhance the 2D features.
I thought for a moment that 2D and 3D editor was going to merge somehow.
I think it's pefectly acceptable as long as I can import 3D project into 2D editor to work on GUI and vice versa.
Please keep the good work.
Thanks.
Edited on Apr 12, 2008 18:17 GMT
You must be a member and be logged in to either append comments or rate this resource.



5.0 out of 5


