Help Me With The Linked Object Pathfinding

So I Have this Problem where the Mover Object is Suddenly stop at Certain Target. To Explaing The AI i Code, its A bunch of Mover Object in A For Each Event With Its Own Array List of Item to Buy. they will Spawn At A “Bus Stop Target” and move toward the “Shop Door Target” Then Will Pick Random “Rack Target” that Scattered in Horizontal Line. then if they List out of Child, its will Move to “Register Target” and if we player scan and put the items in the bag they will go to the “Bus Stop Target” again and deleted. the Player can Move or Buy New “Rack Target” and Places it wherever they want along the horizontal Line.
Now the Problem is after Buying or Placing the “Rack Target” at Certain Location its Somehow Make The “Mover” Targeting it Stuck and the next action it does was suddenly Become Instant. is there a reason why this could happen?

To make your issue easier to understand you should:

  • use dotted lists
  • add a screenshot of your events

Otherwise, I doubt you will get any answer.

1 Like

The AI i Code is, its A bunch of Mover Object Linked With A “Customer Object” in A For Each Event where the Customer Object Hold all of the Variable and its position is Following the Mover Object as the mover Object is the one that hold the LinkPathfinding Behaviour.

  1. First they will Spawn At A “Bus Stop Target ” and move toward the “Shop Door Target
  2. Then they Will Pick Random “Rack Target ” that Scattered in Horizontal Line
  3. They Will go to it, then Went Into State of “Action”, here they will randomize whether its Idle or Go to Shopping
  4. if go to shopping they will Pick Random “Rack Target” again
  5. if their ShopList out of Child, its will Move to “Register Target
  6. if we player scan and put the items in the bag they will go to the “Bus Stop Target ” again and be deleted
  7. And Thats The Whole AI

For The Feature Player Can Move or Build A Rack Target and Places it Wherever they want Along the Horizontal Line"

Now the Problem is after Buying or Placing the “Rack Target” at Certain Location its Somehow Make The “Mover ” Targeting it Stuck and the next action it does was suddenly Become Instant. is there a reason why this could happen?

Here’s: The ScreenShot of The Code of The AI







This Is The Customer Object Variable:



Code Where “Rack Target” Are Build:


I’m a little unclear. Are there multiple movers per customer? When you unlink and link the mover, could there be multiple movers picked? If so, you might need to use a for each mover. It might not be unlinking or linking all movers.

For each mover
… Unlink
… Link

I don’t know if all movers need to be unlinked/linked. That only needs to be done before they are given a move action. I’m not sure how you’re choosing movers.

I played around with a restaurant simulator. It used an object variable named busy for the waiters. That way I could pick either a random or the nearest waiter that isn’t busy, set busy to true and then set busy back to false when it reached its destination and did whatever action was needed like deliver water.

I used the basic pathfinder.

https://forum.gdevelop.io/t/solved-npc-empty-seat-detection/60134/5?u=keith_1357

Actually part of that might have been in a newer version. I don’t know if that version is mentioned in the post or is on my github. But, I still did use Busy to track the availability.

Hi, thank you for replying!
No, Every Customer only had one Mover linked to its.


And No, the Mover are picked only one that Linked to The Customer and the one on the For Each event is the Customer.


the Problem Mostly Happen Whenever i Put or move The Rack Target and its happen Randomly, sometime the Spot that’s are not causing the bug could Become The Cause in The Different Gameplay

I see. Unfortunately, I can’t see anything that might be causing an issue. Keep checking the variables, make sure everything is unlinking and linking. After a move attempt, you could use the path has been found condition to make sure the destination is reachable. You can invert it so it’s basically a path has not been found.

It took me awhile to fully understand the linked pathfinder.

Thank You For your TIme!
Its hard to find what actually causing its as its happen randomly

1 Like