Update of patch #6546 (project freeciv):

                  Status:             In Progress => Ready For Test         
         Planned Release:            2.6.0, 3.0.0 => 2.5.2, 2.6.0, 3.0.0    

    _______________________________________________________

Follow-up Comment #3:

- Create the cache in common code
  - combat.c can benefit
  - there's no multiple copies of the cache when game has multiple ai types
that use default AI part
- Handle the special case of a unit type having negative bonuses against every
unit type (here "no bonus" counts as 0 bonus - not negative) to some extend -
some AI code saves some CPU by assuming the case irrelevant
- Cached value is full sum of bonuses applied, not last one of them, if
multiple bonuses apply for a specific defender/attacker pair
- As previous point made both loops to go over unit_types (prviously first
loop was over combat bonuses of the defender), combine loops creating the
cache

This patch is still about caching defense multiplier bonus only. Other combat
bonuses are less frequently checked -> benefit of caching not so clear ->
leaving for future tickets to consider.

As this version of the pacth is many ways cleaner than the original one, now
targeting to 2.5.2 too.

(file #25775, file #25776)
    _______________________________________________________

Additional Item Attachment:

File name: CommonCBonusCache.patch        Size:7 KB
File name: CommonCBonusCache-S2_5.patch   Size:6 KB


    _______________________________________________________

Reply to this item at:

  <http://gna.org/patch/?6546>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Freeciv-dev mailing list
[email protected]
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to