[BEHAVIOR] EasyStar.js pathfinding for tilemap

2 favourites
From the Asset Store
Units do not overlap each other and use different ways if there are several free ways.
  • I mean a corner where 2 walls meet, like an L shape. In your example if you put a wall going vertical next a wall going horizontal the path goes through the corner.

  • Oh... I see. Since in my example conditions are set top-to-bottom, left-to-right, some conditions of "opposing" tiles get wrongly overridden.

    You'd need to add another group of loops to add specific condition for L shapes, and even a third set of loops if you plan on having U shapes.

    Doing everything in a single pass might be possible, but I'm getting a headache just thinking about it! Haha !

  • Oh i see now, i'll give it a go thanks.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hi! This plug in is amazing but I found a big BUG on C3 version.

    I am working on just this example BUT on Construct 3 if I destroy a sprite, all the heroes stop

    If I do the same thing on Construct 2 (using 0.1.13) and this does not happen

    Here you can see a gif about the bug:

    Here the code: drive.google.com/open

    C2 example : drive.google.com/open (works) - need moveto

    C3 example : drive.google.com/open (not works) - need moveto

    On my Construct 2 I installed the version 0.1.13 (works)

    On Construct 3 I am using 0.4.1

    Can anyone fix this problem or just say me how I can do?

  • Great plugin Magistross! Thanks also to Eren for porting to C3.

    C3 Tech Demo:

    • Military Projecition
    • Easystar tilemap pathfinding (w/ dynamic tilemap load on floor change.)
    • NPC AI using pathfinding also.
    • Using a small sample of Psychic Toaster's nice tileset for their game.
    • Parse tilemap after change/updated (via Tilemap Load)for special stairs tile and set directional conditions.
    • Found that tilemap/model was not updated w/ walkable status until the first pathfind was done.
    • Added 'dummy' pathfind after changing tilemap. Is there another way to refresh the model after tilemap load?
    • Special tiles used for landing area of the bottom of stairs and top of stairs, so stairs cannot be entered of left from the side.
    • Special tiles used for stairway itself, so Player can only move along the stairway once on it.

    Example C3 project:

    construct.net/en/forum/construct-3/your-construct-creations-9/example-project-ultima-online-145347

  • Hello all,

    Fairly new user here. Just installed this into C3,

    I made a fairly simple layout where you can select a unit and order it to various locations on a tilemap. This worked fine with the default pathfinding plugin, but its lack of tile-based movement was unsatisfactory.

    I went ahead and replaced the pathfinder actions with the EasyStar actions. However, I can not seem to find the "Move along path" type action.

    The current "Move along path" action I have is from the default pathfinding, that obviously doesn't work, its just a placeholder till I find the correct action or some workaround.

    My goal is to be able to have units move in 8 directions in a grid-like fashion.

    Cheers and thanks to Magistross for making the plugin as well as to Eren for the port to C3.

  • You have to create your own move along path with events.

    See the tilemap easystar example projects for how to do this (you also need the old Rex MoveTo plugin.)

    However, now that C3 has a native MoveTo plugin, I would suggest trying using that (you can load it up with the nodes to MoveTo and start it using Add Node mode) Check out the example project link in the manual. You can get the nodes and how many there are from the Easystar expressions after pathfinding is complete.

    construct.net/en/make-games/manuals/construct-3/behavior-reference/move

    (Don't use the MoveTo Pathfinding action, it's just for the C3 native pathfinding)

  • Couldn't have worded it better. This behavior is more of a "helper", it cannot actually move objects.

  • Thanks for the speedy reply.

    I'm currently trying to emulate the easystar example project with the old Rex MoveTo plugin. The old Rex MoveTo plugin seems more capable than the current MoveTo plugin. Would you suggest to use that in place of the C3 native MoveTo plugin?

    Anyhow, this seems like the right set of tools to do what I need, but I need to restart with a clean slate. Gonna fiddle around with it for a few days.

    Cheers

  • Just made this the other day to test before integrating into a new C3 project: Easystar & C3 built in MoveTo example.

    EasyStarMoveTo.c3p

    Thanks to Magistross (and Eren for porting) again for this plugin, so useful.

  • It seems that the using the latest version of EasyStar with Construct w/ workers on google Chrome is making the screen black and creating the following error.

    MagistrossAny chance you can look at this?

  • C3 loads plugins script file dependency via the DOM, and I believe workers don't have access to said DOM. That would explain why "Easystar" is undefined in this situation.

    I'm not sure how to deal with this, perhaps Ashley or Nepeo could enlighten us a bit.

  • hi, i added webworker support to the behavior. Please redownload and try again.

    github.com/erenertugrul/construct-plugins/raw/master/ported_plugins/behaviors/easystarjs/dist/easystartilemap_1_04.c3addon

  • Wow Eren,

    Yep. That seems to have fixed the problem. Thanks. You might want to rev the version number so it shows up as 1.4.0.1

    Just a thought.

    hi, i added webworker support to the behavior. Please redownload and try again.

    https://github.com/erenertugrul/construct-plugins/raw/master/ported_plugins/behaviors/easystarjs/dist/easystartilemap_1_04.c3addon

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)