Giter Site home page Giter Site logo

mallos.ai's Introduction

Mallos.Ai

A lightweight AI library designed for Games.

Project Package
Mallos.Ai Nuget
Mallos.Ai.SadRogue Nuget

Features

  • Behavior Tree
  • Dialog Tree

Supported Frameworks

Getting Started

Blackboard

The blackboard is an esential part of Mallos.Ai, it is a central place to store and look up data related to the BehaviorTree.

As some BehaviorTree nodes require time to function there is a ElapsedTime property on the Blackboard which defined how long time it took since the last call. If you are making a turned based game it's a good idea to make it a constant time which is counted every turn.

The Blackboard also have a directory for storing anything that the nodes might want to share data between them. In the example below we store the coordinates where the player was seen and in the NavigateNode we say nagivate to those coordinates.

Create BehaviorTree

File: GoRogueSample/Monsters/Monster.cs

new BehaviorTree(
    new ParallelSequenceNode(
        // Check if we can see the player.
        new EnvironmentQueryNode(
            entity => FOVRadius,            // Entity View Radius.
            entity => entity is Player,     // Check if it is a player.
            spottedKey: "SeePlayer",        // Set a blackboard property with true or false.
            spottedCoordKey: "WalkTo"       // Set a blackboard property with the found coords.
        ),
        new ConditionalNode(
            blackboard => blackboard.GetProperty<bool>("SeePlayer"),
            new NavigateNode("WalkTo"),     // Go to Player
            new WanderNode()                // Wander around
        )
    )
);

Contributing

Contributions are always welcome.

License

The project is available as open source under the terms of the MIT License.

mallos.ai's People

Contributors

erictuvesson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

polytronicgr

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.