Moving pinned obstacles breaks pathfinding example

0 favourites
  • 3 posts
From the Asset Store
Unlock platyers earning coins, and save it with Localstorage
  • Link to .capx file:

    dropbox.com/s/iio9gk9dm2b9y10/brokenpathfinding.capx

    Steps to reproduce:

    1. Modify pathfinding example:

    2. Put a new sprite big enough to hold all obstacles outside the viewport

    3. Move all obstacles on top of this sprite

    4. Add pin behaviour to obstacles

    5. On start of layout pin all obstacles to this sprite

    6. Add a button somewhere in the viewport

    7. Add a condition if this button gets clicked:

    8. then move new sprite into the viewport

    9. run layout and click button

    Observed result:

    Pathfinding example does not work any more

    Expected result:

    Pathfinding should work. (well, I assume, because everything works fine when the obstacle holder sprite gets moved on start of layout)

    We have a lot of smaller objects - specifically spaceships - with some bots working on them. These bots should move along predefined pathes.

    We do not want to put each spaceship into a separate layout since we do not want to copy all the same interface elements and other game objects too.

    Also we want to maintain state information without using save behaviour, etc. Having all ships in the same layout but outside the viewport also allows us to switch between all ships instantly and there is no delay caused by loading gfx.

    Also and most importantly we want to be able to move ships without breaking pathfinding. (not at the same time when bots move of course)

    (Please note: I observed a similar issue when rotating pinned objects. After stopping rotation of the host object and unpinning attached objects, these objects do not feature the correct angle any more. They got somehow resetted to their original angle before rotating, when you access Angle property but display looks okay...)

    Could you please help me with this issue since it is crucial to our project at the moment.

    Browsers affected:

    Chrome: yes

    Firefox: yes

    Internet Explorer: yes

    Operating system & service pack:

    Construct 2 version: 126

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Add a "Regenerate Obstacle map" action after having moved the obstacles.

    Not a bug but a user/code mistake.

    <img src="https://dl.dropboxusercontent.com/u/36472942/construct/forumhelp/RegenerateObstacleMap.PNG" border="0" />

  • Thank you very much for your quick answer.

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