pathfinding with windows phone 8

0 favourites
  • 11 posts
From the Asset Store
Units do not overlap each other and use different ways if there are several free ways.
  • 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?

  • 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.

  • 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.

  • 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)

  • 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.

  • 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.

  • 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 works

  • 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.

  • 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%

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • jeremy yep, please send the exported project as a zip file and the .capx file to my email address and I'll take a look. Upload to Dropbox or something similar if too big.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)