Skip to content
ManApart edited this page Aug 24, 2021 · 10 revisions

AI

General Thoughts

Rat AI

  • only attack with low aim
  • Approach dagger range if not already in dagger range

Combat training dummy

  • Player controlled ai
  • Used to test fights

Player Controlled AI

  • All commands have an execute(source, keyword, args). Default delegates to execute(keyword, args). Supported commands create their event using source instead of player.
  • Command parser is passed the Target that is issuing the command. 99% of the time it’s the player, but could be a player controlled AI.

Ai has two properties, Ai state and ai state time

Make AI run not only during battle, but give it an on-tick listener where it can integrate game state and decide to do something. (And start with it allowing player controlled ai to make a choice) Only evaluate AI for current location

Maybe all command parsing come from AI and if not in battle / command is not an on-tick command, just cycle next ai etc.

AI DSL:

class CommonAI : AIResource {
    override val values = aiBuilder {
        ai("name") {
            inherits = listOf("parent")
            additional = listOf("action")
            exclude = listOf("action")
        }
    }
}
Clone this wiki locally