Original Post
Hi community, I'm working on a small game in Java and I've reached the point where I have to think about AI. The game consists of a grid based map, for instance 100x100 tiles, and there are soldiers on them. They have a current facing, a limited arc of view, a certain action speed and they already know how to find a path to a destination. Also, there will be zones, i.e. an overlay to the map that can tell the AI whether there is a building, who controls it etc. I was contemplating to equip each soldier with an AI object that will control it. This AI class handles tasks, for instance "patrol on entire map", "guard building at x, x", "collect mineral x", "reequip armanents", "build sand bags at zone x". Since these tasks require different kinds of parameters, I'm asking myself on how to do this elegantly? The container for these tasks would be a Vector probably, but how on Earth can class Task be designed in order to be able to contain all the info for all possible tasks? I thought maybe one of you guys has a bright idea.