Changes between Version 3 and Version 4 of AIEngineAPI


Ignore:
Timestamp:
Jul 19, 2012, 11:14:21 PM (12 years ago)
Author:
Jonathan Waller
Comment:

made formatting of objects consistent and added some information about the constructor

Legend:

Unmodified
Added
Removed
Modified
  • AIEngineAPI

    v3 v4  
    55The Engine uses the AIInterface and AIProxy components to provide this data.  The AIInterface is a player level component which handles communication with the AI.  AIProxy is an entity level component which creates a proxy representation of each entity to be given to the AI.
    66
    7 The AI's `HandleMessage` method is called with one argument:
     7When the AI is initialised the constructor is called with one parameter:
     8
     9{{{#!js
     10settings = {
     11  "player": 1, // The player id.  Gaia is 0, players are number sequentially 1,...,n.
     12  "templates": ..., // An object which gives access to the template data from .../simulation/templates/
     13}}}
     14
     15Every AI turn (currently happens every simulation update which is 5 times a second) the AI's `HandleMessage` method is called with one argument:
    816
    917{{{#!js
    1018state = {
    11   entities: ...,
    12   events: ...,
    13   players: [...],
    14   timeElapsed: ..., // seconds since the start of the match
    15   territoryMap: ..., // map of player territories
    16   passabilityMap: ..., // Map showing where obstructions are
    17   passabilityClasses: ...
     19  "entities": ...,
     20  "events": ...,
     21  "players": [...],
     22  "timeElapsed": ..., // seconds since the start of the match
     23  "territoryMap": ..., // map of player territories
     24  "passabilityMap": ..., // Map showing where obstructions are
     25  "passabilityClasses": ...
    1826}}}
    1927== `entities` ==
     
    5765{{{#!js
    5866state.passabilityMap = {
    59   width: 256,
    60   height: 256,
    61   data: [ ... ] // Uint16Array with width*height entries
     67  "width": 256,
     68  "height": 256,
     69  "data": [ ... ] // Uint16Array with width*height entries
    6270};
    6371}}}