patchFreeciv - Patches: patch #3449, "Nation sets": initial...

 
 
Show feedback again

patch #3449: "Nation sets": initial cut-down implementation for 2.4.x

Submitted by:  Jacob Nevins <jtn>
Submitted on:  Thu 26 Jul 2012 11:27:39 PM UTC  
 
Category: NonePriority: 7 - High
Status: DonePrivacy: Public
Assigned to: Jacob Nevins <jtn>Open/Closed: Closed
Planned Release: 2.4.0-beta1,2.5.0

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

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

 

(Jump to the original submission Jump to the original submission)

Tue 31 Jul 2012 08:47:01 AM UTC, comment #11:

Try declaring this done again...

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.
Tue 31 Jul 2012 08:44:58 AM UTC, SVN revision 21665:

If we need to assign a new nation while a nation set restriction is in force,
and there are none left within the set (even conflicting ones), permanently
remove the restrictions.

Second part of gna patch #3449.

(Browse SVN revision 21665)

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.
Tue 31 Jul 2012 08:43:33 AM UTC, SVN revision 21663:

If we need to assign a new nation while a nation set restriction is in force,
and there are none left within the set (even conflicting ones), permanently
remove the restrictions.

Second part of gna patch #3449.

(Browse SVN revision 21663)

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.
Mon 30 Jul 2012 09:32:07 PM UTC, comment #8:

> Does it work similar to available nations limit in that civil
> war just never happen when all nations are already in use?

No; for 2.4, with file #16237 applied, then the sixth civil war will cause the restriction to be limited and a non-core nation will appear.

For the proposed long-term solution for 2.5+ (patch #3448), it would behave as you say.

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.
Mon 30 Jul 2012 09:28:20 PM UTC, comment #7:

> Then we'll take all nations not in that union set out of
> consideration, before assigning random nations, and remember
> that criterion for in-game nation assignment too (e.g. civil
> war).


So, by default (nobody choosing their nations) this limitation is core set of about 50 nations. What happens if 45 players start a game and more than five of them would suffer civil war. Does it work similar to available nations limit in that civil war just never happen when all nations are already in use?

Marko Lindqvist <cazfi>
Project Administrator
Sun 29 Jul 2012 07:45:58 PM UTC, comment #6:

Attached patch on top of what's already committed causes pick_a_nation() to disable restrictions and retry, if out of nations and a restriction is in place.

This is a temporary approach for S2_4. For the proper implementation in 2.5 (patch #3448), the size of the chosen nation set should determine an equivalent of playable_nations, such that attempts to create nations beyond the limit imposed by the set (via aifill, network connections etc) are rejected, so the issue doesn't arise.

(If anyone's worried what else might come out of the woodwork with this late change: if it turn out to be unusable, we can always stop using it in 2.4 with no harm done, and take the time to get it right in 2.5. So I plan to press on.)

(file #16237)

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.
Sun 29 Jul 2012 06:24:28 PM UTC, comment #5:

Hm, just spotted a flaw in my plan.
If creating a game with more players than in the default nation set (say >50), there's no relief valve so bad things happen.

Easy enough to remove the restrictions and try again in this case.

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.
Sun 29 Jul 2012 05:24:24 PM UTC, SVN revision 21642:

Add an optional concept of "nation set" to the ruleset.
If only nations within a set are picked by players in pregame, no others
will be automatically assigned during the game.
Designed to support a "core" group of nations for translators to focus on.

See gna patch #3449.

(Browse SVN revision 21642)

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.
Sun 29 Jul 2012 05:19:32 PM UTC, SVN revision 21641:

Add an optional concept of "nation set" to the ruleset.
If only nations within a set are picked by players in pregame, no others
will be automatically assigned during the game.
Designed to support a "core" group of nations for translators to focus on.

See gna patch #3449.

(Browse SVN revision 21641)

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.
Sun 29 Jul 2012 05:18:43 PM UTC, comment #2:

> (At least in the SDL client.)

I meant Gtk. Nation groups aren't currently used in the SDL client.

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.
Sat 28 Jul 2012 02:46:08 AM UTC, comment #1:

Proposed patch attached.
Example of use attached to patch #3432.

> (For expediency, this might just add internal "conflicts_with"
> relationships, which doesn't give an absolute guarantee that the
> nation will never be used, but is probably good enough.)

In the end, I didn't do this; the out-of-set prohibition is a harder prohibition than conflicts_with.

(file #16219)

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.
Thu 26 Jul 2012 11:27:39 PM UTC, original submission:

The design in patch #3448 requires network protocol changes and a chunk of work. Here's a cut-down proposal to sneak into 2.4.x.

Not tried actually coding this up yet, so details may change.

Proposal:

Include the "nation set" definition syntax for nations.ruleset [nset_XXX] from patch #3448.
However, unlike 2.5, it won't be mandatory to have any nation sets.
(This is an optional ruleset format extension. If we're going to do this, it must thus go in for 2.4.0-beta1.)

Nation sets will behave the same as groups in 2.4.x -- they'll be displayed alongside nation groups, there's no new UI, the client is unchanged.
(For expediency the order of groups vs sets will be fixed: sets then groups. This is not as flexible as it could be, but allows us to make the "Core" group the default group.)

The only difference is that, at game start time, we'll go through the explicitly-picked player nations and calculate the union of nation sets they belong to; belonging to no nation set counts as belonging to a notional "all" set.
Then we'll take all nations not in that union set out of consideration, before assigning random nations, and remember that criterion for in-game nation assignment too (e.g. civil war).
(For expediency, this might just add internal "conflicts_with" relationships, which doesn't give an absolute guarantee that the nation will never be used, but is probably good enough.)

If there are no explicitly-picked nations, we'll use the first defined nation set for restrictions, or no restrictions if no sets defined.

This should allow us to usefully define a "core" set in the supplied rulesets, while not impacting any other rulesets that don't use our nation set.

Effects:

  • Players see the "Core" set by default in the "pick nation" UI; if none of them choose another group tab, only nations from that set will be used in the game.
    • (At least in the SDL client.)
  • Games where no players pick nations will again use nations only from the "Core" set.
  • Unfortunately there's no way to tell the server that you want a completely random nation selection from the "extended" set. So no more games where the world spontaneously consists entirely of Dryads, Hackers, Martians, Ozites, and Vampires -- someone will have to pick a nation. (The 2.5 design won't suffer from this.)
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 #16237:  trunk-S2_4-nation-sets-interim-relief-valve.patch added by jtn (1kB - text/x-diff - trunk/S2_4 r21642: remove the restriction if it gets tedious)
file #16219:  trunk-S2_4-nation-sets-interim.patch added by jtn (10kB - text/x-diff - trunk/S2_4 r21632)

 

Depends on the following items: None found

Items that depend on this one

Digest:
   patch dependencies.

 

Carbon-Copy List
  • -unavailable- added by cazfi (Posted a comment)
  • -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 12 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 31 Jul 2012 08:47:01 AM UTCjtnStatusReady For Test=>Done
      Open/ClosedOpen=>Closed
    Sun 29 Jul 2012 07:45:58 PM UTCjtnAttached File-=>Added trunk-S2_4-nation-sets-interim-relief-valve.patch, #16237
      StatusIn Progress=>Ready For Test
    Sun 29 Jul 2012 06:24:28 PM UTCjtnStatusDone=>In Progress
      Open/ClosedClosed=>Open
    Sun 29 Jul 2012 05:26:38 PM UTCjtnStatusReady For Test=>Done
      Open/ClosedOpen=>Closed
    Sat 28 Jul 2012 02:46:08 AM UTCjtnAttached File-=>Added trunk-S2_4-nation-sets-interim.patch, #16219
      StatusIn Progress=>Ready For Test
    Fri 27 Jul 2012 09:33:21 AM UTCjtnStatusNone=>In Progress
    Thu 26 Jul 2012 11:29:38 PM UTCjtnDependencies-=>patch #3432 is dependent
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup