Open Mr-Jay-Gatsby opened 1 year ago
When working in the specific table project, I did add an AudioMixer asset called SoundMixer to try and alter the speed of sounds. I exposed the pitch shifter parameter and called the mixer in the sound inspector script but the setfloat method wasnt working (getfloat did work). I dont know another way to change the speed unless there are some external plugins to use.
I've pushed a few commits. Changes:
AudioSource
supports itMechSoundDrawer
and MechSoundInspector
Still TODO:
Hello. I've resumed work on this feature. Work in progress resides in my fork branch https://github.com/linojon/VisualPinball.Engine/tree/feature/sounds . I am building it into the Volley table (https://github.com/jsm174/vpe-volley/tree/sounds ). using that as a baseline project and trying get our sounds like the VPX version (https://vpuniverse.com/files/file/8185-volley-gottlieb-1976/ ).
Changes so far:
To test and verify, i am using the vpe-volley project,
Sounds todo:
Plus object collision and ball rolling sounds. I'll make a separate github issue https://github.com/freezy/VisualPinball.Engine/issues/463
i've committed my current work in progress. I have questions, could use some help as i'm still just getting familiar with how VPE works.
as mentioned, we now have sounds for flippers, bumpers, kickers, plunger, hit targets, drop targets, switches.
Drop target reset: there's 2 ways to do this. For each target, play a reset sound. I have this implemented. See DropTargetComponent.cs and DropTargetApi.cs. So that's 15 separate simultaneous sounds (i dont know if that matters but just saying).
Or, we could play one sound for the whole target bank reset (this is what the VPX game does). I tried this and it works but the code is messy, as I needed to add ItemApi to DropTargetBankApi.cs, which (in order to reference local variable MainComponent) requires i derive DropTargetBank from something like MainRenderableComponent, which in turn required i add a bunch of unused methods. See DropTargetBankComponent.cs. If this is a bad idea, i'll clean up the code.
Score Motor / Reel sounds: as with DropTargetBank, does not recognized MainCompponent I'm guessing the sound would be added to ScoreMotorComponent. Currently this is commented out, see ScoreMotorComponet.cs, ScoreMotorApi.cs. Note that the motor component is on the Volley game object, which seems pretty high up in the hierarchy to add mechanical sounds.
Chimes: VPX script triggers chimes when the score is incremented (see sub AddScore1, sub AddScore2). Whats the best place to add chimes in VPE? I expect we add it to the specific score reel (10's, 100's, etc)? Currently, the ScoreReelComponent is a MonoBehaviour and doesnt have any interfaces.
Start Game: I tried trace what happens when you press "1" to start a new game, so i can play a new game sound (score motor reels and targets resetting). Maybe the reset sounds belongs in SwitchPlayer? or by the respective objects?
Also could use advise how to add sounds for ball rolling and collisions. Try to use ISoundEmitter for this too or something different?
Awesome! Could you open a PR from your branch to feature/sounds
? This branch is the rebased version of this PR, that would allow to properly review and at the same time keep @Mr-Jay-Gatsby's work. I'll then close this one here and we can continue discussing there.
About your questions:
MainComponent
for this. I think this might be a new use case where we have a non-renderable object that still needs to be positioned in the scene so the spatial sound works. So, there's probably some refactoring needed.Apologies for not being 100% in the context yet. I'll need to re-read the code that has been written so far to be of more use. Many thanks already for your contributions!
This is the initial commit for the mechanical sounds as discussed here: https://github.com/freezy/VisualPinball.Engine/issues/449.
Main items added are: Sound Asset(scriptable object) Sound Inspector Mechanical Sounds Data Mechanical Sounds Component Mechanical Sounds Inspector ISoundEmitter