All Projects → EllAyling → AI-Companion

EllAyling / AI-Companion

Licence: other
Created in Unity 5 for the purposes of learning AI techniques. Features behaviour trees and A* pathfinding.

Programming Languages

C#
18002 projects
ShaderLab
938 projects
HLSL
714 projects

Projects that are alternatives of or similar to AI-Companion

tektosyne
The Tektosyne Library for Java provides algorithms for computational geometry and graph-based pathfinding, along with supporting mathematical utilities and specialized collections.
Stars: ✭ 52 (+136.36%)
Mutual labels:  pathfinding, astar-pathfinding
cepathfind
a path find for tilebase game in unity
Stars: ✭ 30 (+36.36%)
Mutual labels:  pathfinding, astar-pathfinding
hierarchical-pathfinding
Implementation of Near-Optimal Hierarchical Pathfinding (HPA*) algorithm in Unity, tested with maps from Dragon Age: Origins
Stars: ✭ 90 (+309.09%)
Mutual labels:  pathfinding, astar-pathfinding
Baritone
google maps for block game
Stars: ✭ 3,868 (+17481.82%)
Mutual labels:  pathfinding, astar-pathfinding
Pathfinding Visualization
A ReactJS project visualizes the path-finding algorithms with additional cool features like speed adjustment, maze generation, mobile support, etc.
Stars: ✭ 14 (-36.36%)
Mutual labels:  pathfinding
Pathfinder.vim
Vim plugin to suggest better movements
Stars: ✭ 228 (+936.36%)
Mutual labels:  pathfinding
Pathfinding Visualizer Threejs
A visualizer for pathfinding algorithms in 3D with maze generation, first-person view and device camera input.
Stars: ✭ 209 (+850%)
Mutual labels:  pathfinding
ml pathfind
Pathfind module for MTA:SA-Server
Stars: ✭ 25 (+13.64%)
Mutual labels:  pathfinding
A-Star-Pathfinding-Tutorial
Short A* Pathfinding Tutorial project
Stars: ✭ 26 (+18.18%)
Mutual labels:  astar-pathfinding
04 battletank
An open-world head-to-head tank fight with simple AI, terrain, and advanced control system in Unreal 4. (ref: BT_URC) http://gdev.tv/urcgithub
Stars: ✭ 172 (+681.82%)
Mutual labels:  pathfinding
pathfinding-visualizer
Website built using React Framework for visualizing Pathfinding and Maze Generation Algorithms.
Stars: ✭ 33 (+50%)
Mutual labels:  pathfinding
Cupoch
Robotics with GPU computing
Stars: ✭ 225 (+922.73%)
Mutual labels:  pathfinding
The-Kraken-Pathfinding
A tentacle-based pathfinding library for nonholonomic robotic vehicles
Stars: ✭ 24 (+9.09%)
Mutual labels:  pathfinding
Astar
A fast 2D path finding library based on the A* algorithm. Works with both grids and graphs. Supports any .NET variant that supports .NETStandard 2.0 or higher. This library has no external dependencies. The library is licensed under the MIT license.
Stars: ✭ 215 (+877.27%)
Mutual labels:  pathfinding
3D interactive graphics rendering engine
Develop a 3D interactive graphics rendering engine
Stars: ✭ 31 (+40.91%)
Mutual labels:  gameai
Navmesh
A plugin for path-finding in JS using navmeshes, with wrappers for Phaser 3 and Phaser 2
Stars: ✭ 186 (+745.45%)
Mutual labels:  pathfinding
path planning GAN
Path Planning using Generative Adversarial Network (GAN)
Stars: ✭ 36 (+63.64%)
Mutual labels:  pathfinding
circular-obstacle-pathfinding
Pathfinding around a set of circular obstacles
Stars: ✭ 26 (+18.18%)
Mutual labels:  pathfinding
php-a-star
A* (A Star) search algorithm for PHP
Stars: ✭ 61 (+177.27%)
Mutual labels:  pathfinding
gruid
Cross-platform grid-based UI and game framework.
Stars: ✭ 67 (+204.55%)
Mutual labels:  pathfinding

AI-Companion

This is a project I created in 2016 for a university project for the purposes of using AI behaviour trees. If you check under Assets/Scripts/AI/Behaviour Tree, you can find all the scripts relating to how to create the tree. AIBrain is the root of the tree, and contains the blackboard for the tree.

Blackboard is essentially a 'catch-all' dictionary for any type of data the AI needs to store. It isn't type specific, so make sure your string is spelt correcttly.

Under Nodes you can find the plethora of nodes to create the trees. These all come back to three main types: Composite Decorator Action

You can find much more detail here on what these mean:

https://www.gamasutra.com/blogs/ChrisSimpson/20140717/221339/Behavior_trees_for_AI_How_they_work.php

This was a good resource for me when creating the project.

If you click "Display Grid" which can be found in the inspector, under Grid Script, for the GameController. When you hit play, you can look in the scene window to see the pathfinding grid be generated, as well as AI path finding, including the companion AI determining its position behind the player- which is based on Ellie's AI from The Last of Us.

If you look at one of the simple enemy type scrips in Assets/Scripts/AI/EnemyGuard.cs you can see how this all comes together into a single tree.

I've tried to format it as clear as possible by using indents to indicate which nodes are children of other nodes. But essentially all this tree does is:

NodeSequencer root = new NodeSequencer(new BTNode[] --- Create a Sequencer root

        {
        
         new NodeSelector(new BTNode[]              --- Use a selector node (See above link).
         
         {
         
                new ActionCheckForEnemiesInSight(),    --- Are there any enemies in my line of sight? If there are, we won't go to the next node, and instead go to the next in sequence- which is ActionUseWeapon. 
                
                new NodeAlwaysFail(                    --- This node always fails so the tree will constantly tick ActionLookForEnemy and then restart the sequence, using ActionCheckForEnemiesInSight until ActionCheckForEnemiesInSight returns a sucess and attacks.
                
                  new ActionLookForEnemy()
                  
                )
                
            }),
            
            new ActionUseWeapon()
            
       });

You can load in a prefab to see how all the scripts work together. As well as looking at Main.scene in Unity.

Entity.cs is the parent class which all AI types inherits from. This contains all functions that are common to all of them. Such as health, speed, requesting a path etc.

If you want even more information, including a YouTube video, and you can read the report I wrote on the project which details mostly everything, including diagrams of the full trees for each AI type here:

http://elliottayling.co.uk/portfolio/items/ai-companion-game/

There is also an implementation of dynamically generated A* pathfinding with heap optimisation under Assets/Scripts/AI/Pathfinding. Which is based on this video: https://www.youtube.com/watch?v=3Dw5d7PlcTM

Texture and sound sources:

http://opengameart.org/content/decorative-floor-free-tiling-texture

http://opengameart.org/content/glowing-hexagon-free-tiling-texture

http://opengameart.org/content/plasmatic-metal-2-free-tiling-textures

https://www.assetstore.unity3d.com/en/#!/content/25117

http://opengameart.org/content/gunloop-8bit

http://opengameart.org/content/explosion-0

http://opengameart.org/content/2-high-quality-explosions

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].