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. General Discussion
  3. Pathfinding

Pathfinding

Scheduled Pinned Locked Moved General Discussion
11 Posts 6 Posters 2.2k 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.
  • bosswaveB Offline
    bosswaveB Offline
    bosswave
    wrote on last edited by
    #1

    Anyone know of an efficient way to integrate pathfinding in a top-down game? It’s been my biggest roadblock in a couple of projects I’ve tried to create lol. Thanks!

    MelideM 1 Reply Last reply
    1
    • bosswaveB bosswave

      Anyone know of an efficient way to integrate pathfinding in a top-down game? It’s been my biggest roadblock in a couple of projects I’ve tried to create lol. Thanks!

      MelideM Offline
      MelideM Offline
      Melide
      wrote on last edited by
      #2

      @bosswave I've been searching for that too, couldn't find something simple enough. I saw a project of RobinsonX with a path finder systems, but I don't know if it would fit in all games ^^"

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

        I recently created a project that involves pathfinding and it works PERFECTLY! (Not the hyperPad one)

        Unfortunately, it has been written in another language though. BUT, I can explain it.

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

          Here is the URL for a simulation of it. (Yes, it involves real-world code.)

          https://py3.codeskulptor.org/#user305_LsWXuY7iAj_7.py

          You can observe what is happening. (Works best on Computers)

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

            If I can find any time, I can update my path-finding project in hyperPad. (it's outdated)

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

              Alright, I'll try to explain it. (Sorry if this is too much.)

              (Okay, it is too much...)

              Here's a "simple" tutorial.

              1. Have a grid of solid blocks and non-solid blocks.
              2. Let Point A be the starting point and Point B be the destination.
              3. When you want to find a path, perform these execution in order:
              • We will have blocks spreading from Point B. Let Growth Block be a function. Growth Block checks all of its side (up, right, bottom, left) and places a Growth Block for each adjacent non-solid block IF it has not been occupied previously with a Growth Block. After that, it sets a value, let's call it D, in it's place and whatever Growth Blocks it had just summon will set a value of D + 1 instead of D alone. So the D value from the destination should be smaller than the values further from it and vice versa.
              • Starting from Point B, have blocks spread from it. Point B executes a Growth Block in it's place. D should be initially set to 0, but any number would theoretically work. Notice that Growth Block starts a chain reaction where a single block clones into more blocks and covers the whole grid.
              • After the Growth Block has stopped executing, or when the spreading stops, and the starting point has not come in contact with any growth block, then there is no possible path.
              • Otherwise, if the starting point has come contact with Growth Block, then there is at least one possible path.

              — We are only just NOW finding a path —

              • From the starting point, trace a path from the adjacent D values given. Let's have an object, calling it Bob. You can do this by checking the current D value where Bob is.
              • Bob will check the surrounding blocks and will move in the direction where D is less than the D value at Bob. In other words, Bob is moving towards blocks with smaller D values.
              • Bob will repeat this process of looking and moving until the destination has been met.
              1. After a path has been found, you can make whatever character or object follow that path. The path that Bob took can be recorded in an array, a list of directions telling how to get to the destination.
              2. If for some reason, the environment changes, like having a block added or removed, the process shall be repeated. (Or not, it depends on the situation.)
              1 Reply Last reply
              1
              • RobinsonXR Offline
                RobinsonXR Offline
                RobinsonX
                wrote on last edited by
                #7

                2A218FCF-B54A-45BA-BD52-75AD9F66D936.png

                This is what you should see. (It won't let me place blocks on Mobile.)
                https://py3.codeskulptor.org/#user305_LsWXuY7iAj_7.py

                SIRD4SHS 1 Reply Last reply
                1
                • RobinsonXR RobinsonX

                  2A218FCF-B54A-45BA-BD52-75AD9F66D936.png

                  This is what you should see. (It won't let me place blocks on Mobile.)
                  https://py3.codeskulptor.org/#user305_LsWXuY7iAj_7.py

                  SIRD4SHS Offline
                  SIRD4SHS Offline
                  SIRD4SH
                  wrote on last edited by SIRD4SH
                  #8

                  @RobinsonX that... actually helps a lot. Thanks!

                  Now let’s just see if I can replicate this lol.

                  Edit: sorry, I keep forgetting to change the account on my phone.

                  SplitMindGamingS 1 Reply Last reply
                  0
                  • SIRD4SHS SIRD4SH

                    @RobinsonX that... actually helps a lot. Thanks!

                    Now let’s just see if I can replicate this lol.

                    Edit: sorry, I keep forgetting to change the account on my phone.

                    SplitMindGamingS Offline
                    SplitMindGamingS Offline
                    SplitMindGaming
                    wrote on last edited by
                    #9

                    Hyperpad writes to cocos2d which actually has a bunch of tutorials on pathfinding. Im pretty sure it can be possible with hyperpad if new behaviors are introduced to support it.

                    1 Reply Last reply
                    0
                    • MurtazaM Offline
                      MurtazaM Offline
                      Murtaza
                      Admin
                      wrote on last edited by
                      #10

                      We actually have a tutorial on a basic path finding system
                      https://hyperpad.zendesk.com/hc/en-us/articles/360031030412-Grid-based-Path-Finding

                      bosswaveB 1 Reply Last reply
                      1
                      • MurtazaM Murtaza

                        We actually have a tutorial on a basic path finding system
                        https://hyperpad.zendesk.com/hc/en-us/articles/360031030412-Grid-based-Path-Finding

                        bosswaveB Offline
                        bosswaveB Offline
                        bosswave
                        wrote on last edited by
                        #11

                        @Murtaza thanks, I’ll definitely take a look at it!

                        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