Trying to improve a tile-based movement system

So I’m trying to make a tile-based movement system for a game I’m making, and I’m wondering how I can filter out tiles that require going outside the movement range established to reach.

I’ve done a check before where I make a path to each tile and check if any waypoints go out of range, while effective, its fairly time consuming to generate a path and check every single one, so I’m wondering if there’s anything else I can do to accomplish this.


To get to the bottom tiles here, it requires going slightly out of where my unit’s move range allows for example.


A better visual example, some tiles are above in elevation and while they are accessible, my unit would have to go way out of the established range to go there to an off-screen slope.

your using pathfinding to move them right? or trying to just move directly to a tile?

pathfiinding, as of now it only uses it to actually walk to the tile selected given its Status is a success

ok do you have a video of the problem it might help understand how we could solve it or work around it

you could have each individual tile have data linked to it (like the height for example)

if the tile’s height is not accessible or within reach to the current tile the character is on then you could mark that tile as not accessible.

for the first image I would get the radius amount of tiles it can move and if the path to the tile requires more than the radius it would be not accessible

There isn’t really a “problem” it’s just I dont want tiles that require going out of range to be showed, I could try making a video later

for the 1st thing, the elevated tile is still accessible it’s just I didnt include an off-screen slope, but can you elaborate on how your 2nd idea would work?

the only form of data that you would need to have in order to achieve this would be:

  • Target tile to arrive at
  • Current tile
  • amount of tiles that you can move

if you want the preview to only show available paths you would probably have loop through every tile and check them individually

So the only way to get the preview to filter those out is the check I tried?

im pretty sure thats what you would have to do yea :face_holding_back_tears:

Unfortunate, thanks for the help tho

1 Like