+1 vote

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:

Reality

When I want to get the path like this one:

Goal

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!

in Engine by (13 points)
edited by

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.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.