Hello Guest

Author Topic: [2.1] Simple A * Pathfinding with 2DTK  (Read 7497 times)

JBabz

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 42
  • @joe_babz
    • View Profile
    • Zombit on Facebook
[2.1] Simple A * Pathfinding with 2DTK
« on: August 21, 2013, 07:49:36 am »
Can any of you fine folks explain to me how I can get Simple A * Pathfinding to work with 2DTK tilemaps?

I feel like it shouldn't be this difficult...

:/

Thanks!

-Joe

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: [2.1] Simple A * Pathfinding with 2DTK
« Reply #1 on: August 21, 2013, 09:18:54 am »
What have you tried?

JBabz

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 42
  • @joe_babz
    • View Profile
    • Zombit on Facebook
Re: [2.1] Simple A * Pathfinding with 2DTK
« Reply #2 on: August 21, 2013, 04:30:47 pm »
I couldn't really explain what I tried, because i have no idea what i'm doing.. :/
Umm..any starters?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: [2.1] Simple A * Pathfinding with 2DTK
« Reply #3 on: August 21, 2013, 05:04:48 pm »
It really depends on what youre planning on doing. Are you planning on writing your own A* pathfinding? Use someone elses solution?

JBabz

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 42
  • @joe_babz
    • View Profile
    • Zombit on Facebook
Re: [2.1] Simple A * Pathfinding with 2DTK
« Reply #4 on: August 21, 2013, 06:43:15 pm »
I'm trying to find someone else's solution that is viable. It is my understanding that I have to convert the tilemap to a format friendly with A * or something?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: [2.1] Simple A * Pathfinding with 2DTK
« Reply #5 on: August 21, 2013, 07:45:58 pm »
It really depends on what solution you want to use.
Eg. if you want to use unity navmesh with this its perfectly fesible, but you need to make the collision mesh renderable. http://unikronsoftware.com/2dtoolkit/forum/index.php/topic,1919.msg9543.html#msg9543
There's also this: http://unikronsoftware.com/2dtoolkit/forum/index.php/topic,1329.msg10186.html#new

JBabz

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 42
  • @joe_babz
    • View Profile
    • Zombit on Facebook
Re: [2.1] Simple A * Pathfinding with 2DTK
« Reply #6 on: August 22, 2013, 06:22:27 am »
Trying to implement this. I get this every frame:
NullReferenceException: Object reference not set to an instance of an object
Pathfinder2D.OnDrawGizmosSelected () (at Assets/Pathfinding/Scripts/Pathfinder2D.cs:741)

JBabz

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 42
  • @joe_babz
    • View Profile
    • Zombit on Facebook
Re: [2.1] Simple A * Pathfinding with 2DTK
« Reply #7 on: August 22, 2013, 06:18:09 pm »
Okay, I fixed that, but now every tile returns as an ID of -1.
I'm going to just use this thread from now on:
http://unikronsoftware.com/2dtoolkit/forum/index.php/topic,1329.0.html