Game Development Community

T2dTerrain

by Michael Woerister · in Torque Game Builder · 03/03/2006 (10:40 am) · 15 replies

Hi,
over the last 2 weeks or so, I've been working on my t2dTerrain object for John Klimek's upcoming, "Scorched Earth"-inspired game. This is what finally came out:

www.unet.univie.ac.at/~a0402917/terrain_screenshot.jpg
It's completely deformable and uses standard t2d physics, which means standard t2dSceneObject can interact with it. I tried to implement custom collision detection but after 4 days and some 30 hours of not getting it to work properly, I decided to go the easy way and use lots of simple t2dPhysics objects. This introduces some memory overhead but works fine in most cases.

It needed quite some tweaking but I like how it came out.

Try out the demo and tell me what you think. (If you type t2dScene.setDebugOn(0); into the console, you can tell me what fps you are getting. Would be quite interesting)

-Michael

#1
03/03/2006 (11:03 am)
That's excellent!

I get about 550fps idling, and I can drop to around 120fps by manically clicking on the landscape (using the default res that the app opens in).

P4 3.2 HT
2GB DDR2
GF7800 GTX
#2
03/03/2006 (11:19 am)
Yeah, that is cool!

I get about 549FPS idling, and I can get it down to about 169 by clicking on the landscape lots of times, with both the left-click and the right-click buttons. :)

That background is image great!

If you wanted the system specs, they are
AMD Athlon 64,
2.2GHz
1GIG Ram
GeForce 6800 LE
#3
03/03/2006 (1:50 pm)
Out of interest how did you do the deformable terrain? Did you follow a similar method as Justin Dujardin used explained in his plan www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=7689

FPS wise, I get 330fps idling and then clicking like mad it drops to 90fps.

System Specs:
2.8Ghz P4 HyperThreaded
1Gig ram (dual chan)
Geforce FX 5900xt

I've got a Geforce 6800 in the post though, so we'll see how much difference that makes :) (yes I've bought it in preperation for getting TSE, well that and to help boost my fps in quake4 to save having to run it in quake2/3 look alike mode)
#4
03/03/2006 (1:51 pm)
Ooh very fun.
Gotta find my old copy of scorched earth now :)

running this on my work pc (HP pavillion a1220n)
p4 2.93ghz
1gb ram
onboard intel video (yuck)
win 2k

ran at 39 fps at load
and
150 fps after clearing off the terrain with lots of clicking.
clicking rapidly did not affect the frame rate though, was very steady.
#5
03/03/2006 (2:24 pm)
Thanks for your info. Those framerates seem ok to me. I get about 300 fps on my notebook.

Quote:
Out of interest how did you do the deformable terrain? Did you follow a similar method as Justin Dujardin used explained in his plan

Just read this plan the first time. I've gone another route. The terrain has got only one height value per x-coordinate. It consists of lots of thin texture quads. When deformed texture coordinates and vertex colors are adjusted. Falling dirt are thin texture quads too. They raise the height value when reaching ground again.

I didn't dare to do bitmap manipulations on 3D hardware as this is slow as hell from what I hear. Haven't tried it though. Maybe if it's possible to "render" changes without constantly transferring data between main and video memory. But as I said, I haven't looked into this.


Quote:
ran at 39 fps at load
and
150 fps after clearing off the terrain with lots of clicking.
clicking rapidly did not affect the frame rate though, was very steady.

yes, this sounds like a fill-rate limitation. But 39 fps still seems "ok" for onboard graphics :)
#6
03/05/2006 (9:52 pm)
Wow Michael; I've been working on the exact same thing, but due to other commitments I've been sitting idle for the last week or so with only a few moments here or there to work on it. Have you gotten vehicles moving over the terrain yet? I've found that to be a little problematic so far, but perhaps I'm just not getting the parameters right on the physics.
#7
03/06/2006 (3:31 am)
@Jason
I can imagine that vehicle movement turns out problematic. At least with ridig body physics. Maybe you have to implement a custom collision response for that to really look good. But for some tanks to slowly drive around the onCollisionCallback should be sufficient.
#8
03/13/2006 (1:12 pm)
This is cool! :D

Uhm, T2D is capable of doing vehicles? I didn't know that! Could you kindly point me to some information on that matter? :)
#9
03/13/2006 (1:31 pm)
That's some really cool stuff. That'll be perfect for a worms style game.

I was getting around 250 fps idling. I was able to get that down to around 85 with a lot of rapid and frantic clicking.

Specs:
P4 2.4 GHz
1 GB RAM
Radeon 9600 256MB
Windows XP sp2
#10
03/13/2006 (1:51 pm)
Quote:
Uhm, T2D is capable of doing vehicles? I didn't know that! Could you kindly point me to some information on that matter? :)

Only if you are capable of doing vehicles ;)
There is no built-in object "vehicle" or anything like that. But vehicles are sprites as everything else in a 2d game. You just have to make the sprite behave like a vehicle. What that would look like depends on what type of game you want to make.


Quote:
That's some really cool stuff. That'll be perfect for a worms style game.

No, sorry, no worms games. Worms uses one very large bitmap that is modified over time whereas this uses one small texture that is repeated over and over again. And you cannot dig tunnels as the dirt always will fall down. Look at Justin Dujardin's plan (there is a link in a post above). That looks more like worms.
#11
03/13/2006 (4:50 pm)
Hmm ... I just try to remember how the game was called that used this type of "sand montains" for its terrain ...

But it was definitely fun :-)

I get around 70-80 FPS with fanatic powerbombing on a P-M 1,5Ghz (Banias) with Radeon 9700 mobile, so definitely fast.
The only problem I've seen so far is that the vertical texture slices become "split" (or the seams clearly visible) for a moment when bombing, while they go down ...
#12
03/14/2006 (2:02 am)
Quote:
Hmm ... I just try to remember how the game was called that used this type of "sand montains" for its terrain ...

Probably Scorched Earth or some clone.
#13
03/14/2006 (2:56 am)
Naw don't think so. was a game I played in the win95 / 98 time ... the time scorched earth was played, I played the "ape throw bananas by a given angle and power" that came with qbasic *I think it came with qbasic, not sure thought*
#14
03/14/2006 (5:13 am)
Gorilla, it was a scorched earth clone. That and nibbles were the two best qbasic demos.

Edit actually a link to it in that wiki post here
#15
03/11/2010 (11:12 am)
Can someone post the terrain.zip ? That url does not work any more :-(