Game Development Community

Torque X 3D Update - June 14

by Adam Larson · in Torque X 2D · 06/14/2007 (12:59 am) · 8 replies

I finally got around to writing this after promising it a couple weeks ago. My intent with this is to catch everyone up on what we have so far so that we can start giving incremental updates (that aren't nearly this long). This is going to be a basic overview of what is done or in progress in Torque X 3D. Everything I'm mentioning here is in addition to what you already know exists in the engine. The rendering core, component system, gui, object model, etc of Torque X 2D is all the same in 3D with various minor changes and improvements.

In 2D, the component system is used to implement most of an object's functionality, but there are still some things handled via the standard inheritance model. For instance, T2DStaticSprite, a child of T2DSceneObject and grandchild of TorqueObject, handles rendering itself. In 3D, everything is a component. Everything. There isn't even a T3DSceneObject. Components are added directly to TorqueObjects. And honestly, we're not just trying to push components. It actually just works out really well this way. Here is a list of the base level core components that have been implemented so far and what they do:

T3DSceneComponent - In other engines, this would be the scene object. It manages the object's transform, scene container data, bounds, and visibility.

T3DRenderComponent - Rendering. This is subclassed to implement specific types of rendering. For example, there is a T3DTSRenderComponent that renders DTS shapes (Torque's model format).

T3DRigidComponent - Rigid body physics and collision. I'm not going to go into details on this, I'll just say that the collision system is fast, accurate, and easy to work with.

farm2.static.flickr.com/1133/546358119_7f4ddfb2e0.jpg?v=0
A bunch of spheres rolling around on the terrain and colliding with each other. The boxes around each sphere are just rendered so rotation can be visualized.

T3DMountComponent - Mounts scene components to other scene components.

T3DCameraComponent - A camera. The camera is set on a scene view and will focus on the object that it is attached to, with the exact transform and control defined by subclasses.

T3DPhysicsComponent - This is higher level physics than what is implemented by the rigid component. It is more for implementing game object specific interactions, like a player moving across a terrain.

T3DAnimationComponent - Handles several different types of animations. Includes a finite state machine for managing state based animations.

There are a few more not as important components, that I won't mention for brevity's sake.

farm2.static.flickr.com/1434/546346838_4c54c6d032.jpg?v=0
Projectiles.

With these components, we are working towards making a simple FPS game. In an attempt to make the component descriptions actually mean something, I'm going to give a basic overview of how we implemented the FPS player.

There are two physics states added to the physics component. OnGround and InAir. Each one handles the player's movement when the player is in its state. There is an animation component that has a finite state machine for animating the player's movement. There is also an animation that watches the value of the look direction and maps it to the player's head and arms so they follow the camera. A dts render component handles the actual rendering of the player.

A FPS camera type was implemented by deriving from the base camera component. It has the ability to toggle between first and third person and follow the look direction of the player. A mount component was added for mounting flags and weapons, and a rigid component was added for collision. That's pretty much it.

farm2.static.flickr.com/1210/546347062_fe5b70a51e.jpg?v=0
The player standing in a poly soup interior.

#1
06/14/2007 (1:00 am)
In addition to the components, we have also implemented a pretty sweet terrain system. Thomas already posted a .plan about the clipmaps for texturing, but I don't think mentioned anything about the geometry. The geometry is a quadtree based chunked level of detail heightmap. It uses TGE .ter files so the existing editors can be used, and will also import raw heightmaps or auto-generate based on a few input parameters. Several terrains can be placed in a level if one isn't big enough, although, it will probably be a rare case when that is necessary.

farm2.static.flickr.com/1053/546358349_3824de584b.jpg?v=0
This is an image of the terrain with a debug render mode. Basically, each level of detail is rendered in a different color in wireframe.

Hopefully most people have used Torque X 2D so the idea of components makes sense. Otherwise this was probably very confusing. If that is the case, grab the current version of Torque X and run through one of the starter tutorials. And, feel free to ask questions or comment. Part of the reason I'm posting this in the forums is because we want the updates to involve discussions.

There's still a lot to do to make this a full featured engine, so don't be expecting betas or release announcements anytime soon. We are going to keep giving updates periodically because we do want to keep everyone in the loop. The idea is to make them short, more frequent, and informal so they don't take very much time.
#2
06/14/2007 (1:49 am)
Thanks a lot for the update, sounds like great stuff.
#3
06/14/2007 (2:40 am)
Thanks for the update

Looks extreamly cool! Great work guys.

Aun.
Torque Motion
#4
06/14/2007 (8:12 am)
This looks fantastic and bravo for really sticking to OO methodologies. Components FTW! I'm curious why you didn't go with an atlas based terrain system versus .ter however? Is there plans to implement atlas at some point?

I didn't see any mention of GUI outside of what's available for 2D. How about a GUI builder? Is that in the works as well?

Are the components set up to easily be inherited from for building custom components on top (I feel stupid asking and hopefully it'll be a "duh" answer =D)
#5
06/14/2007 (12:22 pm)
The terrain system is actually a lot more like Atlas than legacy TGE terrain. It just reads the format exported from TGE. It could easily read an atlas file as well, support just hasn't been written for it.

I pretty much have no idea what is happening with editors right now, other than they are being worked on. It would be weird if gui editors didn't happen. The timeline may not match with Torque X though, so we might have to launch without them. Either way, though, we are pushing as much as we can to XML so that creating content is simple with or without editors.

The components are definitely designed to be subclassed. That is actually the intended purpose. Things like the physics component will probably have to be subclassed to be useful (we'll probably include a couple for different game types).
#6
06/20/2007 (9:11 pm)
So, do these new objects and features that are referred to in the original post exist in today's release? I installed the new release, but I am not seeing them in the T3D namespace so my guess is no. Thanks either way for the work guys.
#7
06/20/2007 (9:34 pm)
Man. I love this. It's great to see what's happening. So exciting!!
#8
06/20/2007 (9:59 pm)
No, today's release was the "1.0" release, which is primarily the 2D scene capabilities.

The discussion and pictures in this thread is what is coming down the pike.

Keep in mind that while it wasn't exposed to the editors, or discussed in the documentation, the original prototype 3D stuff from very early on wasn't physically ripped out of the release (as far as I am aware, I'm not on the Torque X team, so they may correct me)--but it's very important to realize that what may (or may not!) currently be in the 1.0 release regarding 3D should not be considered stable, or final in any way.