Game Development Community

3D playing area in TGB?

by Victor \"Leguma\" Mihailescu · in Torque Game Builder · 09/19/2006 (6:37 am) · 8 replies

I am wondering if TGB can allow you to make a game which would be played on a 3D field. Imagine for simplicity's sake a little man running around, jumping over obstacles and collecting mushrooms, but doing so on a sphere instead of something flat.

I know you can use a mix of 2D and 3D when making levels, so that you basically have a 2D layer and 3D things over it, but this would require a clean 3D approach from start to finish. Can this be done? I have read through as much documentation as I could find and could not find anything. Then again it could be there but I just can't see it because I can't really understand code (design department).

If anyone can give me a heads-up wether or not this can be done, it would be really appreciated.

About the author

Recent Threads


#1
09/19/2006 (6:44 am)
Not really. If you need a 3D world for your game, you'd be better looking at a 'proper' 3D engine rather than a 2D engine that has a few 3D bits bolted on.
#2
09/19/2006 (6:56 am)
Ah, but therein lies the problem... using the 3D Torque engine is a no go. That is built to work on a terrain that is a height map, it works with DTS shapes, it is unfortunately as far from what I wants as possible. Sure, It would be possible to make a sphere DTS, but can you get getting the player to walk on it, all over it? As soon as the player nears that equator, he's going to fall off, and gravity is simply an axis, not to mention that as far as I read you cannot do away with the terrain as it is quite deeply integrated into the whole thing.

Again, imagine playing Mario, except you are running over around and under a sphere. the camera will make it look like you are always on top of it but in reality you are moving around, and so are the other players. it's not just about 3D versus 2D, it's about the way the engine was thought. You couldn't do this in Quake or any other 'shooter engine' because the gravity and the map and so may other things were designed with something totally different in mind.

I was hoping that this engine would allow something of the sort so that the entire "write an engine" part could be skipped.
#3
09/19/2006 (7:26 am)
Could you just make a large flat map and warp the player to the opposite edge when they get near an edge. That would make it appear to be a continuous sphere that they walk around without all the hassle of actually creating a spherical world.
#4
09/19/2006 (7:43 am)
@Tom
Short Answer: Nope.

Long Answer: If you compare the recent Prince of Persia games to the original, you could conclude that you don't need 3D because you can simply break every bit of the action up into a 2D scene. Sure, it might work, but it would not be anything close to the game-play and feed of the true 3D thing.

Also, I used sphere in the example because it is the easiest to visualize. Replace sphere with a torus, or a pyramid, or cube out of which you subtract a sphere so that there are identical holes in all sides.
#5
09/19/2006 (7:58 am)
So, you're thinking of something like Super Mario Galaxy for the Wii which has planets that you jump to and do things on? that is such as specific gameplay element that I thing that creating your own render and physics properties would be the way to go. It is not only a strange (but admittedly cool) specificity, but an uncommon one. I don't know of any engines that would allow this quickly and easily out of the box without going through either a large core update (in the case of engines like TGE with built-in functionality) or building from the ground up in the case of game languages or API's/SDK's (BlitzEtc, core Irrlicht, TV3D, etc).
#6
09/19/2006 (8:14 am)
@ David

Actually, I gave the Mario example because it is as far from what I had in mind as possible. The principle is the same on an abstract level, however, and that's what is important. TBH I wasn't really expecting that TGB would be able to do this, but I had to make sure. No sense in reinventing the wheel if you can just buy one. oh well, thanks for the heads-up regardless.
#7
09/19/2006 (12:27 pm)
Victor: Just an idea, but perhaps you need to stop thinking so Galileon and go back several hundred years.

What I mean is, instead of thinking that you revolve around the globe, why don't you just make the globe revolve under you? Sortof like a log-roller that stays in one place, and the log rolls around underneath him.
www.demingloggingshow.com/images/Kids%20Log%20Rolling.jpgIf it's a very large log, then the log roller might get the impression that he's travelled a far distance, but in fact, the distance has been travelled underneath him.

I don't know how detailed or large you need all of this to be. In TGB, you can have tile maps loop both horizontally and vertically, but I get the impression that you don't just want a looping world, but that you actually want to show a bit of the curvature in the globe and objects disappearing off of the horizon in all directions? If so, using TGE is *not* out of the question -- because you wouldn't move the player around the DTS, you would merely rotate the DTS underneath the player and have the player always stay in the center of the screen (you could offset the camera due to momentum if you want to code that in though). Does that make sense? You said:
Quote:the camera will make it look like you are always on top of it but in reality you are moving around, and so are the other players.

So make it so that you *are* always on top, and in reality, the globe is just moving around underneath you. I don't know how much physics you need for this game and if you can approximate it yourself or not. How perfect do you need this stuff to be? Do you need to support projectile physics? Jumping? Variable height terrain? Tunnels through the earth? Networked multiplayer, or just computer AI? Much of what you're asking to do *can* be done in stock Torque, but it's extra flair like this that is going to pay for your programmer's kid's college tuition (or keep you up late at night if you're trying to code this yourself). If you need other players, perhaps you could mount the other players on the rotating globe and as they move just adjust where they're mounted to.

If you absolutely wanted to use TGB to do this, then you certainly could -- you would have to write your own parallax manager to do a warped version of parallax scrolling (so that objects move faster as they are closer to you, and slower as they move further away, until they hit the radius, at which point they are moved to the layer behind the globe until they come out somewhere else -- you would also have this parallax manager control the scale of these objects so that they shrink or grow depending on how close they are to the player). This could even be done completely in script -- but I don't know if it would give you acceptable results.

Edit: I just remembered that my friend wrote one of these completely in Javascript to use as part of his portfolio. You can check out his rotating-globe-of-experience right here. Is that sortof the effect that you're going for?

Does any of this help, or did I miss the mark completely?

Cheers!

--clint
#8
09/19/2006 (12:39 pm)
There have been a number of people looking at implementing curved worlds in Torque, though I do not know the status of any such projects. From your initial description, it reminded me of Super Mario Galaxy or to an extent, a piece of Prey.