Pathfinding Jumps

Get help using Construct 2

Post » Tue Sep 24, 2013 10:57 am

The pathfinding example that comes with C2 has some code to show the path etc. Is that of any use?
If your vision so exceeds your ability, then look to something closer.
Moderator
B
131
S
29
G
81
Posts: 5,328
Reputation: 56,630

Post » Tue Sep 24, 2013 11:48 am

I tossed it in and modified it to the best of my ability, but what it shows me is definitely not the obstacle path.
Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,224

Post » Thu Oct 03, 2013 8:19 am

[QUOTE=DUTOIT]
I tried to see the 3rd program skipping, I couldn't see it skip 2 or so squares. I didn't see it teleport to the program? how to make it do that. Currently they just move till they are opposite my programs. Then I move into them and they disappear.
[/QUOTE]

A lot of times, the pathfinder object for the last computer object 'jumps' to the program and skips several squares. Since the computer object will only move based on how the pathfinder object moved, the computer object will 'jump' past several squares when moving.

There are other times when pathfinding just fails to work and the computer object sits there and the game stalls because it assumes pathfinding either finds a path or fails to find a path. I don't see how pathfinding can fail to find a path and also not trigger the fail to find path.

Maybe this isn't even a good way to approach the AI. This is what I came up with because I don't know how to mathematically determine a route from point A to point B, and I figured that's what pathfinding is good for. However, in my setup pathfinding seems to be buggy and inconsistent, and I think I'm going to need a new method for determining movement.

I looked at an example from @R0J0hound, but his version creates the board tiles when they are needed and then mathematically backtracks, whereas my game has the board tiles present at all times and therefore needs some sort of way to traverse (I'm using a pathfinding object) from point A to point B.

@Dave Hailwood, how did you construct the AI for your board game? Anyone else have ideas how to determine a path from point A to point B without using pathfinding?
Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,224

Post » Thu Oct 03, 2013 9:46 am

Alright, I added in the code to show the pathfinding grid whenever a pathfinding object is active.

Can someone please take a look? moveFinder seems to be pathfinding correctly, but spaceTracker has a very erratic pathfinding grid for some odd reason.

BoardGame.capx
Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,224

Post » Sun Nov 10, 2013 10:28 am

Bump. This is the problem I've been struggling with for a month or so now.

The link above should be updated with the latest version.

The pathfinding grid shows up whenever a pathfinding object appears, but the problem of diagonal pathfinding (even when diagonals are turned off) still appears.

I'm starting to think I need a mathematical way to determine paths without using the pathfinding object. If anyone has the time to take a look at this somewhat complicated matter, that would be great.
Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,224

Previous

Return to How do I....?

Who is online

Users browsing this forum: NadeemAbbass, plinkie, wizdigitech and 7 guests