#Hive AI in Node.js
This is the easiest way to get started quickly.
- Look at this reference implementation and accompanying package.json to get a feel for the basic structure.
- Create a new folder in the
ai
directory at the root of the project - In your new folder (I'll call it new-ai) create a new-ai.js and a package.json
- In the package.json, the following fields should be considered required: name, active, version, long_name, module, description
- In the new-ai.js, you must export a
function
calledprocess_message
, taking one argument: themessage
object. - Your AI will be expected to return a response message, just like the ones in this API specification document.
- Before trying to run your AI, make sure the active property in the package.json is set to true.
- Now it should be all ready to go. You can either run it through the hive-cli to pit it against other AI and see how it fares, or play against it yourself in the node-webkit-ui. In either mode, it is recommended you use Local mode as communications have less overhead, but feel free to test with Remote (TCP) as well, if you're curious.