pathfinding with windows phone 8

Discussion and feedback on Construct 2

Post » Tue Sep 17, 2013 8:39 am

Hi,

I'm seeing a strange problem with pathfinding.

I have my events set to move the player through a maze to their chosen destination when they touch the screen. It works fine in the browser and when exported to Windows 8, but not on Windows Phone 8, using the identical CAPX file.

When the problem occurs on my phone, pathfinding only seems to work for points on the same axis - ie. I can only move up/down or left/right within the direct line of sight.

If I then remove one of the layers (which is purely graphical and has NO events or solids associated with it), pathfinding starts working as expected on the phone.

I'm still investigating but it also seems if I leave that layer in, and instead delete some of the other objects (again they have no events and are not obstacles), it starts working.

Is this a known problem?

I don't want to post my CAPX publicly yet, is there a way to send it to the developers directly?
B
4
G
1
Posts: 8
Reputation: 373

Post » Tue Sep 17, 2013 8:46 am

The sole difference between a Visual Studio project that works (ie. with a layer removed) and one that doesn't (with all the layers) is the file c2runtime.js, but I don't get a lot of information from diffing it.
B
4
G
1
Posts: 8
Reputation: 373

Post » Tue Sep 17, 2013 9:29 am

@jeremy if you upload an html export and run in the Windows Phone browser does it work? Sounds like it may be an Windows Phone web worker issue.
Moderator
B
72
S
14
G
11
Posts: 900
Reputation: 11,930

Post » Tue Sep 17, 2013 1:17 pm

Thanks for the speedy reply (and for the Windows Phone 8 posts and plugin!)

I think I have understood your suggestion. I exported my CAPX to an HTML5 website, and hosted it with HFS. When I browsed to it from my Windows Phone, I had the same issue (and also the graphics were nasty)
B
4
G
1
Posts: 8
Reputation: 373

Post » Wed Sep 18, 2013 7:06 am

Any further help is appreciated. I'm trying to finish a game (which will be free) to enter a contest, and this is my main issue at present.
B
4
G
1
Posts: 8
Reputation: 373

Post » Wed Sep 18, 2013 8:30 am

The number of objects on my layout seems to be able to affect the behaviour.

Running the app on my phone, I can change it from a bad state (no pathfinding, only movement up/down or left/right within the line of sight), to better (pathfinding sometimes but not always works) just by removing half a dozen sprites, but it's still not 100%

I would estimate I currently have ~150 objects on my layout (size 3072x1920), of which 40-50 are on-screen at a time.

My animations are still fluid when the problem occurs, so I'm not sure that this is a performance issue as opposed to a pathfinding issue, but I'm in the dark really.
jeremy2013-09-18 08:30:45
B
4
G
1
Posts: 8
Reputation: 373

Post » Wed Sep 18, 2013 9:07 am

OK, some more clues:

I removed a bunch of objects from the part of the layout that is initially onscreen.

Pathfinding now works perfectly in that part of the layout, but when I move across to a region that still has objects, it stops working.

I have also seen glitches occur - sometimes I touch the screen and there is no response, then I touch in a different place and the player moves, and then it responds to the previous touch and the pathfinding starts.



Edit: making the objects invisible has the same effect as deleting them - the pathfinding worksjeremy2013-09-18 09:11:22
B
4
G
1
Posts: 8
Reputation: 373

Post » Thu Sep 19, 2013 11:14 am

@jeremy oops only just saw this by accident. Use @thehen to ensure I get notifications.

If you PM me a build I'll happily take a look.
Moderator
B
72
S
14
G
11
Posts: 900
Reputation: 11,930

Post » Thu Sep 19, 2013 10:58 pm

Thanks @thehen,

I'm not allowed to PM yet, can I use the email address on your website instead?

I just tried the same app in the phone emulator - it works better than on my phone, but still not 100%
B
4
G
1
Posts: 8
Reputation: 373

Post » Fri Sep 20, 2013 8:36 am

I think I'm making progress:

My background was originally a grid of square tiles making up a map. Replacing this with a single large image (after stitching the tiles together externally) fixed most but not all of the problems.

There were still some regions of the map where pathfinding did not work. Removing other objects from an upper layer resolved that issue and I had a playable game (albeit with some missing graphics).

My next step is to move any static graphical objects that don't interact with the player onto the same background image and hope that is enough.

My conclusion so far is that if there are too many objects in Windows Phone, the pathfinding "path found" event does not fire, except if the path has a count of 1(ie. line of sight).

Other platforms (browser/Windows 8 tested) do not display this issue.
B
4
G
1
Posts: 8
Reputation: 373

Next

Return to Construct 2 General

Who is online

Users browsing this forum: Yahoo [Bot] and 15 guests