Jump to content

What would it take to implement falling trees?


Recommended Posts

Hi,

I am wondering how to implement the following:

1) When a player cuts a tree, the tree will fall in some direction.

 

Has any work on this been done?

What technology would it be required to implement these two features (C/C++, JavaScript...,)?

What would be the best way to start?

 

Thanks!

 

 

EDIT: Previously, there was a point 2):

2)the tree could kill units while falling, that would have to run away from the falling tree.

But this is probably a bad idea so i removed it...

Edited by crazy_Baboon
  • Like 2
Link to comment
Share on other sites

Let's say there are approximatively 300 tree variations. (650 files in gaia, minus the rocks, plus the files not named tree, minus bushes, minus tree leaves)

If we wanted to do it the the art way, you'd have to change those 300 files to have various animations, maybe one or two. Some trees are made of multiple parts e.g can come under the form of three palm trees.

If we wanted to do it the programming way, the problem would be that three would look weird when falling because it has no roots. To fix that you need new art which 300 new roots.

As for death damage the engine already supports it for living units, but not really for resources because they do not have HP and as such can't die. You could do it like sheep however, and have the death deal death damage, then play the falling animation.

Relevant discussions.

 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Thanks @Stan`

 

Quote

If we wanted to do it the programming way, the problem would be that three would look weird when falling because it has no roots. To fix that you need new art which 300 new roots.

Not quite. For example, in minutes 7:16 - 7:30 it is possible to see how falling trees are handled by AoE 3. Quite nice technique and no need to implement/add art for roots!

 

 

 

Edited by crazy_Baboon
Link to comment
Share on other sites

1 hour ago, crazy_Baboon said:

Not quite. For example, in minutes 7:16 - 7:30 it is possible to see how falling trees are handled by AoE 3. Quite nice technique and no need to implement/add art for roots!

There's a stump though. We don't have that Still need an anim.

 

Link to comment
Share on other sites

22 hours ago, crazy_Baboon said:

Thanks @wowgetoffyourcellphone,

It still rocks and it is great eye candy, IMO.

Perhaps it would be too much of an hassle to implement people dying from falling trees...

IMO: even if feasible to implement people dying from falling trees, I'm not sure I see a gameplay advantage to doing it... it would be cool the first time to see it, but then it would probably either be ignored (if units deal with it on their own) or get tiresome (if the player has to micro their wood gatherers).

  • Like 1
Link to comment
Share on other sites

2 hours ago, Andrettin said:

IMO: even if feasible to implement people dying from falling trees, I'm not sure I see a gameplay advantage to doing it... it would be cool the first time to see it, but then it would probably either be ignored (if units deal with it on their own) or get tiresome (if the player has to micro their wood gatherers).

Exactly, I agree: best to leave it just for the animation!

Edited by crazy_Baboon
  • Like 1
Link to comment
Share on other sites

On 07/05/2021 at 4:00 AM, crazy_Baboon said:

1) When a player cuts a tree, the tree will fall in some direction.

AND

2)it could kill units while falling, that would have to run away from the falling tree.

1) Cool idea, like it :)

2) Your a psychopath :)

3)    "   "   Logger Killed when Struck by Top of Falling Tree, which was Felled by an Adjacent Cutter  "  "    

https://www.cdc.gov/niosh/face/stateface/wa/98wa076.html

  -     How would a situation such as this work? We would lose our own units due to lax occupational safety hazards?   (also ties into 1)

Link to comment
Share on other sites

On 10/05/2021 at 12:50 AM, Palaiologos said:

https://www.cdc.gov/niosh/face/stateface/wa/98wa076.html

  -     How would a situation such as this work? We would lose our own units due to lax occupational safety hazards?   (also ties into 1)

it would only add to the realism of the game!

But I agree, point 2 is probably a bad idea...

Edited by crazy_Baboon
Link to comment
Share on other sites

10 hours ago, crazy_Baboon said:

good reason to implement falling trees: consistency.

Careful that's a double edged sword.

Anyway I'm not opposed to it, I just don't have time to look into right now. If you now blender it should be pretty easy to do.

1. Create a rig with 2 bones.

2. Import a tree

2. 1 Use the bisect tool to cut the tree somewhere or use the existing subdivisions and press y to separate either the top or the bottom

2.2. add an armature modifier to the tree and link the rig you can also make the rig a parent of the mesh and use add empty weights

2.3 make sure the bottom of the tree and the top are assigned to the vertex groups

2.4 using the rig move the tree around so you can add two caps on both extremities

2.5 add the animation (make the top part fall using the top bone and make it bounce a little when hitting the ground. Note it will look weird on uneven terrain

2.6 export the mesh and the rig and replace the original dae, and export also another dae called something like tree_death or something ( you might be able to reuse it)

2.7 generate the skeleton xml file using my script or by hand

2.8 edit the actors to reference the new anims

2.9 edit the tree templates so that it requires to be killed before falling

Or

Edit the resource supply.js file so it supports death animations (more complex) when low on a resource (an example can be the health variants in health.js)

Just rig the other trees with that animation.

Note : Some trees have separate foliage you might have to make it disappear because it's not made to be seen from under.

 

 

 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...