pathfinding

  1. toothmosnter

    SOLVED mp_grid_path not being followed, object flies off or doesn't return to passive path

    I have an mp_grid setup that works during the aggro state just fine, but the passive state only works when I add && (path_index == -1) to the if (mp_grid_path(...)) statement. However, this causes the object to not return to its passive path once the aggro state is left. Without the &&...
  2. Geners

    SOLVED A* pathfinding issue

    So I have a grid of hexes, each containing a coordinate, an array of its neighbors, and its g_value, h_value, and f_value. I have set up this A* pathfinding function to find a path between two points, and as you can see below it works perfectly if there's a valid path. But if there's not a...
  3. R

    GMS 2 Need help preventing enemies from getting stuck on eachother

    I am using the built-in grid pathfinding for my enemies to be able to move around walls to chase the player and all that and its working fine but for some reason, if the enemies touch each other they get stuck. I have tried putting move_bounce_solid(other); into a collision with another enemy...
  4. Z

    GMS 2 The pitfalls of NPC paths/cutscenes.

    So I'm at the point where I'm going to implement cutscenes and NPC's into my (top down 2d rpg) game. I've drawn all the sprites, have a good idea of who needs to do what,... So I'm starting this (quite new) challenge. I thought it would be a great idea to ask around a bit. I have a few systems...
  5. DirectOrder

    Does anybody have a fast implementation of A* pathfinding?

    The built-in pathfinding is nice, but very limited (can't move through diagonally blocked paths, can't weight movement, etc). So I'll just write my own implementation of A*, right? Well I did. And it works. But it's sloooow. So I figured maybe these new structs that I used to track nodes...
  6. James222

    Asset - Scripts Fast Optimized GM Pathfinding *FREE* By James222

    Hi everyone! So for the past few months I have been having a little competition with my friend to write a fast simple pathfinder that can work with multiple units while always returning the optimal path. after a lot of trial and error I have finally simplified my work down to this tiny asset...
  7. TyGamess

    Jobs (For Ai)

    So! I have my villagers on wonder. Witch I am going to set as a job called "Wonder" or "Jobless" and when they are jobless they wonder around. But if you set them to a job, they will wonder around an area, and occationaly pick up items and bring them over to the targeted location for storage...
  8. TyGamess

    Pathfinding Speed Interuption [Solved]

    So! Path finding is a thing. Im using Grid Path Finding in my code. And as said the speed {var spd = 0} is set when you give the code {path_start(path, spd, path_action_stop, false)} This defines the speed from point A to point B. But say between point A and B there is a river and to cross that...
  9. TyGamess

    Drag And Drop with Path-Finding

    Idk if was a post already. But how to i drag and drop an object that has path finding codded into it? Here is the code I have so far: if treached = false { sprite_index = spr_villagerMoving if (!instance_exists(target)) { // create new target var gx =...
  10. SirCaliber

    GML How would i have an enemy pathfind around multiple objects?

    I have this in the step event for the enemy: grid=mp_grid_create(0,0,room_width/32,room_height/32,32,32) path=path_add() mp_grid_add_instances(grid,oBarrel,0) mp_grid_add_instances(grid,oWall,0) mp_grid_path(grid,path,x,y,oPlayer.x,oPlayer.y,1)...
  11. DragonRod342

    Legacy GM [SOLVED!] Pathfinding stop when surrounded

    Hi everyone o/ I'm coding a top down game where enemies follow the player if they're close enough to it. I'm using this code: this works pretty fine, but when an enemy with this code is surrounded by walls and have no possible path to follow, it just disappears! My game'll have some places...
  12. hans

    GMS 2 How to check for an unobstructed path.

    Hello, is there a way to see if an instance has an unobstructed path to a specific instance. I'm currently trying to implement an enemy spawner that first checks to see if the enemies it's spawning are able to travel to the player before spawning enemies.
  13. E.M.I

    GMS 2 Motion Planned pathfinding isn't working

    Hey there! I'm making a top-down adventure game with GMS2 and wanted to code a pathfinding system so the enemies in my game could avoid obstacles when chasing the player. However, the code doesn't seem to be working. This is my code: In my grid object's Create event: globalvar enemyGrid...
  14. badwrong

     Isometric ARPG - progress so far

    So I've been working on the core parts of an isometric game and its going good so far. Since I'm still on the very early parts, I'm wondering if there are any special things to consider early on that might help me later. Currently I have it performing very well even with many enemies at once...
  15. Tidbit

    GMS 2 [SOLVED!] MP_ functions unable to path through blocked corners

    Hello there, I've been fiddling with a roguelike for the past few days and opted into using GM's built in path functions to avoid having to mess around with writing a pathfinding system myself. My RL has 8 direction movement and the player can cross over blocked corners but it seems as though...
  16. AcrobatEpee

    Released The Pathfinding/Puzzle game : OneWayy

    OneWayy (with two Y because OneWay was already taken :() is a pathfinding game available on iOS and Android. It's pretty simple, the algorithm generates a level, and you need to solve it. You must only go once on each cell and fill the whole grid in order to complete a level. Just swipe to move...
  17. Pretorg

    Legacy GM [SOLVED] Problem with grid and clearing cells, it won't work

    Hello! after a long abscense i am back trying to finish my first projec, it is a 2d topdown game set in space and one of the enemies is supposed to be able to navigate towards the player without hitting anything in the way (pathfinding) because both the player and the enemy ships get damaged if...
  18. S

    GMS 2 [Grid-Based] What is the most efficient way to create a ghost/preview of potential movement?

    I am currently using IDE V2.2.2.413 Hello everyone! I am quite new to GML, and doing a lot of experimentation, and toying around to understand how all the moving parts work. I have spent quite a lot of time in the past few days doing my best to problem solve, and find solutions to my roadblocks...
  19. M

    Enemy Pathfinding(mp_grid) / State Machine Problems

    Hello everyone, I know this question asked many times before and yes I checked old posts and tried different solutions and approaches as much as I could but I'm still learning :/ (I started to GMS 4 months ago, pretty new). I will try to explain my problem. I'm trying to make a topdown shooter...
  20. hughrock18

    Legacy GM There MUST be an easier way! (Pathfinding)

    Hey everyone! The beginning of this thread is exposition of things leading to the problem. Don't have time for that? Skip down to the "comment", // HELP HERE //. In making an isometric "continuation" of yugioh the duelist of the roses called "Yu-Gi-Oh! The Shadow of the Dark Roses". For those...
Top