- This topic has 9 replies, 4 voices, and was last updated 5 years, 10 months ago by BorgDog.
-
AuthorPosts
-
June 6, 2018 at 11:13 am #87758
I’m interested in making a unified sound handling routine for VPX for folks who use quadrophonic under playfield speakers for reproducing playfield sounds. The current system tracks the “ActiveBall” which works great for single ball games but only tracks one ball if multiball is activated. The question is this: “Is there a way to track which ball hit what object if more than one ball is on the table?
To solve this I made a timer that records the VelX and VelY for each ball every 10ms. I then made a subroutine that checks the change in VelX and VelY for each ball on the table if a bumper is hit. It then uses a bubble sort to determine which ball had the greatest change in VelX or VelY and makes that ball the “ObjectBall.”
To test this system I made a small table that has five different colored balls and five bumpers with caps. If a ball hits a bumper the color of the ball is assigned to the bumper cap so that you can quickly see if the routine is working. This proof in concept video shows that I think the system works!
You need to login in order to like this post: click here
June 6, 2018 at 11:20 am #87760June 6, 2018 at 11:27 am #87762Um, ball rolling sound routine does track every ball on the table. In addition, Activeball in a hit event is the ball the hits the object, regardless of the number of balls on the table. Am I missing something here?
Current Project: Perpetual updates of VPX physics.
You need to login in order to like this post: click here
June 6, 2018 at 11:30 am #87763JP’s RollingBall subroutine looks at every ball on the table and passes that ball’s x/y coordinates to the pan, fade, volume and pitch subroutines to generate rolling sounds for all of the balls.
I think that “ActiveBall” is the most recently released ball like when you have a ball control routine active on the table, the ball that is controlled is the active ball. This is not the case?
You need to login in order to like this post: click here
June 6, 2018 at 11:59 am #87765I just made a new test table and you’re right, ActiveBall is the ball that generates the hit not the last ball released!
VP is wonderful but sometimes the documentation is lacking, there go several hours of coding that I’ll never get back…
You need to login in order to like this post: click here
June 6, 2018 at 12:04 pm #87766It’s my fault really. I saw your previous post and never got around to responding. Sorry!Â
Although losing a few hours on something because I don’t understand or isn’t documented is something I do regularly.Â
Current Project: Perpetual updates of VPX physics.
You need to login in order to like this post: click here
June 6, 2018 at 12:10 pm #87767Yeah I just rechecked the VPDocs and there is no mention of what ActiveBall anywhere.
When you use ball control, the most resent ball released is the “ActiveBall” so I made the assumption that this also applied to hits on table objects. This means that the current sound control functions can handle any amount of balls on the table so there really was no problem in the first place.
You need to login in order to like this post: click here
June 6, 2018 at 12:27 pm #87769That’s correct, there should be no problem with the existing sound functions.
The ball control uses triggers to assign control to a specific ball. It was quick and dirty and has limitations. While testing pinball magic, I was thinking there has to be a better way to do it.
One day when I’m bored …
(Not bord)
Current Project: Perpetual updates of VPX physics.
You need to login in order to like this post: click here
June 6, 2018 at 2:07 pm #87779June 6, 2018 at 3:20 pm #87787That’s correct, there should be no problem with the existing sound functions. The ball control uses triggers to assign control to a specific ball. It was quick and dirty and has limitations. While testing pinball magic, I was thinking there has to be a better way to do it. One day when I’m bored … (Not bord)
LOL
I like the keyboard keys to initiate/end control but it would be awesome if it could just track the mouse pointer after that.
You need to login in order to like this post: click here
-
AuthorPosts
Forums are currently locked.