Skip to content

Simple NPC Monsters & AI #30

@bdjewkes

Description

@bdjewkes

Currently all entities are players, but we want the world to be filled with NPCs for the player to interact with and struggle against.

Proposed implementation:

  • AI entities can use the same action_queue that players currently use. During process_tick, any AI actions in the queue can be evaluated using the same behavior as for players.

  • as a separate step in process_tick, loops over each monster entity in the world, and decide what action to put in the queue. In the long run, we'll what to have customizable behavior for different monsters, but an initial implementation could use very simple rules, such as:

    • if there is a player adjacent, attack it
    • if there is a player in view, move towards it
    • if there is nothing in view, wander randomly
  • for the initial implementation, a monster could spawn every x ticks if there are less than y monsters in the world

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions