Check out my new blog

Monday, July 19, 2010

Pathfinding. Different paths, unknown ending.

I'm programming with XNA these few days. And I plan to have a Real-Time Strategy (RTS) game. Few codes after I start, I can now select a character and make it move. But an issue clearly occurs...


Yeah, my character moves. But it just moves. Moving without thinking is very wrong. Thus, the program needed artificial intelligence to somewhat move like an intelligent human being. Adding that so called artificial intelligence is a problem to me. I experienced it once. But just once.

So I'm now looking to some pathfinding algorithms. And A* is the most popular as I learned in one of my classes. Still, there are also other pathfinding algorithms out there like Dijkstra and Best-First Search.

These pathfinding algorithms differs with one another. They somewhat take paths different from the other. Some algorithms did not know that they are in the goal state but still finding other states because of uncertainty.

Others did not manage to reach the goal state because at the first place, they took different path, will be stuck there and can not go back.

Luckily, there are good algorithms like A* that is always finding the best or shortest path and reaching the goal in no time.

There are greater chance that you will need an A*. But others can be better too depends on the purpose. It depends on you. I do not know what will fit you and what algorithm are you.

But one thing I know, I am not an A*.

I am not efficient, I waste time. I waste memory. I take different path. And the ending is unknown.

Or maybe, the what I know as goal state... Is not the real goal state.

1 comment:

  1. TRUE. VERY TRUE. But most people are like that.