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. Comments & Feedback
  3. New Behavior: Is On Screen

New Behavior: Is On Screen

Scheduled Pinned Locked Moved Comments & Feedback
4 Posts 4 Posters 920 Views 1 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.
  • T Offline
    T Offline
    Thecheater887
    wrote on last edited by
    #1

    Function: Returns true if the object is on screen (visible/rendered), if not, returns false.

    Use 1; runner games: If off screen, spawn new terrain, destroy self.
    Use 2; Generic Games: If off screen, reset health, graphic, events. Disable complex AI, Enable teleporting (sharp movement) If off screen too long, destroy object.

    Description: Checks is an object is currently visible to the player. Returns ‘true’ if it is visible, ‘false’ if it is not.

    Aidan_FireA 1 Reply Last reply
    0
    • T Thecheater887

      Function: Returns true if the object is on screen (visible/rendered), if not, returns false.

      Use 1; runner games: If off screen, spawn new terrain, destroy self.
      Use 2; Generic Games: If off screen, reset health, graphic, events. Disable complex AI, Enable teleporting (sharp movement) If off screen too long, destroy object.

      Description: Checks is an object is currently visible to the player. Returns ‘true’ if it is visible, ‘false’ if it is not.

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

      @thecheater887 Not a bad idea. Would work better than having big wall objects on each screen corner and detecting collisions with them.

      D 1 Reply Last reply
      1
      • Aidan_FireA Aidan_Fire

        @thecheater887 Not a bad idea. Would work better than having big wall objects on each screen corner and detecting collisions with them.

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

        @aidan-oxley This is usually known as culling, of one sort or another.

        @Thecheater887 , in your first example, it's better to reposition and reuse (known as pooling) rather than destroying and creating. Destroying requires garbage collection, of a sort, which is always slow, and new creation requires memory allocation and initialisation, also not quick. Repositioning is lightning fast.

        Unfortunately pooling is difficult to do in hyperPad because of the need to setup unique referencing through faux IDs. I've done it, but it took a lot of fiddling to get it working.

        Your second scenario, the switching ability, is a very good idea. Some form of culling flag required, via a bounds check.

        I agree. Both of these would be great, and should be added at a behaviour level, in hyperPad.

        Pool, plus get object from pool and return to pool

        Culling flag set on out of bounds, set on in bounds. and an observer for both.

        1 Reply Last reply
        1
        • RobinsonXR Offline
          RobinsonXR Offline
          RobinsonX
          wrote on last edited by
          #4

          I also agree. This functionality can dramatically influence the performance of newer games that includes huge amounts of objects, would help a lot! :)

          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