Aller au contenu

Photo

Controlling the wind for trees


  • Veuillez vous connecter pour répondre
14 réponses à ce sujet

#1
kamal_

kamal_
  • Members
  • 5 240 messages

Yes, NWN2 has wind. The file that controls the wind speed for trees is named SpeedWind_HLSL.ini (it's in the \data\SpeedTree). Here's a video where I, uhh, cranked up a few parameters https://www.youtube....eature=youtu.be

 

Most importantly, a copy of this file can be put in your module/campaign and edited, and it will override the stock file. This allows you to turn off the wind or crank things up to hurricane force for instance. I suspect this could be used to have different modules have different windiness, so you could make an area that is undergoing a hurricane/tornado by making it's own module.

 

Here is the text of the stock file.

[General]
BranchStrengthExponent=3
LeafStrengthExponent=1
NumLeafAngles=4
NumMatrices=4

[Bend Angle]
MaxBendAngle=90
BendLowWind.p=1
BendLowWind.i=0.01
BendLowWind.d=0
BendHighWind.p=1
BendHighWind.i=0.01
BendHighWind.d=0

[Vibration]
VibrationAngles.low=6
VibrationAngles.high=5
VibrationFrequency.low=10
VibrationFrequency.high=100
VibrationLowWind.p=0.1
VibrationLowWind.i=0.01
VibrationLowWind.d=0
VibrationHighWind.p=0.1
VibrationHighWind.i=0.01
VibrationHighWind.d=0

[Gusts]
GustsPerMinute=10
GustStrength.min=0.1
GustStrength.max=0.3
GustDuration.min=0.5
GustDuration.max=5
GustResponsiveness.p=0.1
GustResponsiveness.i=0.005
GustResponsiveness.d=0

[Leaf Rocking]
RockAngles.low=2.5
RockAngles.high=1
RockFrequency.low=10
RockFrequency.high=50
RockLowWind.p=0.2
RockLowWind.i=0.01
RockLowWind.d=0
RockHighWind.p=0.2
RockHighWind.i=0.01
RockHighWind.d=1

[Leaf Rustling]
RustleAngles.low=1.5
RustleAngles.high=0.5
RustleFrequency.low=100
RustleFrequency.high=500
RustleLowWind.p=2
RustleLowWind.i=0.05
RustleLowWind.d=0
RustleHighWind.p=2
RustleHighWind.i=15
RustleHighWind.d=1
 


  • rjshae, andysks et 4760 aiment ceci

#2
ColorsFade

ColorsFade
  • Members
  • 1 267 messages

Any way that can be done in a single area?



#3
kamal_

kamal_
  • Members
  • 5 240 messages

Any way that can be done in a single area?

Have a module with one area, or a module with more than one area but only one area having trees. The file was in the speedtree folder, as far as I can tell it has no effect on anything other than speedtrees.



#4
Eguintir Eligard

Eguintir Eligard
  • Members
  • 1 832 messages

Area would be nice but I see this as a  highly useful discovery.

 

We can finally have the stillness that you never see, and let's face it a group of areas in a similar region would share wind properties anyway. So really I think it's about as effective as area-level control would be anyway. Hats off to you.



#5
Guest_Iveforgotmypassword_*

Guest_Iveforgotmypassword_*
  • Guests

The whole idea that trees can be speedy is quite amusing but seriously nice find and how would you go about stopping all trees moving ? What needs to be copied altered to what and stuck in the campaign folder ?



#6
kamal_

kamal_
  • Members
  • 5 240 messages

Area would be nice but I see this as a  highly useful discovery.

 

We can finally have the stillness that you never see, and let's face it a group of areas in a similar region would share wind properties anyway. So really I think it's about as effective as area-level control would be anyway. Hats off to you.

By altering the ini file in my campaign folder, I was able to achieve perfectly still trees, which is even better than the no-sway trees (whose leaves still shake).



#7
kamal_

kamal_
  • Members
  • 5 240 messages

The whole idea that trees can be speedy is quite amusing but seriously nice find and how would you go about stopping all trees moving ? What needs to be copied altered to what and stuck in the campaign folder ?

Make a copy of that ini file from your install directory to your module or campaign. Then you can mess with the variables to get the look you want. I managed to get perfectly still trees, I turned all the numbers to zero (or 0.0... for numbers with decimal points). I also managed to make all the trees disappear somehow by changing the variables, so make sure you have a backup copy.



#8
Eguintir Eligard

Eguintir Eligard
  • Members
  • 1 832 messages

Then a calm autumn forest is possible



#9
Eguintir Eligard

Eguintir Eligard
  • Members
  • 1 832 messages

changing the general category to zero would be the only thing that logically blanked the trees. Turning number of leaf angles to 0 means they have no viewing angle at all I'd assume.

 

I would also infer that branch strength and leaf strength are variables for how hard they fight the wind. Branch at 3, leaf at 1, means the branches move 3 times less than the leafs do in the wind.



#10
Guest_Iveforgotmypassword_*

Guest_Iveforgotmypassword_*
  • Guests

I've found it and will start experimenting later.. Really good find kamal congratulations and thank you.



#11
kamal_

kamal_
  • Members
  • 5 240 messages

^^^ thats my guess. Some lines of the file seem pretty obvious in what they affect, some need more exploration to figure out just what they do.

Discovering this file was a happy accident that came from looking for the stock tree textures to use them for reskinning treants. Since I was focused on the treant assembly line I only looked at this briefly, setting the numbers to crazy values so it would be apparent that the file actually did something. I did not experiment with changing each value to see what each one did, but I suspect there is actually documentation for that out there on the internet somewhere. With speedtree getting used in so many different games, some modder must have done some documentation if there's nothing official out there.


  • PJ156 aime ceci

#12
Dann-J

Dann-J
  • Members
  • 3 161 messages

Does it also affect grass swaying? Grass looks like some sort of hardcoded speedtree.



#13
kamal_

kamal_
  • Members
  • 5 240 messages
Dannj, I didnt even think of that. Definitely worth checking.

#14
kamal_

kamal_
  • Members
  • 5 240 messages

Does it also affect grass swaying? Grass looks like some sort of hardcoded speedtree.

I checked this using the first grass option. No such luck unfortunately. It's got to be controlled somewhere.



#15
Dann-J

Dann-J
  • Members
  • 3 161 messages

It sounds like grass behaviour is completely hardcoded then. I suppose even the gentlest of breezes would ruffle something as light as grass, and it's not like it sways nearly as much as some of the speedtrees.