bugFreeciv - Bugs: bug #19176, Tech loss vs root_req

 
 
Show feedback again

bug #19176: Tech loss vs root_req

Submitted by:  Jacob Nevins <jtn>
Submitted on:  Mon Dec 12 02:14:16 2011  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalStatus: Fixed
Assigned to: Jacob Nevins <jtn>Open/Closed: Closed
Release: Operating System: None
Planned Release: 2.5.0, 2.6.0Contains string changes: None

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

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

 

Fri Jun 27 19:11:59 2014, SVN revision 25292:

Prevent tech loss of tech which is root_req for some other known tech.

Reported by Matthias Pfafferodt (syntron@gna).

See gna bug #19176.

(Browse SVN revision 25292)

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.
Fri Jun 27 19:09:29 2014, SVN revision 25290:

Prevent tech loss of tech which is root_req for some other known tech.

Reported by Matthias Pfafferodt (syntron@gna).

See gna bug #19176.

(Browse SVN revision 25290)

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.
Wed Jun 25 23:56:14 2014, comment #2:

> I think it's OK to hard-code this immunity.

Attached patch does so.

(file #21155)

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.
Sun Jun 8 13:05:36 2014, comment #1:

> Perhaps self-root_req'd techs should just be immune to being
> lost in this way?

Split this out to bug #22161, keeping this one for the general case:

> (I suspect that techs with non-self root_reqs cause trouble
> too; I don't see anything stopping you losing a tech that's a
> root_req for another tech, and that will probably upset lots
> of code.)

To put it another way: root_reqs try to establish an invariant that at all times players must possess root_req(tech) to possess tech, and tech loss drives a bus through that invariant.

Cases:

Tech loss through negative bulbs. This picks a random tech (pick_random_tech_researched()), so can with a bit of calculation avoid techs which are root_reqs for others.

techlost_donor (which is peculiar in many ways) is more problematic, since it's about a specific technology. If we enforce the invariant that root_reqs can never be lost, then donor can avoid possibility of forgetting techs by only giving away those which something else depends on. That might actually be OK in gameplay terms -- only giving away your latest technology is risky to you.

I think it's OK to hard-code this immunity. Ruleset authors who don't want it can not use root_reqs.
(Otherwise, we have to ensure that the game engine always copes with not having root_reqs.)

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.
Mon Dec 12 02:14:16 2011, original submission:

A long time ago (bug #16855 comment 13), Matthias noted that a feature of the multiplayer ruleset is problematic if tech upkeep is enabled.

There's a self-root_req'd tech called "Theory of Evolution" which is granted by Lua script when "Darwin's Voyage" is first built -- this is intended to stop repeatedly gaining the free advances the script also gives you at that point.

Notwithstanding that that's broken currently (bug #18394), and regardless of whether that's a good way to achieve that end, this raises a general question -- if self-root_req'd techs, which must be granted by special means (init_tech or Lua), are lost through lack of tech_upkeep, there may be no way to get them back, and there's no way to defend against this -- the lost tech is chosen randomly.

Perhaps self-root_req'd techs should just be immune to being lost in this way?

(I suspect that techs with non-self root_reqs cause trouble too; I don't see anything stopping you losing a tech that's a root_req for another tech, and that will probably upset lots of code.)

Jacob Nevins <jtn>
Project AdministratorIn 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 #21155:  trunk-S2_5-techloss-rootreq.patch added by jtn (2kB - text/x-diff - trunk/S2_5 r25269 + bug #22161)

 

Digest:
   bug dependencies.

Digest:
   patch dependencies.

 

Carbon-Copy List
  • -unavailable- added by jtn (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.

     

    Error: not logged in

     

     

    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri Jun 27 19:15:35 2014jtnStatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Wed Jun 25 23:56:14 2014jtnAttached File-=>Added trunk-S2_5-techloss-rootreq.patch, #21155
      StatusNone=>Ready For Test
      Assigned toNone=>jtn
      Planned Release=>2.5.0, 2.6.0
    Sun Jun 8 13:05:46 2014jtnDependencies-=>Depends on bugs #22161
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup