The Ghostly Labyrinthian I am having problems with the target moving and running into a wall how could I make it so it seeks the player.
Scroll down, there is any-angle pathfinding without waypoints made by @thebrickccentric
I have been using this site to make it, Pathfinding (No Waypoints!) I copied the code but, still won’t work.
Then ask for help from @thebrickccentric, they’re the one that made the system.
Hey ThirdEyeBlind, just glancing over my code you copied, it looks like you have an extra “Follower Target” bundle in your Player object (You already put a Follower Target bundle in your player’s Movement bundle, so you don’t need another one). Furthermore, you copied the static target version of the bundle; what you really want instead is the Follower Target bundle in my Player object (found in level 2 of my game).
Also, the “Display Spawner” bundle in your Player has a Destroyer block in it, so the Player is destroying itself on the first frame anyway! (You probably should remove the Destroyer block).
Now I don’t see any code inside the Enemy object that would actually display it to the screen, so it’s hard to tell if the pathfinding code is working or not.
Sorry, I have not gotten to the part where I finish the enemy display. I just finished the basic sight on it now so you can see the enemy but, he will not move also, the MiniMap in the top corner shows you if he is moving, he is not moving much. I fixed everything you suggested.
Cool, ok 2 more things:
You need to parent the 2D walls to the PositionID object (and you don’t need a PositionID object sitting in the level)
After everything you also need to make sure to delete and re-add the Brain (Dojo Master?) object to the level so that it is guaranteed to activate first when the game runs.
The enemy will now move more often but, will sometimes get caught on the walls and will not move, is this how it will just be or, is there a way to fix this?
Drop Box Shown link
It turns out that the filter that tells it when to stop If you decrease that to one it will not stop at the wall. Thank you for the advice you both where very helpful, I put you in my credits.
Cool. The pathfinding still isn’t working right, though, so I have found 4 more things:
You need to add a Rotation behavior in the 2D Wall object. It seems pointless, but it keeps the walls from collision merging.
Inside the Enemy object, in the AI Follower bundle, and in the Ease Rotate bundle, you can remove one xyID message block (it doesn’t need 2 of the same message)
If you pause the game right at the beginning, it messes up the timers that run the pathfinding, so try to find an alternative to pausing.
The biggest thing though is that you need to add the code from the “Obstacle” object in my game into the 2D Wall object in your game.
I’m sorry there’s so much hassle with this (the game you’re copying happens to be the least-organized of all my pathfinding systems)
just curious, why don’t you want the walls to collision merge?
I did the things you said and it still does not work as intended. Is there anything else?
Ok I’m on my phone right now, but there is one other thing I can see that may cause issues: the code inside the PositionID object looks like it got mixed up when you pasted it. I would recommend deleting and re-adding that code so that the behaviors are in the right order (behavior position does affect how code activates).
If flowlab is doing the thing where it moves the behaviors after you paste them, try hitting Undo and then Redo, and the behaviors should be pasted into their proper positions. (I also just barely spaced out the behaviors a bit more to make things easier.)
If it still doesn’t work after that, you may have to give me some time to work on this problem separately and find the root cause (and probably improve my game’s code to be more copy-able).
That’s a good question; I guess it’s not strictly necessary in this case, but I think the merging may affect the order in which objects get triggered to run their code during a frame, though I’m not sure on that one yet (so I’m playing it safe still until I find out).
It still is not working. I did what you said.
Darn, I guess give me some time and I’ll try and test things out
Hey, I just found this again and realized I kind of left you hanging, sorry about that. If you are still wanting to have pathfinding in your game, I’d recommend using my new version of it (here: 4 Pathfinding / Player Follow Examples (Platforming & Top-Down) - #27 by thebrickccentric). It’s a little more complicated, but it’s much better performance-wise than any of my other systems.
If you’re not still working on this, then I’m sorry I didn’t help more earlier, and good luck with whatever you’re working on now.