BVE WorldWide
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Issue with TrackFollowerFunction in .Animated files

2 posters

Go down

Issue with TrackFollowerFunction in .Animated files Empty Issue with TrackFollowerFunction in .Animated files

Post by Tony515 Mon Jun 08, 2020 7:26 pm

I am currently working on making a .Animated object with sound follow the player train. The issue I've come across while doing this is that adding a "TrackFollowerFunction" section to any [sound] section in the .Animated file completely prevents the sound from playing, both with the old and new renderers. However, if I remove the TrackFollowerFunction line, the sounds play perfectly (but they obviously don't move their location). Here is a snipped of the code I am using to achieve the moving sounds. If the sound could play with the TrackFollowerFunction, that would be perfect!  Very Happy

Edit: I just noticed that NYCT_Railer pointed out a similar issue earlier, but that hasn't been addressed.
I am using 1.7.1.6 (And tested on the latest nightly build), and they both have this issue.

Code:
[object]
States = bench.CSV
TrackFollowerFunction = value + ((1/60) * speed)

[sound]
Filename = SiemensPropulsion/motor0.wav
Volumefunction = if[Ceiling[Abs[value + 1 * (speed * 22.3693629)]] >= 1 & Floor[Abs[value + 1 * (speed * 22.3693629)]] <= 85,if[powerNotch > 0,0.9,0],0]
Pitch = 1.0
Position = 0,1.2,0
TrackFollowerFunction = value + ((1/60) * speed)
Tony515
Tony515

Posts : 13
Join date : 2020-04-24
Location : New York City, USA

https://www.youtube.com/channel/UCfV997Q6rT3AKS1Xom936Ew

Back to top Go down

Issue with TrackFollowerFunction in .Animated files Empty Re: Issue with TrackFollowerFunction in .Animated files

Post by leezer3 Mon Jun 08, 2020 10:21 pm

https://github.com/leezer3/OpenBVE/issues/491

I will try and get to this for the next major version.
At the minute, sounds are absolutely static, and the TranslateX function etc. won't work either.

Should be relatively easy I think, although will need to check that Smile

Edit:
For your use-case, the TrackFollowingObject (tfo), which essentially is a simplistic AI train may actually be better, and works now:
https://openbve-project.net/documentation_hugo/en/routes/xml/trackfollowingobject.html

leezer3

Posts : 1785
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

Issue with TrackFollowerFunction in .Animated files Empty Re: Issue with TrackFollowerFunction in .Animated files

Post by Tony515 Mon Jun 08, 2020 10:48 pm

leezer3 wrote:https://github.com/leezer3/OpenBVE/issues/491

I will try and get to this for the next major version.
At the minute, sounds are absolutely static, and the TranslateX function etc. won't work either.

Should be relatively easy I think, although will need to check that Smile

Edit:
For your use-case, the TrackFollowingObject (tfo), which essentially is a simplistic AI train may actually be better, and works now:
https://openbve-project.net/documentation_hugo/en/routes/xml/trackfollowingobject.html
I am well-aware of using TFOs (I've implemented quite a few of them), but the reason that I am looking forward to using moving sounds with .Animated is that unlike train.dat/sound.xml, there are (theoretically) absolutely no limitations in how many sounds can play at a time, and the motor sounds can go into much further detail than the train.dat/sound.xml system because .Animated doesn't divide the sound curves into 0.2kph intervals. Additionally, you can use specific functions to define the sounds that the trains will play, something you can't do with train.dat/sound.xml either. Bottom line, I find that there's way more potential with .Animated sound than the current systems for applying sound to trains Smile

P.S., it would be awesome if .Animated objects used in player trains/TFOs could also have support for a [Sound] section. That would save the hassle of applying a TrackFollowerFunction on a route object that must follow a train.

P.P.S.: I already made the entire motor sound configuration (not moving of course) using .Animated alone for the NYCT R160B Siemens subway car on a test route (also featuring a .Animated railgap object which reproduces the railgap sound):
 
Tony515
Tony515

Posts : 13
Join date : 2020-04-24
Location : New York City, USA

https://www.youtube.com/channel/UCfV997Q6rT3AKS1Xom936Ew

Back to top Go down

Issue with TrackFollowerFunction in .Animated files Empty Re: Issue with TrackFollowerFunction in .Animated files

Post by Tony515 Fri Jul 03, 2020 3:46 am

There appears to be another issue with the [sound] section in .animated files. When the object involved is placed into a position in a route other than the starting point, the object is there, but the sound plays at the starting point of the route file instead of the object location, and yet, the functions that control the sound are in fact being influenced where the object is placed. To reiterate, no matter where I place an animated object with sound, the sound only plays at the beginning of the route regardless of where I put the object. Is there any way to fix that?
Tony515
Tony515

Posts : 13
Join date : 2020-04-24
Location : New York City, USA

https://www.youtube.com/channel/UCfV997Q6rT3AKS1Xom936Ew

Back to top Go down

Issue with TrackFollowerFunction in .Animated files Empty Re: Issue with TrackFollowerFunction in .Animated files

Post by leezer3 Sun Jul 05, 2020 9:30 pm

Thanks, fixed I hope Smile

leezer3

Posts : 1785
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

Issue with TrackFollowerFunction in .Animated files Empty Re: Issue with TrackFollowerFunction in .Animated files

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum