= jMonkeyEngine Artificial Intelligence
:author: 
:revnumber: 
:revdate: 2017/04/15 13:30
:relfileprefix: ../../
:imagesdir: ../..
ifdef::env-github,env-browser[:outfilesuffix: .adoc]



Most games written need some type of link:https://en.wikipedia.org/wiki/Artificial_intelligence_(video_games)[Artificial Intelligence] to deliver a feeling of realism, excitement or challenge to the player. AI can be as simple as having an NPC (Non Player Character) respond to some action taken by a player or as complicated as smoothly navigating your way through a scene full of obstacles without getting stuck. It's a time-consuming and significant challenge to develop these systems so its much easier to use an existing library to do the heavy lifting for you. 

Unfortunately, the jMonkeyEngine comes with no official library for dealing with AI. There is, however, the jme3 Artificial Intelligence library that is probably the closest there is to an official release. Although it never made it into any official releases, it was designed, in part, by core team members. It consists of two separate AI models, a link:https://en.wikipedia.org/wiki/Navigation_mesh[Navigation Mesh] library using link:https://en.wikipedia.org/wiki/Pathfinding[path-finding], and a simple Steering Behaviours library that uses path-following. 

You can read about the introduction of the library in the forum thread: link:https://hub.jmonkeyengine.org/t/ai-plugin-now-with-navmesh-pathfinding/24644[AI plugin now with NavMesh pathfinding]. 

== Where to find it

The library and javaDocs can be found in the link:https://github.com/jMonkeyEngine-Contributions[jMonkeyEngine-Contributions] repository on GitHub under link:https://github.com/jMonkeyEngine-Contributions/jme3-artificial-intelligence[jme3 Artificial Intelligence]. Check the `release/libs` directory for the zip files. 

The jme3 Artificial Intelligence Library:

*  NavMesh - A Navigation Mesh path-finding AI system using the link:https://en.wikipedia.org/wiki/A*_search_algorithm[A*] algorithm.footnote:[Path-finding means computing the shortest route between two points. Usually mazes.]
*  Steering - Contains the foundations of an link:http://natureofcode.com/book/chapter-6-autonomous-agents/[Autonomous Agent] system that uses path-following and forces to move a character through its environment. Includes a test case as well.footnote:[Path-following is taking a path that already exists and then following that path.]  


== Use Examples

Coming at a later date.


== Other jME3 AI Options

There are other jME3 specific options available you can read about in the wiki under the topic link:https://jmonkeyengine.github.io/wiki/jme3.html#artificial-intelligence-ai[Artificial Intelligence (AI)].


== Further Reading

*  link:http://www.policyalmanac.org/games/aStarTutorial.htm[A* Pathfinding for Beginners] by Patrick Lester 
*  link:http://natureofcode.com/book/[The Nature of Code] by Daniel Shiffman
*  link:http://www.red3d.com/cwr/steer/gdc99/[Steering Behaviors For Autonomous Characters] by Craig W. Reynolds 
