pathfinding -_-

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
Zilarrezko
Party member
Posts: 345
Joined: Mon Dec 10, 2012 5:50 am
Location: Oregon

pathfinding -_-

Post by Zilarrezko »

I have problems, specifically porting from this.

I'm not going to say I hate pathfinding... But I hate pathfinding. I either do not have the brain capacity to figure out how to do this, but I also seem to wonder how a table have trouble being indexed a -1, -1 but no problem with -1, 3. Infact I'm also baffled why it's even going into the negatives at this point.

Now I remember why I took a long break from Löve2D. Nothing conventional and productive seems to work for me.
Attachments
unnamed.love
(7.74 KiB) Downloaded 79 times
User avatar
Zilarrezko
Party member
Posts: 345
Joined: Mon Dec 10, 2012 5:50 am
Location: Oregon

Re: pathfinding -_-

Post by Zilarrezko »

Okay! Scratch that! more immediate problem here! (I fixed the last one)
um_okay.png
um_okay.png (57.53 KiB) Viewed 3596 times
I think I managed to find a great pattern maker with nodes! But I'm pretty sure this isn't the shortest path...

So... um... yeah...

Yet I fixed it, but it's still quite Quarky. (I made it draw rectangles to make it easier to look at)

Looks like it thinks in some cases that the gCost for a diagonal is less than the gCost for an orthogonal.
unnamed_update.love
(7.71 KiB) Downloaded 82 times
User avatar
Zilarrezko
Party member
Posts: 345
Joined: Mon Dec 10, 2012 5:50 am
Location: Oregon

Re: pathfinding -_-

Post by Zilarrezko »

Nvm I got it...
User avatar
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Location: Ouagadougou (Burkina Faso)
Contact:

Re: pathfinding -_-

Post by Roland_Yonaba »

Can you explain what was the problem ?
User avatar
pacman
Citizen
Posts: 81
Joined: Thu Mar 14, 2013 4:10 pm

Re: pathfinding -_-

Post by pacman »

Posting on forums is like casting +INT spell on yourself :awesome:
User avatar
Zilarrezko
Party member
Posts: 345
Joined: Mon Dec 10, 2012 5:50 am
Location: Oregon

Re: pathfinding -_-

Post by Zilarrezko »

Nothing anymore. I got it to be fixed. It... had a weird fix... By not making any sense. I just trial and errored until it worked -_-.

If you want to see it now, here it is. And if you're looking for distV function, it's in the init file, and it just looks for the distance between two objects who have x and y indexes.

Left click (Hold) to destroy / create walls. Right click to find a path.

Although I am unsure... But it seems like it's checking more tiles that it needs to be.
pacman wrote:Posting on forums is like casting +INT spell on yourself :awesome:
haha yeah, I guess so. I think I've done it a couple times where I solved my own problems.
Attachments
unnamed.love
(9.25 KiB) Downloaded 79 times
User avatar
Zilarrezko
Party member
Posts: 345
Joined: Mon Dec 10, 2012 5:50 am
Location: Oregon

Re: pathfinding -_-

Post by Zilarrezko »

I had it all down, then I decided to make the code make sense, and I broke it -_- It's suppose to return a table if It couldn't find a path. Yet it's getting caught in an infinite loop if you box in the player or the destination. And sometimes, just sometimes It gets thrown into an infinite loops for no apparent reason that I can find.
Attachments
unnamed.love
(202.38 KiB) Downloaded 77 times
User avatar
Zilarrezko
Party member
Posts: 345
Joined: Mon Dec 10, 2012 5:50 am
Location: Oregon

Re: pathfinding -_-

Post by Zilarrezko »

Yeah this seems to not be one of those cases where posting adds a +int. I'm still having trouble.

Yup, Still having trouble. It's difficult to figure this out.

I thought it might have been some type of weird conflict with the heuristic. But that was wrong. I do know it's a problem with the pathfinding though. I was thinking of putting it into a thread. Although, Coroutines don't seem to work, and it seems love's threads are my best bet. Too bad there's not too much documentation on them. But if I got threads to work, then I could communicate between both threads and make the pathfinding thread have a .1 sleep time so I can draw the open and closed lists and maybe see what the problem is.

Anybody?
User avatar
Zilarrezko
Party member
Posts: 345
Joined: Mon Dec 10, 2012 5:50 am
Location: Oregon

Re: pathfinding -_-

Post by Zilarrezko »

This will be the last time I bump this, to avoid annoying people.

Edit: Fixed it. By looking at the older code. And making changes that didn't make sense and it works... Yeehaw...
Post Reply

Who is online

Users browsing this forum: No registered users and 33 guests