0 votes

Hi guys,

First time posting here so if something is out of place please let me know so I can fix the post.

To my question, I have been stuck here for quite a bit and have posponed it but it's time to do it.

I have an isometric 2D 37x37 tilemap and am using Astar to get all the tiles and obstacles. Keep in mind this is for a kind of tower defense game where you can build on the whole map to create a maze so the map gets updated every round.

Right now the cells only get connected to their sides (top, right, bottom, left) but not diagonally.

The current path is this:

Current Path

Whis is almost ok but I wanted the mobs to walk diagonally so I also added the connection with the diagonal tiles but unfortunately it wasn't as I expected. It turned into the following:


When I want to get the path like this one:


So I was wondering if there is an easier way than checking each adjacent (including diagonally) tile for an obstacle before connecting all the cells as I think it's quite underperforming.

Thank you!

asked Apr 22 in Engine by Ignacio Freire (12 points)
edited Apr 22 by Ignacio Freire

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.