So I am going to start off saying that the only game I have invested a considerable amount of time into is Ghost in a Cell back when it first came out. I really enjoy coding games as it requires me to research the various topics to compete in the different AI battles but I keep running into a problem. I have no idea how to determine a heuristic. I haven’t really found any good resources online(I could just not be looking hard enough). How the heck do you go about determining a heuristic for a challenge?
Start simple and iterate from that.
For example in GiTC:
- Send 2 troops from your factories to not owned factories every turn.
Very simple, far from optimal, but it’s a start. Now you realize that to win a battle, you must have more troops than the opponent. So 2nd heuristic:
- Send nb_of_troops + 1 troops instead of 2, where nb_of_troops is the nb of troops of the factory you attack.
Then you might want to take into account time of travel, ie enemy factory will produce units and possibly receive reinforcements.
The main danger is having a ton of ifs and different ideas performing against each other. So try to keep your ideas simple.
This blog article from Bob might help you understand the philosophy: