As I said earlier, I would recommend you read through the source code in this tutorial, then download the zip file, open it with Visual c++, and see the thing in action.
Because of the size of the example program, I'm guessing that you havent followed it 100%. And it looks much much more complicated that it atually is.
To code your own ai program all you need is:
- A method of storeing States
- A method for expanding states
- A way of tracing back to the initial state
- A way of sorting the states
- A function for scoreing a state.
- And a main loop that removes 1 state from a list, and puts its children onto the list.
Each of the above very easy for a comfortable c++ programmer. The difficult part is putting it all together and making it readable and understandable to others!
Comments