AI train horn blow
#31
Posted 15 April 2015 - 10:56 AM
https://www.youtube....h?v=l5rpo_BgHow
https://www.youtube....h?v=vKRsLurPzSA
https://www.youtube....h?v=FPGCxhT9H7E
https://www.youtube....h?v=Hh9fhM7OagA
In the United States, many passenger trains activate the bell to depart.
#32
Posted 03 June 2015 - 05:34 AM
#33
Posted 20 January 2016 - 12:46 AM
Csantucci, on 13 April 2015 - 11:55 PM, said:
- horn blast heard at higher distances (with the help of Peter (gpz) I hope)
- configurable maximum distance at which blast starts
- optional North-American blast sequence, including horn still playing when passing crossing.
Carlo, I have thought of a different strategy of OpenAL sound source management, than we are doing today. The original (current) code assigns an OpenAL source to every sound source getting into cutoff distance circle automatically. I think, this is a waste of resources, since quite a few of them are actually playing, most of them are just sitting in the memory waiting for play. Instead, a better way would be to actually assign an OpenAL source only to sounds wanting to play, and revoking it from them once they have stopped. The buffers are still sitting in memory, so it wouldn't cause more disk reads than now, just we could drastically reduce the number of utilized OpenAL sound sources, which is the current limit of increasing the cutoff distance. This way the cutoff distance could be increased maybe upto 1.5-2 km, from the current 400 m.
If I published a patched branch, wouldn't you mind testing it at one of your sound-crowded locations?
#35
Posted 20 January 2016 - 10:29 AM
I increased the cutoff distance to 2 km, so horn blast can be heard from much higher distance.
I have also modified the Sound Debug Form to show the actual number of utilized sound sources. I have done the modifications with two different commits, so you may checkout the HEAD's preceeding commit to see the same number in Sound Debug Form before the modifications.
#36
Posted 21 January 2016 - 01:39 AM
#37
Posted 21 January 2016 - 02:09 AM
However I found a problem: I have some trainsets where the bell trigger is used as a second type of horn, e.g. like here:
Stream ( Volume ( 1.25 ) Skip (Stream14 **** This stream allows the whistle to be played at the same time **** ) Priority ( 6 ) Triggers ( 1 Discrete_Trigger ( 10 PlayOneShot ( 2 File ( "Fischio_corto.wav" -1 ) File ( "Fischio_doppio_11.wav" -1 ) SelectionMethod ( RandomSelection ))) ) )
Well, this sound (in this case it's within a cab sound .sms file) isn't heard with your version, while it's heard both with OR 1.0 and OR x.3415.
Testing continues.
#38
Posted 21 January 2016 - 03:30 AM
#39
Posted 21 January 2016 - 04:29 AM
#40
Posted 21 January 2016 - 04:43 AM
disc, on 21 January 2016 - 04:29 AM, said:
You can answer your own question about CPU usage, if you compile the branch on your computer. :)
#41
Posted 21 January 2016 - 05:10 AM
#42
Posted 21 January 2016 - 05:28 AM
Csantucci, on 21 January 2016 - 05:10 AM, said:
Yes, I think it would be better. I thought that the problem is general to playoneshot, because although currently I cannot see the code, but I remember, that those sounds were handled a bit differently. It will be an easy fix. :)
#43
Posted 21 January 2016 - 02:30 PM
#44
Posted 22 January 2016 - 08:01 AM
these are the first results:
- hearing distance 2Km: OK
- PlayOneShot sounds: OK
- transition between different motor sounds: OK
- max amount of Sound Sources in a crowded European station: 293
- max amount of Sound Sources with a single 80-Wagon, 4-Engine USA train in explore mode (2 per wagon plus a bunch for every engine): 205 (but could be the double when meeting another similar train, which can be usual in USA routes).
So, positive test.
If it is envisaged to reduce the default maximum number of Sound Sources, I would reduce it to not less than 512, and I would leave the configuration capabilities present now (no hardcoded number). You never know...
I didn't make comparison tests about CPU usage.
#45
Posted 23 January 2016 - 12:01 AM