Changes between Version 5 and Version 6 of PetraBot


Ignore:
Timestamp:
Oct 26, 2014, 2:08:11 PM (10 years ago)
Author:
mimo
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PetraBot

    v5 v6  
    1212
    1313The headquarter module is divided in several sub-modules as attackManager, baseManager, ... which are described below. It is responsible for the development of the civilization (building structures and training units) and the steering of its different sub-modules.
     14
    1415== !AttackManager ==
    1516The attackManager deals with the different attacks. It is mainly a steering function, the real code which handles the training, the preparation and the actual attack is in attackPlan.js. In practise, the attackManager decides on the kind of attack (rush with small number of units, standard attack with medium-size army or attack with a huge army) by creating an attack plan. Then each attack plan defines its target player and the enemy entity which is its primary target. Then it creates build orders (to train the needed units) using three queues (soldiers, champion and siege units). The attack plan may require a transport to attack overseas. Once the primary target is destroyed, the attack plan choose a new target (from the same target player) which is [#accessibility accessible] by land. This continues until either the AI army is destroyed or no new target is found, in which case the army is disbanded.
     17
    1618== !BaseManager ==
    1719Each new cc is the root of a new base, which is governed by its own baseManager. This manager handles workers assigned to that base (for gathering, hunting, fishing, ...) through the file worker.js. It is also responsible for checking base's resources levels, building new dropsites if necessary, repairing its hurt structures.
     20
    1821 == !DefenseManager ==
    19 
    2022The defenseManager is responsible for the response to attacks (either directed towards the AI itself or towards its allies). It also deals with unit garrisoning (either garrisoning ranged units inside a "fighting" structures or garrisoning hurt units inside healing structures).
    2123
     24 == !DiplomacyManager ==
     25Deals with tributes with allies.
     26
    2227== !GarrisonManager ==
    23 
    2428It keeps track of all units garrisoned except those garrisoned in ships for transport.
    2529
    2630== !NavalManager ==
    27 
    2831The navalManager is in charge of maintaining the fleet (except trader ships which are dealt with in tradeManager) and managing the transport of units (done in transportPlan.js).
    2932
     
    3235== !ResearchManager ==
    3336It looks for new tech available and decides on which one to research.
     37
    3438== !TradeManager ==
    35 The tradeManager deals with barter and trade. It is responsible for finding the best available trade route (either on land or water), training traders and switching trade route when a better one is available. (the version in A17 was rudimentary, a more complete is ready and will be commited after the release).
     39The tradeManager deals with barter and trade. It is responsible for finding the best available trade route (either on land or water), training traders and switching trade route when a better one is available.
    3640
    3741= [=#queueManager !QueueManager] =
     
    5357In order to vary the strategy of the AI, several personality traits are used in the form of numbers between 0 and 1. Those already implemented include:
    5458  * aggressive: the higher this number, the more rushes in early game
    55   * cooperative: the higher this number, the more helpful the AI will be when an allied is attacked. It is foreseen to make this number dynamic, increasing (very slowly) when receiving a tribute from an ally or when being helped by an ally when under attack (ready, but to be committed after A17 is released).
     59  * cooperative: the higher this number, the more helpful the AI will be when an allied is attacked. This number is dynamic, increasing (very slowly) when receiving a tribute from an ally or when being helped by an ally when under attack.
    5660  * defensive: the higher this number, the more prone to build defensive structure.
    5761