Changes between Version 10 and Version 11 of HannibalBot
- Timestamp:
- Mar 28, 2014, 9:28:46 PM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
HannibalBot
v10 v11 3 3 4 4 == Intro == 5 The Hannibal AI/Bot is a new approach to reduce the complexity of programming a bot for 0 A.D. It was started in February 2014 by [http://www.wildfiregames.com/forum/index.php?showuser=16051 agentx]. This page will document the development process and parts of the source, explains major concepts and provides tips & tricks. The forum has already a few posts discussing the bot's features. [http://www.wildfiregames.com/forum/index.php?showtopic=18322 Little Query Language], [http://www.wildfiregames.com/forum/index.php?showtopic=18257 AI Tournaments]. Ultimately Hannibal should be unbeatable started with thehighest difficulty.5 The Hannibal AI/Bot is a new approach to reduce the complexity of programming a bot for 0 A.D. It was started in February 2014 by [http://www.wildfiregames.com/forum/index.php?showuser=16051 agentx]. This page will document the development process and parts of the source, explains major concepts and provides tips & tricks. The forum has already a few posts discussing the bot's features. [http://www.wildfiregames.com/forum/index.php?showtopic=18322 Little Query Language], [http://www.wildfiregames.com/forum/index.php?showtopic=18257 AI Tournaments]. Ultimately Hannibal should be unbeatable if started with highest difficulty. 6 6 7 7 In particular the bot will use: … … 61 61 62 62 == [=#triples Triple Store] == 63 64 [[Image(hcq.jpg, 600px)]][[BR]] 65 63 66 During start-up Hannibal parses all templates of involved civilizations and builds a mesh network consisting of nodes and edges. Nodes are e.g. classes, resources, technologies and all units and entities. Athen's culture generates around 160 nodes and 2000 edges. Nodes use a sanitized form of the templates name as unique name and are saved as a JS object with additional properties like cost, hit points and size. Maps or Weakmaps might perform better, but are untested. Edges consist of an JS array with source node, a verb and the target node, hence the name triple store. Currently there are 26 verbs for 13 edge types with two directions. During the game the store is updated with created and destroyed entities, so the query language can select these as nodes too. In game nodes have a '#' + their id as name suffix. The parser is coded in ''cultures.js'' and the store in ''store.js''. Both are separated so the domain knowledge is in ''cultures.js'' only. 64 67