FIFE forums

Please login or register.

Login with username, password and session length
Advanced search  

News:

FIFE 0.4.0 has been released on 15th of January, 2017!

Author Topic: Pathfinding  (Read 2155 times)

cryptomancer

  • Newbie
  • Posts: 4
    • View Profile
Pathfinding
« on: April 28, 2008, 04:08:53 pm »

Hey people,
So since getting and building FIFE, I've been poking around the code trying to understand how it all goes together. Though I have a few of my own projects to eventually do, I'm planning to tackle part of the pathfinding system.

One behavior I noticed with the island demo is that it will plan a route that goes around the Girl agent, but during execution of the route, Girl will have moved and no longer is an obstacle. I think part of the issue is that mobile agents come up as blockers during map queries, when they maybe only should come up for avoidance. That may be a matter of adding new blocking types to the object dataset and map data.... and have some code for an avoidance routine to deal with the planned route being blocked. Latter part is trickier, it might have to be done in the agent scripts.

I've only briefly poked at the map format and the loader code. I'm not sure where I'd introduce more 'blocker' types other than 0 and 1. And then, I can see in the pathfinder(s) code where it queries if a square is blocked (Location::getLayer()->cellContainsBlockingInstance()) but not sure how or if I should change that to reflect more blocking types. For example, a door is blocking, but you'd still want an agent to path to it if the destination goes through the door- it would be up to the agent script to decide what to do at that point, and how to handle failure.

But anyway, if someone could point out some of these intricate points of the current pathfinder system, it would help me understand it all. ^_^
Logged

mvBarracuda

  • Administrator
  • Sr. Member
  • *
  • Posts: 411
    • View Profile
Re: Pathfinding
« Reply #1 on: April 30, 2008, 01:58:36 am »

Hello cryptomancer :-)

Our pathfinding experts currently lack the time to contribute to FIFE so you might need to dig through the code yourself :-/ We're currently a bit short on resources. Patches are always welcome in case you decide to start playing around with the code :-) You can add any patches / DIFFs to trac tickets.
Logged