A downloadable asset pack

Download NowName your own price

Introducing PathForge: Revolutionary Grid-Based Pathfinding for Game Maker Studio 2

PathForge is a cutting-edge asset pack that revolutionizes grid-based pathfinding in Game Maker Studio 2. Inspired by the functionality of the renowned mp_grid pathing system, PathForge takes it a step further by generating an array of points instead of a traditional path. This innovative approach harnesses the power of arrays, providing an incredible speed boost for your pathfinding algorithms.

With PathForge, you can now unleash the true potential of your games by taking advantage of the lightning-fast performance of array operations. And the benefits don't stop there! When you compile your game with the YYC (YoYo Compiler), you'll experience an additional performance boost, maximizing the efficiency of your pathfinding calculations.

Say goodbye to sluggish pathfinding and hello to the optimized speed and efficiency of PathForge. Unlock a whole new level of performance and take your game development to greater heights with this groundbreaking asset pack.

More Detail:

The asset pack described above is a library for GameMaker Studio 2 that provides an implementation of the A* (A-star) pathfinding algorithm. A* is a popular algorithm used in game development for finding the shortest path between two points in a grid-based environment. It is especially useful for creating efficient and optimized paths for game characters or entities to navigate around obstacles.

The A* Star library includes various functions that facilitate pathfinding within a grid. It offers capabilities such as creating and manipulating grid-based structures, adding walls or obstacles to the grid, and generating optimal paths from a starting point to a goal point. The library incorporates concepts like node representation, heuristics, and costs to guide the pathfinding process.

Some key features of the A* Star library may include:

1. Grid Creation: The library provides functions to create and manage grid structures. It allows defining the size of the grid, the dimensions of individual cells, and any initial obstacles or walls within the grid.

2. Pathfinding Algorithms: The core functionality of the library is centered around the A* algorithm. It includes functions to find the optimal path from a starting position to a goal position, considering the presence of walls or obstacles. The A* algorithm uses heuristics and costs to guide the pathfinding process efficiently.

3. Grid Manipulation: The library offers functions to modify the grid dynamically, allowing the addition or removal of walls or obstacles. This flexibility enables real-time updates to the pathfinding environment.

4. Path Visualization: To aid in debugging and visualization, the library may include features to draw the generated paths on the game screen. This visual feedback can help game developers understand and verify the correctness of the generated paths.

Overall, the A* Star library is designed to simplify the implementation of A* pathfinding in GameMaker Studio 2 projects. It provides a robust and efficient solution for navigating entities within a grid-based environment while considering obstacles or walls. By utilizing this library, game developers can save time and effort in implementing pathfinding functionality and focus on other aspects of their games.

(fixed an issue with the grid being changed by each path calculation, that could cause a crash if used multiple times) 

Download

Download NowName your own price

Click download now to get access to the following files:

A-Star Asset Pack (GMS2) 28 kB
A-Star Project Files (GMS2) 37 kB

Comments

Log in with itch.io to leave a comment.

Im new when it comes to custom A* Pathfinding. How do i get an object to follow the created path/array ?

when i add path_start(path,3,0,0) it says ""path_start argument 1 incorrect type (array) expecting a Number""

(1 edit)

do it like this (make sure you delete path when done with it): 

var path_array = ap_grid_path_array(obj_tester.grid, x, y, mouse_x, mouse_y);

path = path_add();

for(var i = 0; i < array_length(path_array); i++){

var point = path_array[i];

path_add_point(path, point[0], point[1], 1);

}

path_start(path, 3, path_action_stop, 0);

With help from the gamemaker discord they came up with this,
Global left click is the same as the demo file, on the Global right click i added follow_path = true

if follow_path = true{

var points_array = path

if array_length(points_array) = 0{

  speed = 0}

else{

  if point_distance(x,y,points_array[0,0], points_array[0,1]) > walk_speed{

    move_towards_point(points_array[0,0],points_array[0,1], walk_speed)  }

  else{

    x = points_array[0,0]

    y = points_array[0,1]

    array_shift(points_array)  }

 }

}

This works really well! 
(1 edit)

Are you going to do pathfinding system working with tilesets?

Sounds like a good future update for this asset. Something like ap_grid_add_tile_layer(...)? And mask out specific tile ids as walls

Something like this. I can recommend You Pixelated pope's collision tutorial: https://gamemaker.io/en/blog/precise-tile-collisions-by-pixelated-pope -You can check it for precision reference.

(1 edit)

In order to do precise tile collisions it would require a navmesh system, the A* is a grid based system and only handles navigation with rectangular collisions. I will look into it and see what I can do.

This looks good, can’t wait to try it out!