GML Motion Planning when Object is larger than cells

Zodaris

Member
Working on a top down project involving path finding. I have basically how I'm going to handle it all figured out, however, there is one thing I noticed. When using mp_grid_path() it doesn't seem to take the size of the object into account. Which, I'm not going to change the cell sizes or the unit sizes. Having the units all the same size or having path finding squares all fairly large will either cause problems or silly results. Some units will be 1 cell large, others will be 2 or 4.

Once it's fully made I'll be using mp_potential_step() to go from point to point so I won't have to worry about the larger units walking half on a wall or through a space they shouldn't be able to fit (as well as handle having other units cross it's path). However, I worry that getting points that are too close to a wall will cause the unit to spas against the wall trying to get to the point. As well as what I just said about going through a space they can't fit in. mp_potential won't let them through it, but mp_grid_path() won't care and will put plot points there anyways.

What are some suggestions that you guys have for handling this? Is there a way to get the mp_grid to care about units that are bigger than a cell? Or does it care normally about size and I just goofed something up somehow? Google hasn't been very helpful in this regard. Although I could have sworn I read something about how to handle this somewhere awhile ago, but I can't recall what, how, or if it even was for GMS (which I'm using GMS2 if that changed anything).

Thank you for your time!
 

Zodaris

Member
I was going to wait a couple days before bumping this if there wasn't an answer, but dang the programming subforum fills up a LOT faster than I expected. This is already almost to the second page. Won't bump this again at least for a week though, since I know how much thread bumping can be frowned upon. Hopefully I'll figure out something by then if I don't get helped here first.
 
T

Theo Thrasy

Guest
I am having the same problem and can't find any good answers :(

I would love to know if you ever found a solution or if you made your own solution
 
Top