Welcome to Black Liquid Software

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

  • 0
Necora

Adding New Trees

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

Share this post


Link to post
Share on other sites

13 answers to this question

  • 0

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. @ShockPuppetis the resident tree expert. I'm not sure how to connect the tree model with the falling down animation part.

1 person likes this

Share this post


Link to post
Share on other sites
  • 0

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

Share this post


Link to post
Share on other sites
  • 0

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.

2 people like this

Share this post


Link to post
Share on other sites
  • 0

even for me it sounds like chinese hehe

but @ShockPuppet is the BEST man :)

1 person likes this

Share this post


Link to post
Share on other sites
  • 0
14 minutes ago, Ketchup said:

even for me it sounds like chinese hehe

but @ShockPuppet is the BEST man :)

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.

1 person likes this

Share this post


Link to post
Share on other sites
  • 0

Thanks for that @ShockPuppet. 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).

 

Share this post


Link to post
Share on other sites
  • 0

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...TestingTrees.png

http://hyperbeamgraphics.com/tuttree.html

1 person likes this

Share this post


Link to post
Share on other sites
  • 0
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 :)

 

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?

 

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 :) must be foliage

 

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 :)

Share this post


Link to post
Share on other sites
  • 0

I'm just hopping in to crack open this old discussion. @Necora Did you manage to get the pine trees to work ingame (with the animations and all) using blender? I've looked a bit into the fig example, but I have no knowledge of animations and couldn't make any sense of it.

Share this post


Link to post
Share on other sites
  • 0

@Bartender yup they work in game just fine. The one thing I'm not sure of is the falling animation, I've not actually looked into it, so I doubt my trees do it. Perhaps they just vanish when cut. I looked into the fig tree example but unfortunately it is not very informative regarding how it is done. 

 

If I get time I'll look into it more.

Share this post


Link to post
Share on other sites
  • 0

Thanks, I'll keep trying myself as well then. I noticed that blender doesn't seem to handle the animations from the fbx files very well, when I tried some things with the chicken example, importing and then exporting the file again completely messed up the animations in game.

Share this post


Link to post
Share on other sites
  • 0

yeah they will just disappear when cut :)

it is not a bid deal ^^ the look of those trees compensate largely :)

1 person likes this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now