Game Development Community

Blending Torque2D and vector graphics?

by Mark S. · in Torque Game Builder · 02/22/2006 (8:48 pm) · 2 replies

I am in the design phase for a game that heavily uses vector graphics, and have a few questions about the Torque2D engine. I have been using libSDL (non-openGL) and agg for prototyping. However, it has become apparent that I have become fill-rate limited. Since I need to update the entire screen on most frames, the traditional diry-rectangle updates don't work and the majority of the time is simply spent blitting to the screen. I am now looking at moving to a solution that uses graphics card acceleration, and would rather use an existing engine than delaying actual game code for a few months and rolling my own.

There are two main ways I can think of to render, but am not sure of the capabilities of Torque2D:
1) I can render the more complex objects onto a texture map on-the-fly and then use as a regular sprite. This works for the main character, enemies, incidental objects, etc. I assume that it is possible to directly draw on a texture map then assign it to a sprite. Is this true?

Reading one of the dev's recent .plans seemed to indicate that it was possible to use real 3D objects to render sprites (similar to what I described in step 1) - is this functionality available with the Torque2D engine alone, or do you also need to have purchased the TGE?

2) The playfield for this game is vector based - and the player needs to be able to quickly rotate and zoom in and out at dramatically different scales with different levels of detail. (Think of an interactive blue-print) What low-level drawing primitives are available? Can lines and curves be drawn? And if so, can these be triangle strips (or whatever the underlying primitve is) rather then a texture map?

As a side note. it is very difficult to evaluate an engine when you cannot see the API and most of the tutorials are locked away until after purchase. Is the wiki site going live to the public anytime soon?

Having looked at the available demos, I have a few concerns:
1) When in windowed mode, the mouse cursor sprite remains visible even when the cursor is outside the window. Can the engine use the native mouse cursor (or hide the sprite when the mouse exits the application)?

2) Neither the fish demo or the shooter demo actually show any animated sprites. I assume this is an art issue rather than a fundamental engine issue?

3) More alarmingly, the shooter demo exhibits a rippling effect on the parallax scrolling background. It appears that the graphics update and screen refresh are not synch'd. Is this peculiar to the shooter demo, my machine, or the engine as a whole?

Minor quibbles aside, this looks like a very powerful engine, even in pre-release stages.

Thank you for any information you can give!

#1
02/23/2006 (1:35 pm)
While I can't answer your vector based questions, a few comments on your demo concerns:

The reason most stuff is under lock and key is because T2D allows you to create full featured games in Torquescript, no need to modify the C++ code. If a demo of the engine was released similar to TGE, you could make a game with it. From the EULA:

Quote:(e) Licensee may not distribute uncompiled script code which defines any Torque 2D-specific functionality, including but not limited to creating or mainpulating sprites, tiles, particle effects, etc, in any manner, unless recipient also has a license to the Engine.

This is why even when TDN goes live, all tutorials and articles about T2D will still be for T2D owners only.

For everything else:
1. Yes, it is possible to make the cursor disappear or change it's appearance when the mouse leaves the window.

2. Animated sprites are supported. Very easy to set up and use.

3. I just ran the shooter demo from my beta 1.1 copy. I do not notice a rippling effect in the background.

Keep in mind these demos were done in a matter of hours or days, which in a way shows how easy it is to get a game idea up and running. Hope this helps.
#2
02/23/2006 (9:00 pm)
Thanks, Mike. I guess that is the danger with having a very easy-to-use system!

Hopefully someone else can comment about the vector questions, but the information you provided is helpful.