Changes between Version 1 and Version 2 of AIEngineAPI


Ignore:
Timestamp:
Jul 14, 2011, 7:42:34 PM (13 years ago)
Author:
lexa
Comment:

link to the fully typed descriptino of the javascript classes

Legend:

Unmodified
Added
Removed
Modified
  • AIEngineAPI

    v1 v2  
    11AI scripts receive data from the engine about the current simulation state, once per simulation turn. This is a fairly low-level mechanism - it is expected that AI scripts will use a wrapper to provide more convenient access to the data. Currently this wrapper is implemented in `common-ai/base.js`.
     2
     3> Note by lexa: here is [http://code.google.com/p/split-bot/source/browse/#svn%2Ftrunk%2Fsrc%2Forg%2Fzeroad%2Fcommon_api a fully typed description of the javascript classes]
    24
    35The AI's `HandleMessage` method is called with one argument:
     
    1315};
    1416}}}
    15 
    1617== `entities` ==
    17 
    1818TODO
    1919
    2020== `events` ==
    21 
    2221TODO
    2322
    2423== `map` and `passabilityClasses` ==
    25 
    2624{{{
    2725state.map = {
     
    3129};
    3230}}}
    33 
    3431{{{
    3532state.passabilityClasses = {
     
    4037};
    4138}}}
    42 
    4339`state.map.data` encodes all the passability data of each terrain tile. `state.passabilityClasses` gives bitmasks that define how to interpret `state.map.data`. For example:
    4440
     
    5248
    5349}}}
    54 
    5550Since these are bitmasks, you can 'or' them together:
    5651