Hello? i wanted some blocks a bit ago. Any progress?
-
Re: Blocks
It’s been a while. have you made any progress yet? -
@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).
-
@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:
-
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.
-
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?
-
-
@info-creaticode The first option is interesting. Here is the set-up I have right now
(Things are heavily subjected to change)

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