Changes between Version 3 and Version 4 of AIEngineAPI
- Timestamp:
- Jul 19, 2012, 11:14:21 PM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AIEngineAPI
v3 v4 5 5 The 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. 6 6 7 The AI's `HandleMessage` method is called with one argument: 7 When the AI is initialised the constructor is called with one parameter: 8 9 {{{#!js 10 settings = { 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 15 Every AI turn (currently happens every simulation update which is 5 times a second) the AI's `HandleMessage` method is called with one argument: 8 16 9 17 {{{#!js 10 18 state = { 11 entities: ...,12 events: ...,13 players: [...],14 timeElapsed: ..., // seconds since the start of the match15 territoryMap: ..., // map of player territories16 passabilityMap: ..., // Map showing where obstructions are17 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": ... 18 26 }}} 19 27 == `entities` == … … 57 65 {{{#!js 58 66 state.passabilityMap = { 59 width: 256,60 height: 256,61 data: [ ... ] // Uint16Array with width*height entries67 "width": 256, 68 "height": 256, 69 "data": [ ... ] // Uint16Array with width*height entries 62 70 }; 63 71 }}}