Hi,
I’m implementing at the moment a 2D tile based game. It is build up with rectangle tiles and the characters can go in 8 different directions. (N,W,E,S,NW,NE,SW and SE)
I used my own A* implementation which I implemented naiv from wikipedia. It looks ok and seems to work. I have now a special behaviour and I’m not sure how to combine this with a standard A* algoithm.
If you see the images I have two scenarios. The green dot should move to the red one, so red is the target. (StartScenario1-1)
In scenario one, he can pass blue, because blue is not blocking and the green one can move next to the red one. (StartScenario1-2)
In scenario two the green also wants to move to the red one (StartScenario2-1). Theoretically he can move through all the blue boys, because they are not blocking. Sadly at the target tile next to the red one is no space to set the green there. So the blues are not blocking exept if a blue is on the target field.
Problem is now that the green one is not set at the field right bottom of the red one (StartScenario2-2) and will not move.
I’m not sure if I have just a knot in my brain or I think too complex. Have someone an idea how I can solve this problem with an A* algorithm.
Thanks and best regards
L_tD