Sounds redo
2 posters
Page 1 of 1
Sounds redo
Hey yo.
I've been fondling with routes and I noticed speed independent Track.Announce's only act in the first car. With that, and the addition of PluginManager.NetPlugin.PlaySound(CarIndex);, in mind, I decided to write a specific plug-in for Yutetsu just so the station announcements are played in all cars, but that has proven to be clunky. I then give the following ideas. Should be pretty straight-forward:
Options.AnnounceBehavior Type
Defines how speed independent announces and sta's ArrivalSound and DepartureSound should be treated.
Type: 0 (default) Sounds are played in all cars.
1: Sounds are played only in DriverCar.
2: Sounds are played only in the first car.
Track.Announce File; Speed; CarIndex
Car: overrides Options.AnnounceBehavior
(default) -1: This sound is played on all cars
n: sound is played on the (n+1)th car.
I can't think of a situation where the developer would want all sounds to be played on the first car but the option is there. AnnounceBehavior 1 is there in case of freight trains or differentiated locomotives, mainly purposed for radio talk. Type 0 is default not because it's the current default behavior, it's not, but that would be mackoy's option for a default, since Bve was aimed towards passenger MU's.
Announce CarIndex should be pretty straight forward too.
I am sorry about creating a topic about this non-issue, but my OCD is kind of disturbing me so I kinda had to.
I've been fondling with routes and I noticed speed independent Track.Announce's only act in the first car. With that, and the addition of PluginManager.NetPlugin.PlaySound(CarIndex);, in mind, I decided to write a specific plug-in for Yutetsu just so the station announcements are played in all cars, but that has proven to be clunky. I then give the following ideas. Should be pretty straight-forward:
Options.AnnounceBehavior Type
Defines how speed independent announces and sta's ArrivalSound and DepartureSound should be treated.
Type: 0 (default) Sounds are played in all cars.
1: Sounds are played only in DriverCar.
2: Sounds are played only in the first car.
Track.Announce File; Speed; CarIndex
Car: overrides Options.AnnounceBehavior
(default) -1: This sound is played on all cars
n: sound is played on the (n+1)th car.
I can't think of a situation where the developer would want all sounds to be played on the first car but the option is there. AnnounceBehavior 1 is there in case of freight trains or differentiated locomotives, mainly purposed for radio talk. Type 0 is default not because it's the current default behavior, it's not, but that would be mackoy's option for a default, since Bve was aimed towards passenger MU's.
Announce CarIndex should be pretty straight forward too.
I am sorry about creating a topic about this non-issue, but my OCD is kind of disturbing me so I kinda had to.
Glory! koshikii- Posts : 58
Join date : 2016-06-18
Location : At the desk
Re: Sounds redo
Interesting thought, but somewhat impractical.
First, a basic explanation of how .announce sounds are triggered:
Each car has two TrackFollowers these are placed at either the two ends (If no axles defined in extensions.cfg) or at the positions defined in extensions.cfg
When a TrackFollower passes over the trigger point for an announcement, if it is not playing, it is added to the sound sources playing in-sim, attached to the appropriate car.
At present, it will only ever trigger for the first car, as a single defined sound buffer can only be attached to one place at a time.
It's actually more work than you think, as if you'd like the sound to play for multiple cars, it's got to be in memory multiple times. (Unlike a texture, we need to seek to a specific point in a sound)
A secondary problem is the total number of available sound sources. The openBVE default is 16 maximum simultaneous sounds, of which 4-5 are generally going to be in use at any given point for motor/ brake sounds etc.
A modern system will probably allow 64+ sources, but whether the current backend will I'm not sure.
I'll keep it in mind, but at the minute this is going to be low priority.
Cheers
First, a basic explanation of how .announce sounds are triggered:
Each car has two TrackFollowers these are placed at either the two ends (If no axles defined in extensions.cfg) or at the positions defined in extensions.cfg
When a TrackFollower passes over the trigger point for an announcement, if it is not playing, it is added to the sound sources playing in-sim, attached to the appropriate car.
At present, it will only ever trigger for the first car, as a single defined sound buffer can only be attached to one place at a time.
It's actually more work than you think, as if you'd like the sound to play for multiple cars, it's got to be in memory multiple times. (Unlike a texture, we need to seek to a specific point in a sound)
A secondary problem is the total number of available sound sources. The openBVE default is 16 maximum simultaneous sounds, of which 4-5 are generally going to be in use at any given point for motor/ brake sounds etc.
A modern system will probably allow 64+ sources, but whether the current backend will I'm not sure.
I'll keep it in mind, but at the minute this is going to be low priority.
Cheers
Similar topics
» Sounds for the NWM Route
» Train sounds ideas
» Run Sounds Not Working
» Own sounds for each handle position
» Sounds with .animated files
» Train sounds ideas
» Run Sounds Not Working
» Own sounds for each handle position
» Sounds with .animated files
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum