Skip to content

Conversation

@Delwing
Copy link
Owner

@Delwing Delwing commented Aug 5, 2025

Summary

  • optimize pathfinding by caching per-area graphs and results
  • document PathFinder behavior and caching strategy

Testing

  • npm test (fails: Missing script: "test")
  • `node - <<'NODE'
    const { PathFinder } = require('./map-fragment/reader/PathFinder');
    const { MapReader } = require('./map-fragment/reader/MapReader');

const mapData = [{
areaId: 1,
areaName: 'Test',
rooms: [
{id: 1, exits:{2:2}, specialExits:{}, weight:1, x:0, y:0, z:0},
{id: 2, exits:{1:1}, specialExits:{}, weight:1, x:1, y:0, z:0}
],
labels: []
}];
const reader = new MapReader(mapData, []);
const pf = new PathFinder(reader);
console.log('first', pf.path(1,2));
console.log('cached', pf.path(1,2));
NODE`


https://chatgpt.com/codex/tasks/task_e_6891e1f67534832a81623b0523dacf60

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants