Hi all. I asked a question some time ago on java 2d pathfinding... http://stackoverflow.com/questions/735523/pathfinding-2d-java-game
The game im developing is based on the idea of theme hospital. The chosen answer from my question, A* pathfinding, the link was awesome, and very helpful. I'm eventually getting to implement this into my game, however I have some further questions/issues regarding it.
In my game, the map will change. The tutorial assumes that the map is static (I think). I have been looking at the code, and as far as I can work out, I just need to create a method to call to update the game map in the pathfinding code.
Second, I see the class GameMap. I have my own class called Board which houses all the tiles. I believe I could integrate the methods on GameMap into my Board class. Right?
Third, I have been working on the reasoning that any rooms would be counted as blocked. I mean as in, any squares the room is covering are counted as blocked. I was thinking ahead to where the people will enter the rooms. They will then have to move around these rooms to get to various places. I was thinking I would just invert the Blocked boolean for each square, but this would not work for 2 reasons. 1, rooms could have ajoining walls, and potentially muck up pathfinding. 2, if the blocked status is simply inverted, then any solid items in the room would be seen as not solid when inverted back, which could cause problems when they are touching a wall.
Thinking about it, it would be better if you could make sides of a square blocked rather than actual whole squares. This must be possible, but I am just getting by using the tutorial in the previous question, and not sure if I should try and change A* to do this, or work on workarounds for the room items issue.
Any thoughts or suggestions on any of these issues? I'm implementing the simple path finding today, but just thinking ahead of myself.