crazy_Baboon Posted May 7, 2021 Report Share Posted May 7, 2021 (edited) 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 May 11, 2021 by crazy_Baboon 2 Quote Link to comment Share on other sites More sharing options...
Stan` Posted May 7, 2021 Report Share Posted May 7, 2021 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. https://trac.wildfiregames.com/wiki/List%3A_Entities%3A_Nature%3A_Flora%3A_Plants#TREESTUMPS https://trac.wildfiregames.com/ticket/1017 https://wildfiregames.com/forum/topic/15322-need-blender-help-please/?tab=comments#comment-228892 https://wildfiregames.com/forum/topic/20290-falling-trees/?do=findComment&comment=311983 https://wildfiregames.com/forum/topic/35725-tree-stumps/?do=findComment&comment=415025 https://wildfiregames.com/forum/topic/24628-flora-agriculture-related-ideas-and-requests/?do=findComment&comment=358975 1 1 Quote Link to comment Share on other sites More sharing options...
Freagarach Posted May 7, 2021 Report Share Posted May 7, 2021 So basically: Give a tree HP and a death animation and you're good to go. It would totally ruin your gameplay, however. 5 1 Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted May 7, 2021 Report Share Posted May 7, 2021 14 hours ago, Freagarach said: So basically: Give a tree HP and a death animation and you're good to go. It would totally ruin your gameplay, however. It's Alpha 23 or nuthin. Quote Link to comment Share on other sites More sharing options...
crazy_Baboon Posted May 8, 2021 Author Report Share Posted May 8, 2021 (edited) 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 May 8, 2021 by crazy_Baboon Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted May 8, 2021 Report Share Posted May 8, 2021 47 minutes ago, crazy_Baboon said: Thanks @Stan` 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! I believe that is a pre-made animation. Quote Link to comment Share on other sites More sharing options...
Stan` Posted May 8, 2021 Report Share Posted May 8, 2021 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. Quote Link to comment Share on other sites More sharing options...
crazy_Baboon Posted May 8, 2021 Author Report Share Posted May 8, 2021 Thanks @wowgetoffyourcellphone, Quote I believe that is a pre-made animation. 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... Quote Link to comment Share on other sites More sharing options...
crazy_Baboon Posted May 8, 2021 Author Report Share Posted May 8, 2021 1 minute ago, Stan` said: There's a stump though. We don't have that Still need an anim. Fair enough, we would need to crate some stumps, which i could try that in Blender, as I am ok with Blender 3D. Could we have pre-made animations like @wowgetoffyourcellphone suggested? Quote Link to comment Share on other sites More sharing options...
Stan` Posted May 8, 2021 Report Share Posted May 8, 2021 30 minutes ago, crazy_Baboon said: Fair enough, we would need to crate some stumps, which i could try that in Blender, as I am ok with Blender 3D. 30 minutes ago, crazy_Baboon said: Could we have pre-made animations like @wowgetoffyourcellphone suggested? Sure, but then you'd need to rig three hundred trees Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted May 8, 2021 Report Share Posted May 8, 2021 9 hours ago, Stan` said: Sure, but then you'd need to rig three hundred trees Surely it would be a very simple rig? It's more like 280. Quote Link to comment Share on other sites More sharing options...
Stan` Posted May 9, 2021 Report Share Posted May 9, 2021 Yeah. Two bones (one for the stump, one for the trunk) Then you need to cut the tree in two parts the stump and the trunk and finally you need to add a little cap on both so you cannot see through. Quote Link to comment Share on other sites More sharing options...
Andrettin Posted May 9, 2021 Report Share Posted May 9, 2021 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). 1 Quote Link to comment Share on other sites More sharing options...
crazy_Baboon Posted May 9, 2021 Author Report Share Posted May 9, 2021 (edited) 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 May 9, 2021 by crazy_Baboon 1 Quote Link to comment Share on other sites More sharing options...
Palaiologos Posted May 9, 2021 Report Share Posted May 9, 2021 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) Quote Link to comment Share on other sites More sharing options...
crazy_Baboon Posted May 11, 2021 Author Report Share Posted May 11, 2021 (edited) 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 May 13, 2021 by crazy_Baboon Quote Link to comment Share on other sites More sharing options...
crazy_Baboon Posted May 16, 2021 Author Report Share Posted May 16, 2021 One good reason to implement falling trees: consistency. We already have falling animals, so why not trees? We could start with some specific trees, and then improve from there... Quote Link to comment Share on other sites More sharing options...
Stan` Posted May 16, 2021 Report Share Posted May 16, 2021 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. 1 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.