I recently made my own Tron clone in Qbasic, but im having some trouble with the AI. I made one that works fairly decent in avoiding obstructions, but its quite fond of putting itself in small corriders where it has no chance in he** of getting itself out, so its player dies. I was wonder if anybody knew how the original tron had done there pathfinding and aviodance system.
I believe that the original arcade game AI used predetermined paths. What I mean to say is that if the human player were to not be there, the game AI cycles would always follow the exact same path. Each new level had a different set of paths. Of course, Once the player started getting in the way the AI had to do something about it...
Tron was the name of a movie in or around 1985. State of the art computer graphics for the time. There was a game based on the movie (or it might have been the other way around). Tron was just released on DVD. You might want to check it out. Then you''ll understand the lightcycles reference.
Generally speaking, if the corridor is one unit wide, there is a fair chance your cycle isn''t going to get out.
The simplest method would be not go into a square that has a filled square on either side.
But this question is rooted a little deeper in the subject line.
I''ve not seen a tron game that attempts to win by actively "going for" the other player. They tend to win purely on obstacle avoidence.
I wrote one a while back that would try and block you. Ie, if the two of you were going in the same direction, it would cut across your path. This would force you to turn, often in the same direction as the AI, and so the rule would kick in again and he would block your path again (if possible)