Navigation

    CreatiCode Scratch Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • CreatiCode

    Hello? i wanted some blocks a bit ago. Any progress?

    Help
    3
    6
    137
    Loading More Posts
    • 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.
    • J
      James Blackwell last edited by

      Re: Blocks
      It’s been a while. have you made any progress yet?

      1 Reply Last reply Reply Quote 1
      • TAO
        The Ancient One trusted helpers last edited by TAO

        @jamesa-blackwell-57b383d3 said in Blocks:

        2D pathfind
        makes the sprite path find around another sprite until it touches the sprite it’s pathfinding to, useful for making better chase games.

        I agree with this a lot, mainly since the new game I’m making has a lot of walls. I have to make pathfinder nodes (I’ve used ~15 nodes just for one thing out of possibly 9 different segments so each clone can navigate to different rooms) so my clones can figure out where to go. This is really time consuming and takes a lot of blocks (I barely have anything done and already one of the sprites have roughly 800 blocks in it and most of that comes from AI navigation).

        info-creaticode 1 Reply Last reply Reply Quote 0
        • info-creaticode
          CreatiCode @TAO last edited by

          @JamesA-blackwell-57b383d3 @TAO

          So both of you need some AI block for pathfinding?

          To be clear, there are many ways to implement this. How about something like this:

          1. You create a 2D table that serve as the map. Say the table has 10 rows and 10 columns, so 100 cells, and you leave a cell empty if it is walkable, you set a cell to 1 if it is a wall, and you set a cell to 2 if it is the starting position, and set a cell to 3 if it is the end position.

          2. Then we can run a block that takes this table as input, and output a new table that’s also 10 x 10, but in this new table, we will set some cells to 4, and they form a path (the nearest one) from the starting position to the end positon.

          Would you be able to convert your specific problem into this table format so you can use this new block?

          TAO 1 Reply Last reply Reply Quote 0
          • TAO
            The Ancient One trusted helpers @info-creaticode last edited by

            @info-creaticode The first option is interesting. Here is the set-up I have right now

            (Things are heavily subjected to change)

            23561768-36e1-49b5-a568-e7c5e40e54ff-This is sped up.gif

            All of this took ~500 blocks of code


            So what you’re describing is basically numerical characterization? e.g. 1 = can walk through, 2 = wall, 3 = destination, etc.

            info-creaticode 1 Reply Last reply Reply Quote 0
            • info-creaticode
              CreatiCode @TAO last edited by

              @tao

              Yes, we need to “encode” the position of the obstacles/start/end positions in a generic way, so the same block can be used in many different situations.

              TAO 1 Reply Last reply Reply Quote 0
              • TAO
                The Ancient One trusted helpers @info-creaticode last edited by

                @info-creaticode This might work, but I’ve never used tables before, I usually just use lists and variables. I’d have to figure out how they work.

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post