Trees in Blender

Your forum for all discussions around Modding.
sablerock
Posts: 119
Joined: Sat Dec 10, 2022 1:58 pm

Trees in Blender

Post by sablerock »

Guys
We have been trying for weeks to create cuttable trees for game. This with Blender guru. The tree is either not cuttable or when its cuttable, doesn’t fall over, endless problems.
Also, since giants exporter doesn’t give option to add SPLITTYPE, when we add it directly in xml, then resaving the i3d immediately removes SPLITTYPE from xml.
So, basically we’re just looking for confirmation that trees can ONLY be designed in Maya.
Any ideas?

Edit don_apple: topic moved from "General Discussion" to "Modding", since it is about creating or changing a mod and not a general discussion about the game itself.
TheSuBBie
Posts: 546
Joined: Wed Jun 10, 2020 11:38 am

Re: Trees in Blender

Post by TheSuBBie »

What Blender version are you using ?
sablerock
Posts: 119
Joined: Sat Dec 10, 2022 1:58 pm

Re: Trees in Blender

Post by sablerock »

Very latest 3.6.2
TheSuBBie
Posts: 546
Joined: Wed Jun 10, 2020 11:38 am

Re: Trees in Blender

Post by TheSuBBie »

That may be your problem as the Blender Exporter was designed to work with Blender version 2.93.

There is a new version of the Blender 13d exporter in the pipeline (along with a new GE), in the meantime I suggest you try using the 2.93 version.
sablerock
Posts: 119
Joined: Sat Dec 10, 2022 1:58 pm

Re: Trees in Blender

Post by sablerock »

Ok. Will try tomorrow.
sablerock
Posts: 119
Joined: Sat Dec 10, 2022 1:58 pm

Re: Trees in Blender

Post by sablerock »

TheSuBBie, we have our tree made with branches. Uv unwrapping with nice diffuse file( converted to dds with giants tool). We uv mapped the stump crosscut section in blender. Exported i3d. Tree looks great in GE, with the cut section at bottom in place. BUT, once we put it ingame and cut tree off, everything works, except the image on stump is a blurred version of trunk texture, and NOT the uv unwrapped part. Now been trying for 12 hrs to fix just that bit. What are we missing? Help pls!!!!
TheSuBBie
Posts: 546
Joined: Wed Jun 10, 2020 11:38 am

Re: Trees in Blender

Post by TheSuBBie »

Regarding your fuzzy textures try selecting custom parallax in the treeTrunkShader and either use the default height map or create your own
sablerock
Posts: 119
Joined: Sat Dec 10, 2022 1:58 pm

Re: Trees in Blender

Post by sablerock »

It’s not about fuzzy textures on cut section. In GE everything looks good AND the cut. When planted, tree also looks good..until we cut it. Then the cut does NOT show the image we uv mapped it to. We don’t have height file, will try that tomorrow. By the way, cannot get the leave system to work at all. Ingame leaves are attached to main branches. As soon as we cut the tree, whole leaves system disappears!
TheSuBBie
Posts: 546
Joined: Wed Jun 10, 2020 11:38 am

Re: Trees in Blender

Post by TheSuBBie »

Apologise I thought that the issue was a texture problem
the image on stump is a blurred version of trunk texture
I'm not familiar with the leaves creation in FS22 although the ingame leaves do not have any polygons select LOD0Attachments on any tree in GE (with show Poly count selected) and you will see that leaves have no vertices or triangles.
Are your leaves set up the same ?
sablerock
Posts: 119
Joined: Sat Dec 10, 2022 1:58 pm

Re: Trees in Blender

Post by sablerock »

No they have polygons because looks like it’s one of the best kept secrets how to render them in blender/maya without polygons. We render in Blender now and export fbx to maya. The maya giants exporter doesn’t create errors when opened in GE. I just can’t understand that this information is not available. INF modding created tree pack, but impossible to find him. In the end I believe it’s something simple, but without these experts communicating, I will have to stop this map making project. I’ve hired a blender expert who’s been with me for 7 days and we can’t get it to work . Already lot of money spent and no tree!!
Stegei
GIANTS Software | CTO
Posts: 1788
Joined: Sat Jun 09, 2007 10:51 am

Re: Trees in Blender

Post by Stegei »

The ingame leaves are a special geometry type which is why the current editor does not show a triangle count for those. A future version of it will have this changed.

For the leaves/branches, it's important to have a proper pivot position and orientation setup.
1. The pivot has to be at the place where the leave/branch meets the main cuttable geometry. This is going to be the reference point for the game to decide to which part of the cut tree a leave/branch belongs too. And it is used for the decision when the chainsaw can cut it off.
2. The local Z axis has to go in the main direction of the leave, is the distance along the Z axis of a vertex is going to be used to define how much the leaves are going to move with the wind.
3. All leaves of a tree have to use the same material.

For the main trunk/branches of the tree, it is important the geometry consists of a single closed hull. So e.g. you can not simply model the branches as individual parts and stick them inside the trunk like you might sometimes do we 'regular' objects. Instead you will have to fully merge all the vertices and cutout the parts of the main trunk to match up with the branch intersections.

You can also use LODs for the trees. In that case, it is important that the tree main trunk is the first direct child of the LOD transform group (and not a child of a child) to make sure that the LOD is properly removed when cutting the tree.

You should be able to author trees both in Blender and Maya. You'll have to define the 'Split Type' attribute for the main trunk geometry to be something not equal to 0.
The split type is going to define the type of the tree for the gameplay code (sell value, etc.)
Currently we have the following types defined:
1: spruce
2: pine
3: larch
4: birch
5: beech
6: maple
7: oak
8: ash
9: locust
10: mahogany
11: poplar
12: americanelm
13: cypress
14: downyserviceberry
15: pagodadogwood
16: shagbarkhickory
17: stonepine
18: willow
19: olivetree
sablerock
Posts: 119
Joined: Sat Dec 10, 2022 1:58 pm

Re: Trees in Blender

Post by sablerock »

Stegei, thanks for replying. Just some background. This is for new African map with 25 new hardwood tree’s. Without these trees NO MAP. We have done 98% of your specs. The “special geometry type” we don’t understand. Thus, we need your help there how make leaves system show in i3d without polys. We have on leave branch correctly attached at pivot point to main branch and it seems fine ingame. But how do we spread rest of leaves system over tree? IE multiple pivot points? Pls stay with my team. Once we have the workflow, the rest will go quick. PS: I really don’t like adding the splittype manually in xml
Stegei
GIANTS Software | CTO
Posts: 1788
Joined: Sat Jun 09, 2007 10:51 am

Re: Trees in Blender

Post by Stegei »

Are the leaves/branches cards all individual meshes in Maya/Blender?
Our trees usually consist of around 20-100 objects in Maya. At export time, they are all merged into one single split shape attachment mesh. For the rendering it doesn't matter, but it is important to have those individual objects first so that the engine knows how to split the leaves/branches when cutting the tree.
sablerock
Posts: 119
Joined: Sat Dec 10, 2022 1:58 pm

Re: Trees in Blender

Post by sablerock »

Well it’s WORKING!! Thanks to you revealing the secrets that we couldn’t find after 6 months of searching. Yes, all our cards are objects and yes attaching at pivot point solved all ingame cutting problems. Interesting though, when exporting from blender, these objects aren’t merged into lod0attachments, they are listed individually in GE. When we add the SPLITTYPE manually, and resave the i3d, THEN GE merges them with zero polys!!
We have 2 more issues: we cant get the cut section to map correctly to our uv map when cutting ingame and lastly, although we use Blender, what is the workflow to create LOD1, what we call the billboards. We also use Maya if that helps you. We can’t thank you enough for your input. You saved another fs22 project!
sablerock
Posts: 119
Joined: Sat Dec 10, 2022 1:58 pm

Re: Trees in Blender

Post by sablerock »

Stegei, pls we need some more answers. We rendered a tree in Blender with >500 leave plane objects. All attached to pivot points using the same workflow. As you know Blender does not merge them at export time. After adding the splittype in xml, and resaving the tree i3d in GE, then the merging is done. Is there a GE limit to these plane objects? Because with this tree, some of these planes are not merged. Seems like random selection by GE. Some branches no leaves, others denuded. The higher up the tree, the worse it gets. This tree is 90m high. Is that problem in GE?? Is there limit to number of planes per branch? Or must these planes be attached with same orientation attributes? PLS help us with these questions. We have come so far. PLS
Post Reply