by loftar » Fri Jul 17, 2009 2:56 pm
To be more precise, it's been a little hard to figure out a good algorithm. Obviously, I can't use a normal graph-searching algorithm (like A*) for pathfinding, since I have no graph to search (even if I could use the game objects as locative nodes directly and had a complete list of them, which I don't, I would still have no neighbor list or anything related). Therefore, I've had to figure out an algorithm that does wihout it. I think I've figured out a reasonable algorithm now which uses object corners as locative nodes and then find new nodes (lazily) in the process of trying to trace a path towards the goal.
As kaka says, I now only have to actually implement it. And then I have to re-implement players and animals a bit to be able to actually follow paths. I don't think I'll have to worry much about moving objects, however (in the way that RTS games often have to do), since collisions with moving objects will probably be comparatively rare.
"Object-oriented design is the roman numerals of computing." -- Rob Pike