Elvas Tower: Specific sound for AI trains - Elvas Tower

Jump to content

Posting Rules

All new threads will be started by members of the Open Rails team, Staff, and/or Admins. Existing threads started in other forums may get moved here when it makes sense to do so.

Once a thread is started any member may post replies to it.
  • 3 Pages +
  • 1
  • 2
  • 3
  • You cannot start a new topic
  • You cannot reply to this topic

Specific sound for AI trains Rate Topic: -----

#1 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 6,996
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 15 February 2017 - 02:54 AM

OR uses for AI trains the same ScalabiltyGroup used for the player train. In this way it is not possible to have partly different sound management for AI trains and player train. As an example, it is not possible to have the AI train playing the horn when meeting the player train, because the horn would play also on the player train when it passes near the camera. Moreover if there are more locos in the AI train, they would all play the horn...
So a specific new sound event is proposed: event #161, called AITrain, that can be used in discrete triggers within the .sms file. It is triggered only for the first car of the AITrain, in case it is a locomotive (that is it has an .eng file)
A stream like this, to be inserted in the loco external .sms file causes the AI loco to play the horn (only once) when passing near the camera:
		
						Stream (
				Skip (**** ORTS AI: horn at train meet ***************************************)
		Priority ( 7 )
		Triggers ( 4
				Initial_Trigger ( DisableTrigger ( 3 ) )
				Discrete_Trigger ( 161 EnableTrigger ( 3 ) )
				Variable_Trigger ( Distance_Dec_Past 70.0 PlayOneShot ( 1
	
						File ( "x_trcentro_loud_long.wav" -1 )

						SelectionMethod ( RandomSelection ) ) )
				Variable_Trigger ( Distance_Dec_Past 35.0 DisableTrigger ( 3 ))
						
		)
		VolumeCurve(
			SpeedControlled
			CurvePoints ( 5
				-100.0 1.0
				-2.0 1.0
				0 0.0
				2.0 1.0
				100.0 1.0
			)
			Granularity ( 0.1 )
			)
		)	


A stream like this causes the AI loco playing the horn at start
						Stream (
				Skip (**** ORTS AI: horn at train start ***************************************)
		Priority ( 7 )
		Triggers ( 3
				Initial_Trigger ( DisableTrigger ( 3 ) )
				Discrete_Trigger ( 161 EnableTrigger ( 3 ) )
				Variable_Trigger ( Speed_Inc_Past 0.15 PlayOneShot ( 1
	
						File ( "x_trcentro_loud.wav" -1 )

						SelectionMethod ( RandomSelection ) ) )
						
		)
	)

Remember to increase the stream number (Streams(..))when adding streams in an .sms file.

Here are the .exe and .dll files to be replaced within release x.3794
Attached File  AITrainSound.zip (1020.9K)
Number of downloads: 804

Blueprint registered https://blueprints.l...s-for-ai-trains .

#2 User is offline   Hamza97 

  • Engineer
  • Group: Status: Contributing Member
  • Posts: 606
  • Joined: 01-March 15
  • Gender:Male
  • Simulator:Open Rails
  • Country:

Posted 15 February 2017 - 08:10 AM

:sign_thanks: :sign_rockon:

#3 User is online   James Ross 

  • Open Rails Developer
  • Group: Status: Elite Member
  • Posts: 5,490
  • Joined: 30-June 10
  • Gender:Not Telling
  • Simulator:Open Rails
  • Country:

Posted 06 March 2017 - 07:57 AM

View PostCsantucci, on 15 February 2017 - 02:54 AM, said:

OR uses for AI trains the same ScalabiltyGroup used for the player train. In this way it is not possible to have partly different sound management for AI trains and player train. As an example, it is not possible to have the AI train playing the horn when meeting the player train, because the horn would play also on the player train when it passes near the camera. Moreover if there are more locos in the AI train, they would all play the horn...

I don't know much about how MSTS's sound system works, but why doesn't OR just use the same ScalabiltyGroup as MSTS for AIs?

#4 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 6,996
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 06 March 2017 - 08:28 AM

Hi James,
this is something that I found implemented that way when I started developing with OR, however this is not an excuse, because I (and I assume also someone else that has operated on OR sound) agree with such decision.
In my opinion this has been done because under MSTS AI trains can have only speed and distance related triggers (no discrete triggers, no power-related triggers - Variable2 and Variable3). Therefore the MSTS AI trains sound is very elementary (the related part of the .sms file is usually much smaller than the one for the player train). OR instead provides also for AI trains the full sound trigger set. So it makes sense for OR that AI trains have the same - complete - sound as player trains, without needing to duplicate for AI trains the complete sound of player trains. As a further small advantage that has become evident later, this also allows simpler train switching from AI to player driven and vice-versa. Therefore this decision has not been reverted.
This is documented in the manual.
The only "significant" drawback, that uniforming AI and player train sound has, is that you can't have the AI train horn playing when meeting the player train (or better the player camera), or the AI train horn playing at train restart, because this would occur also for the player train, which is clearly unwanted.
The blueprint I propose allows to simply bypass this drawback. It could also be used e.g. to trigger sounds for AI trains that in player trains are triggered by the train driver (e.g. fans).
For these reasons I ask you to approve the blueprint :)

#5 User is online   James Ross 

  • Open Rails Developer
  • Group: Status: Elite Member
  • Posts: 5,490
  • Joined: 30-June 10
  • Gender:Not Telling
  • Simulator:Open Rails
  • Country:

Posted 08 March 2017 - 01:29 PM

View PostCsantucci, on 06 March 2017 - 08:28 AM, said:

In my opinion this has been done because under MSTS AI trains can have only speed and distance related triggers (no discrete triggers, no power-related triggers - Variable2 and Variable3). Therefore the MSTS AI trains sound is very elementary (the related part of the .sms file is usually much smaller than the one for the player train). OR instead provides also for AI trains the full sound trigger set. So it makes sense for OR that AI trains have the same - complete - sound as player trains, without needing to duplicate for AI trains the complete sound of player trains. As a further small advantage that has become evident later, this also allows simpler train switching from AI to player driven and vice-versa. Therefore this decision has not been reverted.

That seems sensible. :)

Just one question about the proposed change: why not set the trigger for all cars in the AI train? Or, perhaps all locomotives in the AI train? In fact, could you have a trigger set for it being an AI train, and then another trigger set for it being a locomotive, or is the MSTS SMS not capable of utilising that?

#6 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 6,996
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 09 March 2017 - 02:22 PM

I have now added a further specific trigger for AI helper locomotives, plus a couple of triggers for player locomotives, plus a couple of triggers for AI train approaching and departing station. I hope to upload in some days. Here a first demo video
https://youtu.be/BFSjbyiNlQY

#7 User is offline   Fablok 

  • Conductor
  • Group: Status: Contributing Member
  • Posts: 401
  • Joined: 24-June 14
  • Gender:Male
  • Location:Chrzanów (Małopolska)
  • Simulator:Open Rails
  • Country:

Posted 08 August 2017 - 03:02 PM

Any chance to remove triggers 14,53,54 for AI use ?

#8 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 6,996
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 08 August 2017 - 11:48 PM

Before inserting what would be a real hack, I'd like to understand how other people feel about this problem, because the problem depends also on how the .sms files are implemented.

#9 User is offline   Coolhand101 

  • Foreman Of Engines
  • Group: Status: Contributing Member
  • Posts: 998
  • Joined: 13-June 15
  • Gender:Male
  • Simulator:MSTS
  • Country:

Posted 09 August 2017 - 03:52 AM

Most of my AI trains have been modified to use the variable brake cylinder trigger to avoid all that hissing of the brake applying and releasing.

Trigger 53 has never worked in MSTS and OR.

It would save time editing the sms files for replacing triggers 14 and 54 with other triggers!

According to the steam4me SMS turtorial, trigger 54 is suppose to be used for when the brake handle is moved to emergency. In MSTS and OR, it is used for releasing of the actual brake.

Would be nice to see Trigger 53 used for placing the brake handle into emergency!


Thanks

#10 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 6,996
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 09 August 2017 - 06:58 AM

As stated in the manual, trigger 53 is not implemented in OR, because it had no use in MSTS, and its function is covered by trigger 14.
The steam4me SMS tutorial is not the bible (although I learned writing .sms files reading such document), and in fact what it states for triggers 53 and 54 does not correspond to what MSTS does. MSTS doesn't use trigger 53 and uses trigger 54 as train brake release. OR does the same for compatibility. Both MSTS and OR use trigger 14 as a train brake apply trigger.

To avoid continuous brake hissing In my MSTS sound files I introduced some Enable/disable statement so that a further brake release hiss would be heard only if a previous brake apply trigger was generated. Probably this is not enough for OR AI trains.

  • 3 Pages +
  • 1
  • 2
  • 3
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users