Skip to content

Idea generator

adQuid edited this page Nov 15, 2018 · 5 revisions

A strategy game could, in theory, have nearly infinite, nearly identical, possible actions available for a player to do, and even if not Decent AI still would not know what actions exist in your game. To solve this problem the developer is required to implement IdeaGenerator, which spitballs sets of actions that seem reasonable for the AI to try out.

In an effort to reduce the complexity of all possible courses of action down to something that can be calculated in a reasonable period of time, DecentAI uses "iterations" of lists of actions. Each iteration is like a layer of actions, tested independently for positive effects, then either rejected or layered on and considered set in stone afterwards. The AIBrain will continue to try new actions for as long as hasFurtherIdeas() returns true, and will provide the current iteration to both that method and the method call to generate ideas.

At the time of writing, IdeaGenerator writing is an art form that has only been practiced twice, but here are some things to keep in mind:

  • Be optimistic. The whole point of Decent AI is to weed out bad ideas, so include all actions that make any sense unless you are starting to see computation times take too long. The AI may come up with ideas that surprise you.

  • The IdeaGenerator is a good place to put in any fixed sequences or "manners" that don't change much based on context. If you would never take off with a plane without putting fuel in it that same turn, simply always pair those two actions together here, saving computation time and preventing bots from doing strange behaviors.

  • The list of actions returned by an individual iteration should be an atomic "move", that wouldn't be too

Clone this wiki locally