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 12 Dec 2011 02:14:16 AM UTC  
 
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.0

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

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

 

Fri 27 Jun 2014 07:11:59 PM UTC, 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 27 Jun 2014 07:09:29 PM UTC, 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 25 Jun 2014 11:56:14 PM UTC, 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 08 Jun 2014 01:05:36 PM UTC, 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 12 Dec 2011 02:14:16 AM UTC, 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.

     

    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 27 Jun 2014 07:15:35 PM UTCjtnStatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Wed 25 Jun 2014 11:56:14 PM UTCjtnAttached 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 08 Jun 2014 01:05:46 PM UTCjtnDependencies-=>Depends on bugs #22161
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup