Follow-up Comment #5, patch #1264 (project freeciv):

There is a bug in the tech upkeep code that causes unexpected tech loss.
Probably caused by having 12 bulbs in stock while having a tech upkeep of 17
(and a production of several hundred).

Looking at the patch, I think having a negative research->bulbs_researched in
update_tech() should only be fatal after all cities have contributed their
bulbs. Also keep in mind if tech_upkeep is deducted before the cities are
processed, the bulbs output of several cities may be needed to pay the upkeep
cost.

Spelling: s/To low schience output/Too low science output/

A savegame is attached, from trunk + patches: variable-city-radii + tech
loosing/upkeep + experimental ruleset (not including the multiple buildslots
patch)

Thinking about tech upkeep a bit more,

* What happens during anarchy? Currently you can loose several techs. IMO
tech upkeep should not apply then, like monetary upkeep is zero, too.

* Should tech upkeep be allowed to be paid from stockpiled bulbs or should
freshly researched bulbs be required? The following pseudocode describes that
approach:


old_bulbs = get_bulbs()
clear_bulbs()
add_bulbs(- tech_upkeep)
add_bulbs_in_all_cities()
if (get_bulbs() < 0) {
  // not enough bulbs produced in the current turn to pay the tech upkeep
  lose_a_tech()
  clear_bulbs()
  old_bulbs = 0 // these are lost as well :-P
} else {
  add_bulbs(old_bulbs)
}


(file #8521)
    _______________________________________________________

Additional Item Attachment:

File name: fc23test3-T168-Y1180ADm.sav.gz Size:284 KB


    _______________________________________________________

Reply to this item at:

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

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


_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to