Fabrefact

a blog by Sara Farquharson

Virtual Party Space Devlog #15: Tile-based pathfinding

Spent a few days puttering around with pathfinding and rendering isometric movement in Phaser.

Log

Wednesday, January 20

  • poked around with pathfinder some more

Thursday, January 21

  • generalized depth-layer code a bit and added buildings to it.
    • Buildings don’t work as well for some reason? Flickering when sprite transitions from in-front to behind
      • potentially make depth layers step-2? so sprites can always be above scenery at “same” depth
  • tried switching movement to event-driven as opposed to every update, but made movement very choppy

Friday, January 22

  • hacked pathfinder to get it working
    • relies on EventEmitter to tell Pathfinder when to try next step
      • because custom events tutorial designed EventEmitter as singleton, events only work for single player
        • could add userId to event name?
    • tile-based pathfinding looks pretty rough
    • pathfinder currently only has ground layer so is stymied by obstacles in scenery layer
      • if movement is blocked it just stops forever, path is never recalculated

About this series

Back in mid-December I started an ambitious project to create a custom platform for a virtual birthday party in February. I kept notes on my progress, both for personal reference and to turn into a series of blog posts. It quickly became apparent that I did not have time to both do the project and blog about the project. I have retroactively decided to post my raw notes as a dev log.