-
Notifications
You must be signed in to change notification settings - Fork 0
example games
The following games are built to demonstrate situations the AI may come up against, and what it would do. Feel free to play around with the source code of each to see how the AI makes different choices. Note that some parts of each program use standard out to display more details on what the AI is thinking.
I won't vouch for the code style of either game; I intentionally used different choices to solve the same problems in different ways to showcase how Decent AI can be used, and didn't give them nearly as much scrutiny as the main package.
Each player starts with two planets. On those planets players can build industry, power, and defenses. Industry, if supported by power, will create minerals with which to build more things. Minerals can also be converted to currency, which is worth more score at the end but can't be used to build things. Finally, players have the option to raid other players, destroying their industry and gaining minerals unless the target is defended.
Try changing the costs and effects of the various build actions, turning off raids, or changing the payoff for turning minerals into currency to see the AI react. The "spacegame.ui.Mainmenu" class contains the main method.
Each player is a medival peasant with some livestock that you can get food from. This game is playable by a human player, giving you a chance to enter diplomacy with the other player in the game to see what the AI would and would not agree to.
Try changing the amounts of resources livestock provide, the time cost of taking care of animals, what each player starts with, or how fast food rots to see how the AI makes different decisions, and values trades differently. the "medciv.ui.MainUI" class contains the main method.