Multi-Resolution Game Development With GameBuilder Studio Check it out!
NEW Version 0.9.7 has arrived! New Blazing Fast Particle Engine & More Game Actions. Check it out
How do I use the "Find Path" & "Move Along Path" actions?
  • Is there any documentation or a tutorial on "Find Path" or "Move along Path" actions?

    I could swear I saw something somewhere but I can't find anything.

  • 9 Comments sorted by
  • @DbD what are you trying to accomplish? Maybe I can clarify how it works.
  • Mostly the basics like what values or references go in which fields of the dialogue boxes for the actions. I want to move an entity from one point to another through an area containing obstacles. 

  • @DbD all the available properties that you can enter into a property reference field or an expression field are in their respective property windows when you open them by clicking on the little "e" icon or the "target" icon that shows up in the text field on the right.

    Also there is documentation on the property reference and expression syntax and values that you can use located here:

    There is also a video tutorial explaining this concept on the GameBuilder youtube channel along with a bunch of other tutorial videos.
  • @DbD The Find In Range & Move To Target actions are covered in this video:
  • Thanks. I've seen these but my question was about "Find Path" and "Move along path"

    The article on syntax will be useful though
  • So, I feel kind of dumb now. I just noticed the Path finder component. I was trying to use Find Path and Follow Path actions without knowing about the component. It still looks a little confusing though.
    I'm pretty excited about the possibilities so I'm anxious to figure it all out.
    Right now, I'm just looking to move an entity around some obstacles but I'm also getting ideas about probing tentacles among other things
  • @DbD the Path Finder component uses an algorithm to map your scene and find a path through the scene to a destination point. The Path Finder component needs to know what object types in the scene are obstacles to avoid when finding its path. So for walls and obstacles you will need to give those objects' Spatial an object type. Object types are defined in the Engine settings inside the Settings window.

    The other way to define an obstacle is by selecting an entity type by name. If you create an entity called EntityA then you clone that entity. All of the resulting objects will be of type EntityA. So you could have the Path Finder component look for all EntityA objects and use their bounds as obstacles.

    The Spatial you select on the Path Finder component properties will be used as the starting point of your search. The Find Path action allows you to specify a point in space that you want the selected Spatial to navigate to once a path is found. If a path is found.

    In the "On Path Found" section of the Find Path action is where you use a Move Along Path action. This is a continuous action that will run as long as the condition it is under is valid. Specify the same Path Finder component that you used to find the path and Move Along path will animate your object through the scene.

    If your Find Path action keeps failing it may be because the space between obstacles in your scene is not large enough for the Spatial being moved to make it through the scene without touching the obstacles. So check the size if you run into this issue.
  • Ok, Thanks
    According to this, What I've been doing should be working but it still keeps failing. I might be dealing with a bug here. I will have to try shutting down, rebooting and starting a fresh scene.
    There have been a few bugs I've encountered that have had their symptoms fixed that way.
    It would maybe help if you included a couple of screenshots of the dialogue boxes. The Settings you described are the ones that are more or less obvious to me but i'm not sure about "build grid from scene bounds" and "use coordinate space"
    Also, should the Find Path action be used in a way that it is triggered repeatedly or should it normally succeed when the action is executed only once?
  • I think I figured out what I was doing wrong. I used the Find Path action without any conditions and I guess it was executing before the game was fully loaded? I could get it to trigger actions on failure but not on path found.
     I tried triggering it with a timer and it finally worked.
    I noticed something else while trying to figure things out. It seems when i leave a check in the box for "create a grid from scene bounds", it causes an error and the game freezes. I don't know if the timing issue has anything to do with this.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion