Outerra forum

Outerra Engine => Technology => Topic started by: McArcher on August 23, 2010, 05:42:28 pm

Title: Terramorphing and falling trees feature
Post by: McArcher on August 23, 2010, 05:42:28 pm
Will Outerra support terramorphing and falling trees?

I think such feature will make explosions, hits from ammo or bombs, bulldozers, digging trenches with a shovel very realistic. Like in real life... We take shovels, use digging animation and in e.g. 15 min. we can have a small trench for a soldier :) Or a self-trenching mechanism of T-72/T-90 tank can make a trech for a tank in a few minutes :)
And if not, what is the chance to add this feature by future made addons/plugins.
Title: Terramorphing and falling trees feature
Post by: cameni on August 24, 2010, 01:29:35 am
Well basically the road system is capable of doing trenches as well. You'd just embed a dirt road deeper into ground, with short transitional areas (= steep sides). But there could be a special road profile for it as well.

Trees are marked in a map so removing some is possible, while keeping a list of fallen ones to be rendered separately ..
Title: Terramorphing and falling trees feature
Post by: ZeosPantera on August 24, 2010, 01:49:51 am
I have a few tree questions. Do the trees have a physics model? If you crash the tatra into one will it come to a stop or as McArcher said will they "fall over" under the control of the current physics engine?
Title: Terramorphing and falling trees feature
Post by: cameni on August 24, 2010, 02:35:48 am
Currently trees are transparent for vehicle physics so nothing happens. I'm not sure how to handle it yet - when a vehicle should fall the tree and when it should wrinkle on it. As it depends on vehicle construction, it will be probably a parameter somewhere there ..
Title: Terramorphing and falling trees feature
Post by: McArcher on August 24, 2010, 08:33:16 am
First of all, for trees may be used a simplified physics engine, as there are tonns of trees on the terrain.
I think behaviour of the tree must depend on 2 or 3 things:

1.   Tree's thickness, which will also be a modified tree's mass/weight to reduce CPU load,
2.   Vehicle's pulse (or impulse, p=m*v),
(3). Height of the point of collision with a tree (this parameter can be also thrown away to reduce calculations).

There can be a constant (for example, a Critical_multiplier_for_thickness), and

Code: [Select]
if (Vehicle's_Impulse * Height_of_Collision > Tree's_Thickness * Critical_multiplier_for_thickness)
{
     Tree_Falls();
}
else
{
     Tree_Doesnt_Fall();

};

or even simplier, each Tree's_Thickness will be that Critical impulse to fall the tree. and then:


Code: [Select]
if (Vehicle's_Impulse * Height_of_Collision > Tree's_Critical_Thickness )
{
     Tree_Falls();
}
else
{
     Tree_Doesnt_Fall();

};

If CPU is too loaded then we can calculate 2 different situations without Height_of_Collision, because land vehicles have similar height (+-0.5m):

Code: [Select]
if (Collided_Vehicle_Type == Type_Land_Vehicle) // collision with a land_veh
{
     if (Vehicle's_Impulse > Tree's_Critical_Thickness_for_Land_Vehicles ) // just one <, and no *
    {
          Tree_Falls();
     }
     else
     {
         Tree_Doesnt_Fall();
     };
}
else // collision with an air_veh
{
     if (Vehicle's_Impulse > Tree's_Critical_Thickness_for_Air_Vehicles ) // just one >, and no *
     {
          Tree_Falls();
     }
     else
     {
          Tree_Doesnt_Fall();
     };
};

well, actually, i'm not a pro programmer, I don't know what is faster: (1 IF== and 1 IF>)    or    (* and IF>)?


And, a question about terramorphing.  I meant, will the engine allow to modify the terrain during the gameplay (to simulate digging) ?
Title: Terramorphing and falling trees feature
Post by: cameni on August 24, 2010, 08:59:25 am
Yes, something like that, but the "critical thickness" should be dependent on vehicle construction as well. I mean, most vehicles are constructed to absorb the energy of impact, but of course not so a tank or a bulldozer.

The terrain can be modified, I thought I answered it with the trenches but now I realize that it wasn't sufficient.
So the answer is that terrain modifications can be done by vector patches, that modify elevation and texturing both. This can be gradual so that the trenches get deeper with time, or instant for craters after explosions.
Title: Terramorphing and falling trees feature
Post by: McArcher on August 24, 2010, 09:48:20 am
Well, then this game engine is going to be the best in the world :) Great!
Title: Terramorphing and falling trees feature
Post by: ZeosPantera on August 24, 2010, 02:09:43 pm
You would also need a random variable in your tree equation. Not all trees are created equal (unless cameni says so). Plus the type of tree (maple, oak, pine, redwood) would differ the force required to fell the tree to change. Also if your in a toyota camry and hit even a large tree at 90 mph odds are you will snap that tree in half so the speed and mass of said vehicle will need to be accounted for. And if your a lunatic the simulation of the effect of ground erosion on the root system based on estimated height maps of the terrain and average wind speed in the area.

And also you have to think of the lowly termites.

EDIT: I think for the next tree you add, since you currently only have one, it should be the redwoods. I don't think I have ever played a game that could properly display their enormity. And weaving the tatra truck through the bases would be FAN-TASTIC.

(http://sunnyfortuna.com/explore/images/aveofgiants3.jpg)
Title: Terramorphing and falling trees feature
Post by: corona on August 24, 2010, 03:54:08 pm
Quote from: ZeosPantera
I think for the next tree you add, since you currently only have one, it should be the redwoods. I don't think I have ever played a game that could properly display their enormity. And weaving the tatra truck through the bases would be FAN-TASTIC.
I think what they should do is with the demo release whatever tools they use to import stuff into the engine, and the let community go wild. Doesn't need to be a full SDK, just release model specs and a few parameters to place stuff.
Title: Terramorphing and falling trees feature
Post by: McArcher on August 24, 2010, 04:39:06 pm
Quote from: corona
I think what they should do is with the demo release whatever tools they use to import stuff into the engine, and the let community go wild. Doesn't need to be a full SDK, just release model specs and a few parameters to place stuff.

Yes, the community will help the project grow even more than in PC games with rich editors! New classes, new actions, new models, new animations, textures, new world.... :D

Look at Arma2 with its poor editor. Even there people make a lot of new addons, isles, vehicles, weapons, scripts... ACE2 mod which greatly modifies the game was made becuse Arma's developers are very lazy :) btw scripts in arma2 are very laggy and stupid, because they are not in game's language, but in new layered code which makes it very laggy....sorry for bad english :D
And in this project (Outerra) devs are not lazy at all, and I think if everyting goes as planned, this is going to be a very successful project....a constructor of games! :D
Title: Terramorphing and falling trees feature
Post by: Headsetsniper on August 26, 2010, 11:19:57 am
Quote from: cameni
So the answer is that terrain modifications can be done by vector patches, that modify elevation and texturing both. This can be gradual so that the trenches get deeper with time, or instant for craters after explosions.

So this means that you can let explode something on the terrain, and there is a crater instaly after the explosion, and also physics will instalty apply to this terrain modification (collision detection etc) without reloading the heightmap/dataset???.. wow!!!!
Title: Terramorphing and falling trees feature
Post by: cameni on August 26, 2010, 11:56:20 am
Well, yes, using a looser definition of "instantly" :D
Generally it will take 2-3 frames to appear both visually and be reflected in physics. I think this cannot be a problem - even a much higher latency could be effectually hidden by particles during the explosion.
Title: Terramorphing and falling trees feature
Post by: McArcher on August 26, 2010, 01:10:23 pm
I agree, we can sacrifice the realistic blowing, because all this will be hidden by smoke and fire after explosion or just smoke after collision. Even this feauture i cannot find in modern PC games, so for me terramorphing is a great feature!
Title: Terramorphing and falling trees feature
Post by: RaikoRaufoss on August 26, 2010, 01:19:48 pm
Yes, we can sacrifice realistic explosions for now, but I think a third party plug-in for realistic explosions would be nice and will probably be made.
Title: Terramorphing and falling trees feature
Post by: Headsetsniper on August 26, 2010, 04:11:35 pm
Quote from: cameni
Well, yes, using a looser definition of "instantly" :D
Generally it will take 2-3 frames to appear both visually and be reflected in physics. I think this cannot be a problem - even a much higher latency could be effectually hidden by particles during the explosion.

and when you fly away, to the other side of the planet, and come back, is the crater still on the place whery it should be? or does it dissolve when you get out of the LOD range? And if not, how many "craters" can you save?
Title: Terramorphing and falling trees feature
Post by: RaikoRaufoss on August 26, 2010, 04:27:44 pm
A question related to Headestsniper's: If the craters remain undisturbed, will vegetation start growing in them, like in real life?  Of course, this is assuming an MMO server setting running for extended periods.
Title: Terramorphing and falling trees feature
Post by: cameni on August 26, 2010, 04:49:41 pm
Quote from: Headsetsniper
and when you fly away, to the other side of the planet, and come back, is the crater still on the place whery it should be? or does it dissolve when you get out of the LOD range? And if not, how many "craters" can you save?
Depends. Since this is basically a variation of road system, a vector data overlay, it can be stored permanently in the same way as the road data, or just kept in memory and discarded or saved after it goes out of view. Number of such craters would be limited only by the available memory, but since these are vector-defined, they take very small space. Of course, there could be performance problems if there were huge quantities of such overlays, but I don't know where's the limit yet.

@RaikoRaufoss There's no concept of growing yet, nor of the changing seasons. Changing probability of vegetation growth will be the subject of new climate system, so this possibility exists.
Title: Terramorphing and falling trees feature
Post by: McArcher on August 26, 2010, 06:24:05 pm
cameni,
I hope this engine will support large amount of RAM? Expanding RAM is the cheapest way to upgrade PC, I think. (If not buying OC'ed editions of memory modules, of course)
Title: Terramorphing and falling trees feature
Post by: RaikoRaufoss on August 26, 2010, 06:35:21 pm
Quote from: McArcher
cameni,
I hope this engine will support large amount of RAM? Expanding RAM is the cheapest way to upgrade PC, I think. (If not buying OC'ed editions of memory modules, of course)
It should, and it will have to, owing to PC specs these days.
Title: Terramorphing and falling trees feature
Post by: ZeosPantera on August 26, 2010, 11:18:37 pm
Quote from: cameni
Since this is basically a variation of road system, a vector data overlay, it can be stored permanently in the same way as the road data, or just kept in memory and discarded or saved after it goes out of view.

Permanent Terrain Deformation in a game is an insane thought. Just go in everyday and blow your name into the ground.

"Hey Josh? Isn't that the hole in the ground from yesterday where you blew up?"
Title: Terramorphing and falling trees feature
Post by: Headsetsniper on August 27, 2010, 05:46:05 am
ah okay. so you dont edit the actual dataset/heightmap for the craters, you just put a displacement "patch" on the top of it and leave the datasource untouched? how does that work with the collision mesh? is the collision mesh updated extra or how did you do that... ?
is it possible to edit the terrain, with a "paint tool" at runtime like in sim city. klick safe, and the next day, your holes and new mountains are still there? or can you just apply "patches"??? must be tricky with a giant dataset like bluemarble. how did you manage to update these TONS of data in seconds??
Title: Terramorphing and falling trees feature
Post by: cameni on August 27, 2010, 06:49:22 am
Well, the "heightfield" or the base dataset is in ~76m resolution, so it would not work well as a collision mesh anyway. We have to use the one that gets created by fractal algorithms, and we do that only after the patches are applied - so that's the secret :)

Paint tool isn't implemented yet, but it will be - it will override what fractal generates at specific detail level. For large area changes in building phase we shall use that.