Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
hyperPad

hyperPad Forum

  1. Home
  2. Help and Support
  3. Which more expensive: Broadcast or Conditional?

Which more expensive: Broadcast or Conditional?

Scheduled Pinned Locked Moved Help and Support
14 Posts 5 Posters 1.4k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Deeeds

    I'm changing gravity every time something hits a ceiling by the ceiling broadcasting that it's been hit, change the gravity and handling conditionals for needs to change, etc, somewhere else.

    But are broadcasts expensive?

    Or have you done some magic with arrays/dictionaries between receivers and broadcasters so i can think of these as super fast and light and use lots and lots of braodcasts?

    @hamed

    iTap DevelopmentI Offline
    iTap DevelopmentI Offline
    iTap Development
    wrote on last edited by
    #2

    @Deeeds why bother with the broadcast? Why not just have the collide behavior in the object you are broadcasting to?

    D 1 Reply Last reply
    0
    • iTap DevelopmentI iTap Development

      @Deeeds why bother with the broadcast? Why not just have the collide behavior in the object you are broadcasting to?

      D Offline
      D Offline
      Deeeds
      wrote on last edited by
      #3

      @iTap-Development It's just an example to make it clear that I'm considering using a LOT of broadcasting, and have already become lazy in relying on it for code organisation.

      The question is not about a specific problem: I'm asking the relative cost of using broadcasts versus other approaches to organising and distributing code.

      KamdroidK 1 Reply Last reply
      0
      • D Deeeds

        @iTap-Development It's just an example to make it clear that I'm considering using a LOT of broadcasting, and have already become lazy in relying on it for code organisation.

        The question is not about a specific problem: I'm asking the relative cost of using broadcasts versus other approaches to organising and distributing code.

        KamdroidK Offline
        KamdroidK Offline
        Kamdroid
        wrote on last edited by Kamdroid
        #4

        @Deeeds You might want to ask the developers.

        I would think that a broadcast/broadcast receive would impact more than a conditional, since broadcast receive behaviours are always waiting for a message to be broadcasted to them.

        If you end up getting an answer, let me know too.

        D 1 Reply Last reply
        0
        • KamdroidK Kamdroid

          @Deeeds You might want to ask the developers.

          I would think that a broadcast/broadcast receive would impact more than a conditional, since broadcast receive behaviours are always waiting for a message to be broadcasted to them.

          If you end up getting an answer, let me know too.

          D Offline
          D Offline
          Deeeds
          wrote on last edited by
          #5

          @Kamdroid I was kind of hoping they just read these forums as a matter of course. It's not like there's much in here ;)

          Except for my dribbles and rants.

          I'm not so sure about the listeners actively listening. This might be just a metaphor being used. They're probably sitting in an array or dictionary that's messaged only when a "broadcast" is sent, meaning highly efficient. Possibly more so than conditionals.

          boring story approaching: A friend of mine, a few years ago, spent a huge amount of time teaching me to not use ifs because he'd found them to be a bit of a drag in high frequency stuff. We were doing lots of particles, where the volume of activity was enormous, but we always wanted more. More particles = good! It was all C++ and he had some pretty tight stats on it all. Made me a believer, even if I didn't fully understand where he was headed with it all.

          The bottom line was polymorphism being used correctly, I'd dare say. He is a bright guy. I'm just a designer, but it fascinated me that he'd figure how to remove ifs like they were parasites.

          1 Reply Last reply
          0
          • HamedH Offline
            HamedH Offline
            Hamed
            Admin
            wrote on last edited by
            #6

            Broadcasts are really fast. They are much faster than using collisions or something like that. @Deeeds it works like you think it is.

            D 1 Reply Last reply
            1
            • HamedH Hamed

              Broadcasts are really fast. They are much faster than using collisions or something like that. @Deeeds it works like you think it is.

              D Offline
              D Offline
              Deeeds
              wrote on last edited by
              #7

              @Hamed BEST NEWS TODAY! I can and will base most of what I'm doing around them, then. And use them like function/method calls all over the place. I thought this might have been one of the ways you were making them useful.

              THANK YOU!!! Way to go!

              1 Reply Last reply
              0
              • HamedH Offline
                HamedH Offline
                Hamed
                Admin
                wrote on last edited by
                #8

                @Deeeds The only thing i would suggest doing is leaving little comments for your self otherwise you will have a bunch of broadcasts and receives that you don't remember what they're for.

                D Aidan_FireA 2 Replies Last reply
                0
                • HamedH Hamed

                  @Deeeds The only thing i would suggest doing is leaving little comments for your self otherwise you will have a bunch of broadcasts and receives that you don't remember what they're for.

                  D Offline
                  D Offline
                  Deeeds
                  wrote on last edited by
                  #9

                  @Hamed Yeah, I have a Notes file with that sort of gunk. I've been meaning to request picking Event Keys operate like Behaviour On/Off where there's a long list of all possible ones, by alphabetical order, by object/original origin.

                  1 Reply Last reply
                  0
                  • HamedH Hamed

                    @Deeeds The only thing i would suggest doing is leaving little comments for your self otherwise you will have a bunch of broadcasts and receives that you don't remember what they're for.

                    Aidan_FireA Offline
                    Aidan_FireA Offline
                    Aidan_Fire
                    wrote on last edited by
                    #10

                    @Hamed Are broadcasts expensive at all? For example, in my 3D project the faces of a shape have to conform to 3 points, I’ve done this (messily) by colliding with those 3 points (they’re in a tag) and then basically getting the position on a timer of the object it collided with. Is this at all more efficient that constantly broadcasting dynamic messages?

                    iTap DevelopmentI 1 Reply Last reply
                    0
                    • Aidan_FireA Aidan_Fire

                      @Hamed Are broadcasts expensive at all? For example, in my 3D project the faces of a shape have to conform to 3 points, I’ve done this (messily) by colliding with those 3 points (they’re in a tag) and then basically getting the position on a timer of the object it collided with. Is this at all more efficient that constantly broadcasting dynamic messages?

                      iTap DevelopmentI Offline
                      iTap DevelopmentI Offline
                      iTap Development
                      wrote on last edited by
                      #11

                      @Aidan-Oxley I would think broadcast would be better. Because otherwise you have objects with collisions, but you wouldn’t need that if you didn’t use collide.

                      1 Reply Last reply
                      0
                      • HamedH Offline
                        HamedH Offline
                        Hamed
                        Admin
                        wrote on last edited by
                        #12

                        The only expense is having a lot of logic in the receive message side. Physics engine is much slower to do those kind of tasks.

                        Aidan_FireA 1 Reply Last reply
                        0
                        • HamedH Hamed

                          The only expense is having a lot of logic in the receive message side. Physics engine is much slower to do those kind of tasks.

                          Aidan_FireA Offline
                          Aidan_FireA Offline
                          Aidan_Fire
                          wrote on last edited by
                          #13

                          @Hamed The collision happens once. The face collided with one point, the turns off that collision and moves to another point. It does this 3 times with 3 separate collision behaviours. Once it’s done, it waits until everything else has finished loading, then runs a timer on the behaviours underneath the collisions so that it can get information on those 3 objects. So this is more efficient than broadcasting a message on a timer containing an objects position right?

                          1 Reply Last reply
                          0
                          • HamedH Offline
                            HamedH Offline
                            Hamed
                            Admin
                            wrote on last edited by
                            #14

                            No broadcasting is still much faster. You can avoid timers and delays and collision take multiple time steps

                            1 Reply Last reply
                            0

                            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                            With your input, this post could be even better 💗

                            Register Login
                            Reply
                            • Reply as topic
                            Log in to reply
                            • Oldest to Newest
                            • Newest to Oldest
                            • Most Votes


                            • Login

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • Users
                            • Search