Adding New Trees
#1


Hello,




I want to add a couple of trees to vanilla, that will be planted by a forester. I don't really want them in an orchard, and I don't want them growing wild, just planted by a new forester building. I want them this way so they spawn specific resources for some production chains. I've looked at the fig tree supplied with the mod kit, and modeled a (poor) fir tree. However, I have no idea what the camera, or other parts of that .fbx are, where they need to go, etc. Also, a bit confused about the three UV channels needed. It also doesn't help that the tree template in the resource refers to 4 spruce and birch models (but only one oak model). Why?




Would someone mind taking a bit of time to put together a blow by blow on how to model a tree and put it in the game? I think I get coding it into the game, apart from the 4 models, but not sure about actually building it.




 




Cheers


  Reply
#2


The NaturalResourceTree.rsc has a bunch of different kinds of model files so that the map can be populated by all of the different variations of trees equally. I suppose it was easier for Luke to make a master tree file instead of trying to balance the spawning of 3 different trees simultaneously.   Just load up NaturalResourceOakTree.rsc and copy that one, since it just has the 1 mesh file referenced.




I just ignore that camera thing in the fbx file. I suppose it may do something with lighting or something, but it doesn't have any effect on the actual model.




I don't really know how to make the actual tree. <a contenteditable="false" data-ipshover="" data-ipshover-target="<___base_url___>/index.php?/profile/4-shockpuppet/&do=hovercard" data-mentionid="4" href="<___base_url___>/index.php?/profile/4-shockpuppet/">@ShockPuppet</a>is the resident tree expert. I'm not sure how to connect the tree model with the falling down animation part.


  Reply
#3

Right of course, I completely forgot there were more than one version of the trees! Thanks.

  Reply
#4


Ah trees, yes, a skillset of its own. 




Gather 'round while I share with ye the things known by me.




The texture is a 4 square "quad map". The left side, 2 squares bark. The right side top, leaves that will wither and vanish. The remaining square, branches. This texture uses alpha channel to denote transparency.




The material instance rsc file needs to use Billboard Material as per fig example.




The model, make it and map it's uv as per your quad texture. 




The trick, the leaves and animation. Here's what I do.




I steal a fig tree example leaf. It's got the right size already you see. I steal that 1 leaf, change its material to my new tree one, and attach that leaf to the tree somewhere floating in the branches. I then duplicate that leaf all around the tree. Remember, our billboard material will grow that leaf many times in size, it'll also ensure that all leaf parts of the model are forward facing at all times. 




Next, animation. The example is 150 frames. Comprises of transformation movement in 3 groups, iirc they are chop, sink and fall. I load up the fig tree, export those animations out. Then load the new tree, attach the animation to the tree (load animation, all frames, replace absolute). Our tree model then needs to have an animation map made, so I make a new one, ensuring all transform coordinates are loaded with the new animation. I do this with the load animation tool in 3dsMax.




My tree will then perform the animations as required. 




Learning this takes time.


  Reply
#5


even for me it sounds like chinese hehe




but <a contenteditable="false" data-ipshover="" data-ipshover-target="<___base_url___>/index.php?/profile/4-shockpuppet/&do=hovercard" data-mentionid="4" href="<___base_url___>/index.php?/profile/4-shockpuppet/">@ShockPuppet</a> is the BEST man [img]<fileStore.core_Emoticons>/emoticons/smile.png[/img]/emoticons/smile@2x.png 2x" title=":)" width="20" />

  Reply
#6

Quote:
14 minutes ago, Ketchup said:




even for me it sounds like chinese hehe




but <a contenteditable="false" data-ipshover="" data-ipshover-target="<___base_url___>/index.php?/profile/4-shockpuppet/&do=hovercard" data-mentionid="4" href="<___base_url___>/index.php?/profile/4-shockpuppet/">@ShockPuppet</a> is the BEST man [img]<fileStore.core_Emoticons>/emoticons/smile.png[/img]/emoticons/smile@2x.png 2x" title=":)" width="20" />



Second best next to you my friend 




 




I just realised what I wrote sounds difficult, it's not. Just it needs exact steps that must be correct to work.


  Reply
#7

personally i am a visual [img]<fileStore.core_Emoticons>/emoticons/smile.png[/img]/emoticons/smile@2x.png 2x" title=":)" width="20" />
  Reply
#8


Thanks for that <a contenteditable="false" data-ipshover="" data-ipshover-target="<___base_url___>/index.php?/profile/4-shockpuppet/&do=hovercard" data-mentionid="4" href="<___base_url___>/index.php?/profile/4-shockpuppet/">@ShockPuppet</a>. You know, I got the deciduous trees to work well, even simpler I just make a copy of the fig fbx, added my own texture, then just scaled the tree and moved leaves around. Seems more do-able for a simpleton like me you see rather than make it from scratch.




That being said, I've tried to make some conifers, but they are seemingly a bit trickier as I need to make them from scratch without any pine reference files. I have a couple more questions if you don't mind.




1) Texturing conifers - what does the map look like for them? Is it the same lay out as the fig? I've made it so that one half is bark for the trunk, and the other half is for the branches with needles. I made the model of a simple trunk, then added cones of 8 faces (I think, maybe 12) a few times down it which were applied to the needle and branch side. One of the problems is it looks bad in game. Well, the fir doesn't look so bad, but the others do as the texture on the leaves/branches is very blurry. I think I am trying to add too much detail into such a small space and it just comes up a distorted mess. Can you use multi materials with trees or is this too much video resource power?




2) How many polys is acceptable for a tree that will be spawned by foresters?




3) How do you make pines sway? I assume this is UV channel 3. When I add the third channel, the tree sways nicely, but the texture of the leaves gets distorted (although, I did realize I was using the billboard code and the pine has a different foliage code, so that might be why).




4) Following on from 1, any good tree texture resources out there? I'm struggling finding anything decent through google images, sketchup texture club, textures.com, or deviant art (but that is probably because there are so so many hits for 'pine branch' and none are of pine branches).




 


  Reply
#9


RE Texturing... I did just make this...




Currently at 1,431 faces, 2,866 tris. Probably too many, but it is a good start. Need to play around with the colors but it looks pretty cool.




I followed this instruction if anyone is interested...<a class="ipsAttachLink ipsAttachLink_image" href="<fileStore.core_Attachment>/monthly_2017_01/TestingTrees.png.e72a278dc50d9e8eb40ecae01d962bbd.png" data-fileid="1164">[img]<fileStore.core_Attachment>/monthly_2017_01/TestingTrees.thumb.png.77f086b3674b37fb46916c6f80eba5af.png[/img]</a>




http://hyperbeamgraphics.com/tuttree.html


  Reply
#10

Quote:
2 hours ago, Necora said:




1) Texturing conifers - what does the map look like for them? Is it the same lay out as the fig?




it doesnt matter actually, for foliage materials any is fine [img]<fileStore.core_Emoticons>/emoticons/smile.png[/img]/emoticons/smile@2x.png 2x" title=":)" width="20" />



 



Quote:
2 hours ago, Necora said:




2) How many polys is acceptable for a tree that will be spawned by foresters?




as few as possible, 100? 200?




 



Quote:
2 hours ago, Necora said:




3) How do you make pines sway? I assume this is UV channel 3. When I add the third channel, the tree sways nicely, but the texture of the leaves gets distorted (although, I did realize I was using the billboard code and the pine has a different foliage code, so that might be why).




youll find thats your billboard code being crazy [img]<fileStore.core_Emoticons>/emoticons/smile.png[/img]/emoticons/smile@2x.png 2x" title=":)" width="20" /> must be foliage




 



Quote:
2 hours ago, Necora said:




4) Following on from 1, any good tree texture resources out there?




Google image search (for real!). Otherwise, the pngandtubes deviant art i linked to in the texture resources thread has a lot of cool stuff [img]<fileStore.core_Emoticons>/emoticons/smile.png[/img]/emoticons/smile@2x.png 2x" title=":)" width="20" />

  Reply