bugFreeciv - Bugs: bug #22058, tech_upkeep doesn't handle team...

 
 
Show feedback again

bug #22058: tech_upkeep doesn't handle team pooled research

Submitted by:  pepeto <pepeto>
Submitted on:  Tue 20 May 2014 06:11:56 PM UTC  
 
Category: generalSeverity: 3 - Normal
Priority: 5 - NormalStatus: Fixed
Assigned to: pepeto <pepeto>Open/Closed: Closed
Release: Operating System: Any
Planned Release: 2.6.0

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 25 Jul 2014 07:34:36 AM UTC, SVN revision 25720:

Improve tech_upkeep in case team pooled research is enabled. tech_upkeep is
now a per-player property and calculated only on server side.

With the help of Jacob Nevins

See gna bug #22058

(Browse SVN revision 25720)

pepeto <pepeto>
Project MemberIn charge of this item.
Wed 23 Jul 2014 02:59:46 PM UTC, comment #2:

First version of the fix attached:

  • tech upkeep is no more a part of the research structure, every player should have its own ;
  • at server side, tech upkeep is calculated every time we need it ;
  • at client side, tech upkeep is just read from what server sends ;
  • improvement of the calculation:
    • Tech_Cost_Factor is checked for the whole team, and divided my the members number ;
    • AI cost reduction taken in account ;
    • future techs are not counted twice when tech_cost_style==0 ;
    • the tech upkeep style modifiers are taken account after dividing by the number of team members.

Applying this patch requires network capability update.

(file #21521)

pepeto <pepeto>
Project MemberIn charge of this item.
Wed 18 Jun 2014 11:05:46 PM UTC, comment #1:

Looked at this in the context of bug #22158.

So player_research_update() is called for every player and calculates tech_upkeep, which is stored in the possibly-shared research structure but was calculated using player-specific information -- effects (Tech_Cost_Factor / Tech_Upkeep_Free) and, since bug #19589, number of cities.

tech_upkeep isn't actually paid until end_phase(). It's paid once per player, each time deducting from the shared research, using the stored tech_upkeep kept in the shared research structure.

I think the net effect is that some random team member's tech upkeep gets subtracted multiple times from the shared research, if they're not all the same (due to effects or "Cities" upkeep style).

I was also surprised that tech_upkeep is apparently recalculated on the client for display, rather than maintained on the server and sent to the client.

It feels like tech_upkeep should become a per-player property, being that player's individual contribution to research slowness. That way we can have individual players with the wrong government or whatever leading to effects holding the team back.

Jacob Nevins <jtn>
Project Administrator
Tue 20 May 2014 06:11:56 PM UTC, original submission:

The functions seems to only take one player pointer and use get_player_bonus(). I think the bonus should be cumulative for all players sharing the same research.

pepeto <pepeto>
Project MemberIn charge of this item.

 

(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #21521:  player_tech_upkeep.patch added by pepeto (13kB - text/x-patch)

 

Depends on the following items: None found

Digest:
   bug dependencies, patch dependencies.

 

Carbon-Copy List
  • -unavailable- added by jtn (Posted a comment)
  • -unavailable- added by pepeto (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 25 Jul 2014 07:34:48 AM UTCpepetoStatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Wed 23 Jul 2014 02:59:46 PM UTCpepetoAttached File-=>Added player_tech_upkeep.patch, #21521
      StatusNone=>Ready For Test
      Assigned toNone=>pepeto
      Planned Release=>2.6.0
    Wed 18 Jun 2014 11:11:37 PM UTCjtnDependencies-=>bugs #22158 is dependent
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup