Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bot behaviour system #410

Closed
Jameskmonger opened this issue May 13, 2021 · 2 comments
Closed

Bot behaviour system #410

Jameskmonger opened this issue May 13, 2021 · 2 comments
Assignees
Labels

Comments

@Jameskmonger
Copy link
Owner

Jameskmonger commented May 13, 2021

Goals and actions

A bot processes the game through a set of goals and actions, taken during the preparing phase (although there's no reason they couldn't do some bench management in the ready/playing phases, eventually)

During play, the bot will first choose a goal. This goal will be scored using utility functions (see below). Examples of goals could include:

  • Replace weak piece
  • Improve board diversity (element)
  • Improve board diversity (class)
  • Evolve piece
  • Change formation
  • Gain interest

Actions are a set of interactions with the game for a bot. In some cases these will have a 1-to-1 link with PlayerActions (i.e. "sell piece") but in some cases an action in terms of bot behaviours can be made up of multiple PlayerActions. Examples of actions include:

  • Sell a piece
  • Buy card
  • Move piece
  • Swap pieces
  • Reroll cards
  • Buy XP

Actions will also be scored using utility functions (see below).

When considering actions, all reasonable permutations of the possible action will be considered. For example rather than the generic "buy card" action, the bot would instead consider the utility of buying card 1, 2, 3 etc, and compare them all. This allows for the bot to make informed decisions based on their possibilities. Personality traits (see below) could be used to allow the bot to consider more/less actions.

Personality

Each bot will have a range of values making up a consistent set of personality traits. Each trait is a sliding scale between two opposite adjectives, with a range from 0 to 255. At the start these values can be static just to provide some flavour to the bots, but eventually they can be learned #388

Traits will be used in utility functions (see below).

In general traits should avoid overlap, i.e. a bot with high trait A shouldn't be prevented from having a high (or low) trait B value.

Some ideas of traits I have had so far:

  • cautious / aggressive
  • fearful / composed

Utility functions

Each bot action/goal (not sure yet) should have a utility function, which will be a generator function, with access to the internal PlayerState, as well as access to the bot's personality. The utility function will be specific to the action, and all utility functions should return within a consistent range. My preferred range at the moment is 0 (this is an action that should not be considered) to 255 (this action should be done unquestionably).

For example, the utility function for the "reroll cards" action could take the following things into account:

  • amount of money
  • life remaining
  • lost last game
  • trait: fearfulness
  • trait: aggression

This could give a natural feeling to the gameplay, whereby all bots will be more inclined to reroll if they have lots of money, or if they don't have much life remaining, but aggressive bots will be more likely to reroll in general, and fearful bots will be more likely to reroll if they're on a losing streak.

The different utility values will be calculated, and then compared, to pick the "optimal" action/goal. There could be a trait, such as "proficiency", which fuzzes these utility values by some variable amount.

@Jameskmonger
Copy link
Owner Author

  • ambition
  • composure
  • vision
  • competency

@Jameskmonger
Copy link
Owner Author

closed in dec38b2 but needs further development

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant