Editing SpeedTree files (.spt)

I found this source code that contains some tools to manipulate the spt files from The Elder Scrolls IV: Oblivion. I managed to compile it and they seem to work with the spt files from NWN2.

The tools are rudimentary. One tool converts a spt file to a text file and another tool converts the text file back to spt. It’s very complex to modify the text file since it contains more than 200 parameters describing a tree.

Here are some tests. This is the original PinOakF.spt:

Here I have lowered the branch frequency of the trunk:

Here I have ridicously increased the flexibility of the trunk, so it sways
a lot:

5 Likes

Nice. What I’d like to be able to do some day is to create a SpeedTree ‘fallen log’ and ‘tree stump’ for populating a forest floor.

2 Likes

A swaying tree stump, just what we need :slight_smile:

PJ

Surely you can turn off the swaying? But yeah, funny thought.

I guess that you would like to place many variants of fallen logs and tree stumps by just changing the random seed instead of creating the models with Blender?

You can set the flexibility to 0 so there isn’t sway at all.

Yes, that’s my line of reasoning. I live in a heavily forested part of the world, so I’m used to seeing various fallen trees when I’m on hikes. It gives the space a very natural look to my eyes. The other one is tangled growths along the edges of clearings – creating a clump of bushes. We’ve got that to some degree with the holly models, but some other types would be good.

I agree, all the early forest areas I do ended up looking too clean. We have some tricks but the swaying kills much of our flexibility to sink trees.

Ground cover and fallen trees would improve things no end.

PJ

We do have no sway trees, and module level control over the wind in general.

Do we? How do you control the module level wind?

PJ

Stick the file below into your module, edit to what wind levels you want. This particular file pretty much turns off the wind because Neverwinter is apparently plagued with gale force winds. I made a thread about it, maybe old forums.

https://www.dropbox.com/s/s7rn9w5hohm5s4b/SpeedWind_HLSL.ini

The file is actually a stock game file, it’s in the speedtrees stuff. I found it years ago when looking for a way to stop the grass swaying. You’re just overriding the stock with what wind you want.

example of messing with the wind file in effect.
https://www.youtube.com/watch?v=LnxiqMsNoto

Here are the no sway trees in effect, side by side with stock trees.

https://www.youtube.com/watch?v=fF9kyG0Y41o

2 Likes

Tree stump

I got this:

But I don’t know how to fill the top end. There is no stump textures in NWN2 and I don’t know if it can be done with the SpeedTree version used by NWN2. I tried making the trunk radius to go to zero at the very top so it’s filled with the bark texture, but I think that it doesn’t look good:

Fallen tree

I got this:

But it has the same problem in the base.

1 Like

The base can be worked with. A typical fallen tree would have a mound of earth at the base where the root ball has been ripped out of the ground. This fallen tree looks great. Some of the winter versions would make for an older fallen tree.

PJ

1 Like

I hadn’t really thought about that aspect of it. But hmm, yeah, I can see how that’s a problem. Dang. Ah well, still have to work with what the game engine allows.

I have been reading the SpeedTree forums and I extracted the following info:

  • By the year 2013, SpeedTree was unable to cap both ends, so we can infer that the version used by NWN2, which is older, is unable too.
  • By the year 2016, SpeedTree was able to cap the top but not the bottom. So it can create tree stumps but no fallen trees.

For the fallen tree, if I apply the trick of changing the trunk radius to zero gradually near the bottom, instead of suddenly as in the tree stump, I think it could be tolerable.

In this screenshot the radius goes to zero suddenly at the bottom:

The bark texture is very distorded. Instead, in the next screenshot the radius goes to zero gradually:

I think it looks better. But if it can be worked with a mound of earth as @PJ156 said, then even better.

2 Likes

If it is any help, a natural tree stump’s radius usually doesn’t go to zero immediately; there’s almost always random projections and splinters sticking out. The flat tree stump is always the product of an axe felling (or at least it looks that way to me), and we have placeables for those. So, some random clutter and unevenness at the top is good for a natural stump.

I can make the top more pointed like the bottom of the fallen tree shown in the screenshot, so the bark texture is less distorted and stretched, but nothing more.

That second one looks better. We’ll need to make some football placeables or something to go with it.

In order to do this, would you need to put a lot of trees? Could you do it with grass (maybe creating a custom texture)?

I once did some digging in the tree files and found several entries that are not accessible in the toolset by default. Perhaps this tool could be used to restore them?

Non-clumping cattails were why I investigated in the first place. Those are very important. A single cattail plant would just make the day for any river in my world. :stuck_out_tongue: