Posted 9-Oct-05 10:39 by Steffen

Information Update Strategy

Good question, I'll try to give a comprehensive answer. With the current server implementation, there are three "packages" of information that have to be distinguished:

Package 1: Important map changes, related to the enemy activities
- unit movement/combat
- production of units
- founding new cities
- disbanding cities
in areas that have been observed in the own turn before. This information is always up-to-date, during negotiation and even in between enemy unit moves. This package contains the RO fields Map, Territory and Unit/Model/City (own+enemy). So:

: if an enemy unit moved so that I (my AI) could see it, is its model already in the ennmymodel-list?

yes

:If this ennmy unit is still visible, is it in the ennmyunit-list?

yes

: Are the flags of the map also uptodate?

yes

: Similarly if one of my allies dicovers new land (for example a modern resource) just before contacting me, is this information already in my Map during the negociation?

yes

(Here you can see that the dominant consumer of out-turn information is the user interface, which is technically nothing else but another AI. The information that is valid during enemy movement is exactly the information that the user interface needs to paint a correct map.)


Package 2: Most other content of RO:
- Alive, Happened, Wonder, Ship
- State reports of nations in friendly contact
- Military reports of allies
This information is not updated during enemy unit movement. Examples:
- When a wonder is captured, you have outdated information in RO.Wonder in subsequent out-turn overridables like OnBeforeEnemyAttack.
- Your ally might lose its whole army but the military report you have does not reflect that at first.
The information is updated every time your AI is called for negotiation or for its own turn.


Package 3: Unimportant map changes - everything not contained in Package 1: changed enemy city sizes, changed terrain improvements, health gain of enemy units that didn't move etc. This information is not up-to-date during negotiation, only during your turn. (The distinction important-unimportant makes the server implementation easier, because it makes less updates necessary.)


Steffen

Answer This Posting

Name

eMail (spider-safe)

Subject

Text

Administration

Password