Hello phoku (& all),
It is great that we could have http://wiki.fifengine.net/PathfindingArchitecture
to put our path redesign. It's just I don't have a permission to edit the page yet, so I will still post my ideas here in the forum for now.
Regarding "how is multilayer blocking supposed to work?", here is what I think:
First, each instance should have a few more attributes as follows:
1. int, layer id --> the id of the layer where the instance locates
2. Set<int>, the set of interacting layers id --> the id of all layers where the objects there would block (interact with) the current instance.
3. global coordinates
Then we should be able to handle the multi-layer and multi-grid object blocking (interacting) with the following design:
layer 1 with cell size 0.5x0.5
layer 2 with cell size 1x1
layer 3 with cell size 2x2
Assuming an user controlled character Hero is in layer 2.
A small blocking rabbit is in layer 1, and a big blocking bear is in layer 3.
Then when a player clicks the mouse, a target for Hero is assigned.
To get a path for Hero, we have:
the getPath() should basically try to find a path in layer 2 (Hero's layer).
The path is a vector of layer 2 cells (let's call it pathVector), and then the only thing we need to take care of
here is: everytime when we add a new cell point to pathVector, we need to check if this specific cell is blocked in all layer.
This should be easy since each object in all layers now have global absolute coordinates.
So the main thing left is to have an algorithm to locate a path. This way, the old design of session can be abandoned. I don't know if anyone has any path finding algorithm in mind? If not, maybe I will post what I think for now, and people and discuss from there?