Ball Tracking Success!

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #87758
    Scottacus
    Participant
      @scottacus
      MembervipContributor

      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!

      #87760
      Scottacus
      Participant
        @scottacus
        MembervipContributor

        Video Link https://youtu.be/jCMt2Lcq9DU

         

         

        #87762
        rothbauerw
        Moderator
          @rothbauerw
          ModeratorContributorMembervip

          Um, 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.

          #87763
          Scottacus
          Participant
            @scottacus
            MembervipContributor

            JP’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?

            #87765
            Scottacus
            Participant
              @scottacus
              MembervipContributor

              I 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…

              #87766
              rothbauerw
              Moderator
                @rothbauerw
                ModeratorContributorMembervip

                It’s my fault really.  I saw your previous post and never got around to responding. Sorry!  :rose:

                Although losing a few hours on something because I don’t understand or isn’t documented is something I do regularly.  :wacko:

                Current Project: Perpetual updates of VPX physics.

                #87767
                Scottacus
                Participant
                  @scottacus
                  MembervipContributor

                  Yeah 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.

                  #87769
                  rothbauerw
                  Moderator
                    @rothbauerw
                    ModeratorContributorMembervip

                    That’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.

                    #87779
                    bord
                    Moderator
                      @bord
                      MembervipContributorModerator

                      One day when I’m bored …

                      (Not bord)

                      B-)

                      #87787
                      BorgDog
                      Participant
                        @borgdog
                        MemberContributorvip

                        That’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.

                      Viewing 10 posts - 1 through 10 (of 10 total)

                      Forums are currently locked.

                      ©2024 VPinBall.com

                      Log in with your credentials

                      Forgot your details?