r119 Pathfinding odd behavior

Bugs will be moved here once resolved.

Post » Tue Feb 19, 2013 3:51 pm

Link to .capx file (required!):
https://dl.dropbox.com/u/666516/rightTurnclydepathfinding.capx

Steps to reproduce:
1. Run preview


Observed result:
The green square will turn to its right slightly on the first movement

Expected result:
There are no obstacles within the path, and the ending xy should be within grid coords so the object shouldn't need to turn

Browsers affected:
Chrome: dunno
Firefox: yes
Internet Explorer: dunno, duncare

Widows 7 & service pack: blah

Construct 2 version:
119

Thanks
    
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Wed Feb 20, 2013 3:11 pm

The destination object is a solid so it's not a clear path, and as far as I can tell it's working correctly since it's finding a lower path given the obstacle ahead. Closing as not a bug. If you think there is still an issue, try to reproduce it in one of the pathfinding demo projects, since those have options to display the nodes and pathfinding obstacle map and that can make it a lot clearer what's going on.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Wed Feb 20, 2013 6:04 pm

There is no destination object. The path is self.x+64, and self.y.
There is only one solid object on the map. The turning happens even if you remove the solid behavior from that object.
I've added a loop to generate nodes. If you want to take a look at it again.
Since the path at first has no object in its path the loop should only make two nodes, the start, and the end, however it seems to be setting the first node at 0,0 for some reason.
No idea if that has anything to do with the turning.
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Wed Feb 20, 2013 11:29 pm

Well, the nodes are always aligned to the pathfinding grid. That's by design.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Wed Feb 20, 2013 11:52 pm

Alright that makes sense. I adjusted the initial xy with an offset for half the cell size, and there was no turning.

I would be a little worried about that node at 0,0 though.

Thanks
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Thu Feb 21, 2013 12:04 am

@newt - that's because you loop up to the size of the array, where you should loop to size - 1.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Thu Feb 21, 2013 12:18 am

Ah, ok I was expecting node(0) to be at sprite's xy at the time the find path was called.
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 3 guests