Please format your code into code blocks by selecting it all and pressing Ctrl+e. This makes it much easier to debug code, particularly as GDScript cares a lot about whitespace.
I recreated the project and used your code, it works fine.
Do you get any warnings or errors?
Could you post a screenshot of the nodes in your scene?
Are your tiles really 100x100? If so, cool, i’m just verifying.
Use:
var start_coord_map = terrain_tilemap.local_to_map(to_local(start_coord_global))
var goal_coord_map = terrain_tilemap.local_to_map(to_local(goal_coord_global))
var path_in_map_coords = astar_grid.get_id_path(start_coord_map, goal_coord_map)
You pass a global position to one expecting local. That could cause problems but global and local are often the same so it often doesn’t matter.
It mostly looks okay so here’s my recommendation: Don’t inline the conversion of variables (in fact, never do that, ever). Print them. See if they make sense. Also print the grid info. If you ask for (500,600) which local_to_map turns into (5,6) and your grid reports its bounds as (-5,4) then you’re trying to find a path that starts or ends not on the map, which will give you an empty id_path. i got a lot of those when i first setup my unit conversions.
So your code looks fine but i recommend getting specific, concrete coordinates and making sure they match what you think you’re passing.
That should have modifying tiles and drawing lines. i’ve got demos for drawing lines with graphics primitives, Line2D and a tile map just for path lines (lots of different ways to draw).