Pathfinding breaks on unbounded scrolling!

Bugs will be moved here once resolved.

Post » Mon Aug 03, 2015 5:06 pm

Problem Description
When setting the layout to unbounded scrolling, the pathfinding bounds does not move to the screen location. It stops at the initial viewport.

Attach a Capx
http://1drv.ms/1IAGj4K

Description of Capx
Demonstrates that the pathfinder cannot discover a path out of the initial view area

Steps to Reproduce Bug
  • Step 1. Use arrow keys to move blue block a short distance.
  • Step 2. Click to send the Red block.
  • Step 3. See that the red block does not move out of the initial area

Observed Result
The Red block will move but only in the area set in the layout.
Eg: if layout is 640 by 480, and if you click outside this, then the block will move towards the spot but stop when reaches the border of the 640 by 480.

Expected Result
I expect the block to move to the spot no matter how far I scroll with the unbounded scrolling setting on.

Affected Browsers
  • Chrome: (YES)
  • Opera: (YES)
  • Internet Explorer: (YES)

Operating System and Service Pack
System : Windows 8.1 Pro

Construct 2 Version ID
version r210
Free code for all
B
23
S
7
G
4
Posts: 60
Reputation: 4,924

Post » Mon Aug 03, 2015 5:46 pm

Pathfinding is based on a defined grid.
The best option is to increase the layout size beyond what the camera requires.
Image ImageImage
B
169
S
50
G
173
Posts: 8,313
Reputation: 110,270

Post » Tue Aug 04, 2015 1:13 pm

Setting the layout size works, but it is rough on the CPU usage.
I am making a game that will have endless level size (Like Minecraft), so this does not work too well for me.
Thanks anyway.
Free code for all
B
23
S
7
G
4
Posts: 60
Reputation: 4,924

Post » Tue Aug 04, 2015 4:50 pm

Minecraft isn't really endless, it's based on a seeded random.
Image ImageImage
B
169
S
50
G
173
Posts: 8,313
Reputation: 110,270

Post » Thu Aug 06, 2015 11:18 am

Free code for all
B
23
S
7
G
4
Posts: 60
Reputation: 4,924

Post » Thu Aug 06, 2015 3:56 pm

This is by design. The Pathfinding behavior uses an obstacle map. Unbounded scrolling allows for infinite scrolling. Therefore to support pathfinding anywhere with unbounded scrolling would require an infinite amount of memory. See the manual entry:

Note all cells outside the layout area are always obstacles. Areas outside the layout area cannot be included in the pathfinding grid, since doing so would require an infinite amount of memory.
Scirra Founder
B
397
S
236
G
88
Posts: 24,389
Reputation: 194,448


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 5 guests