[Freeciv-Dev] [bug #20063] wrong tech upkeep when tech_cost_style = 2 or 4

2012-08-13 Thread David Fernandez
URL:
  

 Summary: wrong tech upkeep when tech_cost_style = 2 or 4
 Project: Freeciv
Submitted by: bardo
Submitted on: mar 14 ago 2012 01:46:04 GMT
Category: None
Severity: 3 - Normal
Priority: 5 - Normal
  Status: None
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Release: 
 Discussion Lock: Any
Operating System: None
 Planned Release: 

___

Details:

Possible bug in file tech.c.

It says:
>tech_bulb_sum = advances[i].preset_cost;

where it should say:
>tech_bulb_sum += advances[i].preset_cost;

When tech_cost_style is 2 or 4, the bug causes a reduced tech upkeep that take
into account only one tech instead of the whole tree.

If someone fixes this bug, please remember also to dissable the tech upkeep in
the modpack civ2civ3, else the upkeep is going to be 100 times greater than it
was designed.
I attach a .diff with both fixes.




___

File Attachments:


---
Date: mar 14 ago 2012 01:46:04 GMT  Name: FixTechUpkeep-Fixciv2civ3.diff 
Size: 968B   By: bardo



___

Reply to this item at:

  

___
  Mensaje enviado vía/por Gna!
  http://gna.org/


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


[Freeciv-Dev] [bug #19589] New tech upkeep style

2012-08-13 Thread David Fernandez
Follow-up Comment #1, bug #19589 (project freeciv):

I'm trying to implement this idea, it simply needs one extra line at the end
of tech_upkeep_calc() to multiply by number of cities owned by the player.
Could some coder please tell where can I get this value?


  tech_bulb_sum *= get_player_bonus(pplayer, EFT_TECH_COST_FACTOR);
  tech_bulb_sum *= (double)game.info.sciencebox / 100.0;
  tech_bulb_sum /= game.info.tech_upkeep_divider;
  tech_bulb_sum -= get_player_bonus(pplayer, EFT_TECH_UPKEEP_FREE);

  /*tech_bulb_sum *= ¿¿number of cities owned by player??*/


Syntron, if you are around, please tell what do you think?

___

Reply to this item at:

  

___
  Mensaje enviado vía/por Gna!
  http://gna.org/


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


[Freeciv-Dev] [bug #20062] Possible bug in ai_manage_taxes (aihand.c)

2012-08-13 Thread David Fernandez
Follow-up Comment #3, bug #20062 (project freeciv):

I catched a savegame, played with civ2civ3 rules over v2.4 beta1, where
English nation loses buildings/units due to low funds, and the AI keeps taxes
to 60% science and 40% gold.
aihand.c code seems designed so AI sets the taxes to 90% gold in this case
(under Democracy max tax rates are 90% with this rules).

Saddly, the AI keeps the same wrong behavior when I apply my patch, and it is
the same no matter if I enable or dissable the tech upkeep (my "fix" does
nothing...)

To reproduce the "bug":
1- Freeciv 2.4 beta1 + modpack civ2civ3
2- load savegame, start game with English, switch to AI control (normal
difficulty), and then "/set timeout 10" (or -1).
3- The AI loses buildings/units during 2 more turns, and it keeps taxes to 60%
science.
Note I saved the game after several turns watching the AI losing money while
keeping the taxes to 60% science.

I see this behavior often with civ2civ3 rules where it is harder to earn
trade/gold, but I don't know if the same happens with default rules.

(file #16390)
___

Additional Item Attachment:

File name: civ2civ3_v2.4-2-TaxRates-T0165.sav.gz Size:184 KB


___

Reply to this item at:

  

___
  Mensaje enviado vía/por Gna!
  http://gna.org/


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


[Freeciv-Dev] [bug #20062] Possible bug in ai_manage_taxes (aihand.c)

2012-08-13 Thread David Fernandez
Follow-up Comment #2, bug #20062 (project freeciv):

Let me another guess... this time I'm almost sure it is a bug, now I think I
fully understand the related code.

In function "ai_manage_taxes",
the variable "rate_sci_balance" keeps a non valid value = -1 if
"game.info.tech_upkeep_style == 0" (default value in most rulesets).
When it comes the time to "Set the rates", the code assumes that such value
"rate_sci_balance = -1" means that AI will lose bulbs (due to tech upkeep)
even with taxes maxed to science.
When "rate_tax_balance = -1" it means that AI will lose money (due to upkeep
costs) even with taxes maxed to gold.
When both values are -1, it prioritizes to maximize the science over the
gold:

  } else {
/* Go for science and risk the loss of improvements or units. */
rates[AI_RATE_SCI] = MAX(maxrate, rate_sci_min);
rates[AI_RATE_TAX] = MIN(maxrate, RATE_REMAINS(rates));


As I see it, in every ruleset where tech upkeep is dissabled, if AI is losing
money, and if switching taxes to maximize gold does not get a positive income,
then the AI maximizes the science (instead of gold), making the situation even
worse for next turn...

I'm still trying to catch a clear savegame, but it is not so easy.

Forget the 1st AItaxRates.diff (I wish I could remove it), I have uploaded
this new fix to a new file: FixTaxRates2.diff

(file #16389)
___

Additional Item Attachment:

File name: FixAITaxRates2.diffSize:1 KB


___

Reply to this item at:

  

___
  Mensaje enviado vía/por Gna!
  http://gna.org/


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


[Freeciv-Dev] [bug #20058] "Invalid string conversion from UTF-8 to CP1252" with Turkish leader name

2012-08-13 Thread Marko Lindqvist
Follow-up Comment #6, bug #20058 (project freeciv):

>> Can you test if problem is present in it? 
>
> It is.

Thank you. I'll try to make build with that *environment* version from 2.3.2
freeciv, from which official build - with earlier environment - is reported to
work, tomorrow.

___

Reply to this item at:

  

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


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


[Freeciv-Dev] [bug #20056] Spurious msgid "?vertag:"

2012-08-13 Thread Jacob Nevins
Update of bug #20056 (project freeciv):

  Status:  Ready For Test => Fixed  
 Open/Closed:Open => Closed 


___

Reply to this item at:

  

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


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


[Freeciv-Dev] [bug #20058] "Invalid string conversion from UTF-8 to CP1252" with Turkish leader name

2012-08-13 Thread Jacob Nevins
Follow-up Comment #5, bug #20058 (project freeciv):

> Do you still have the Installer build I made some weeks ago? 
I do. (Timestamp of file on my system is 2012-07-17.)

> Can you test if problem is present in it? 
It is.

___

Reply to this item at:

  

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


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


[Freeciv-Dev] [bug #20062] Possible bug in ai_manage_taxes (aihand.c)

2012-08-13 Thread David Fernandez
Follow-up Comment #1, bug #20062 (project freeciv):

Oh, my fault, this was not the bug.

I still think there is a bug somewhere in this function and I'll keep
searching, but you could remove this ticket for now.
Sorry.



___

Reply to this item at:

  

___
  Mensaje enviado vía/por Gna!
  http://gna.org/


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


[Freeciv-Dev] [bug #20062] Possible bug in ai_manage_taxes (aihand.c)

2012-08-13 Thread David Fernandez
URL:
  

 Summary: Possible bug in ai_manage_taxes (aihand.c)
 Project: Freeciv
Submitted by: bardo
Submitted on: lun 13 ago 2012 16:07:26 GMT
Category: None
Severity: 3 - Normal
Priority: 5 - Normal
  Status: None
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Release: 
 Discussion Lock: Any
Operating System: None
 Planned Release: 

___

Details:

For long time I have noticed the AI does not set the tax rates properly.
I have seen AIs that set a percentage to luxuries when there are no unhappy
people and there is no chance to celebrate, and I have seen many times the AI
losing buildings due to low funds when it was possible to increase the gold
taxes and so avoid the banckrupt.
At first I thought the wrong behavior was related to units supported by gold
(I have reported it in other tickets), but I have revised the related AI code
and I think I have found a possible bug in ai_manage_taxes (aihand.c):


/* First set tax (gold) to the minimal available number */
  rates[AI_RATE_SCI] = maxrate; /* Assume we want science here */
  rates[AI_RATE_TAX] = MAX(0, 100 - maxrate * 2); /* If maxrate < 50% */
  rates[AI_RATE_LUX] = (100 - rates[AI_RATE_SCI] - rates[AI_RATE_TAX]);


I can't understand the reason why maxrate is multiplied by 2 in:
>rates[AI_RATE_TAX] = MAX(0, 100 - maxrate * 2)
And such bug would cause the often AI behavior that I see where AI sets taxes
to 60% science, 0% gold and 40% luxuries at start.

When I "fix" it and I recompile, I find the tax rates are set by the AI in a
more reasonable way (with no useless luxuries), but AI still seems unable to
handle low of funds situations.

I'm new to freeciv code and I'm not sure if I really fixed something, or I
introduced an error that looks like an improvement. I'll try to upload some
savegame in case some coder can take a look. 



___

File Attachments:


---
Date: lun 13 ago 2012 16:07:26 GMT  Name: AItaxRates.diff  Size: 940B   By:
bardo



___

Reply to this item at:

  

___
  Mensaje enviado vía/por Gna!
  http://gna.org/


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


[Freeciv-Dev] [bug #20058] "Invalid string conversion from UTF-8 to CP1252" with Turkish leader name

2012-08-13 Thread Marko Lindqvist
Follow-up Comment #4, bug #20058 (project freeciv):

jtn: Do you still have the Installer build I made some weeks ago? Can you test
if problem is present in it? 

___

Reply to this item at:

  

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


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


[Freeciv-Dev] [bug #20058] "Invalid string conversion from UTF-8 to CP1252" with Turkish leader name

2012-08-13 Thread J. M. Gorbach
Follow-up Comment #3, bug #20058 (project freeciv):

>gorb, did/do you see a similar problem with previous Windows versions?
No, I didn't/don't.

___

Reply to this item at:

  

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


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


[Freeciv-Dev] [bug #20053] e_disaster not listed in stdsounds.soundspec

2012-08-13 Thread Jacob Nevins
Update of bug #20053 (project freeciv):

  Status:  Ready For Test => Fixed  
 Open/Closed:Open => Closed 


___

Reply to this item at:

  

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


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


[Freeciv-Dev] [bug #20050] Supplied earth-80x50-v3 scenario cannot be loaded in 2.3.x, has warnings

2012-08-13 Thread Jacob Nevins
Update of bug #20050 (project freeciv):

  Status:  Ready For Test => Fixed  
 Open/Closed:Open => Closed 


___

Reply to this item at:

  

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


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


[Freeciv-Dev] [bug #20058] "Invalid string conversion from UTF-8 to CP1252" with Turkish leader name

2012-08-13 Thread Jacob Nevins
Follow-up Comment #2, bug #20058 (project freeciv):

gorb, did/do you see a similar problem with previous Windows versions?

___

Reply to this item at:

  

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


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