patchFreeciv - Patches: patch #3448, "Nation sets": allow set...

 
 
Show feedback again

patch #3448: "Nation sets": allow set of nations that will ever appear in-game to be chosen

Submitted by:  Jacob Nevins <jtn>
Submitted on:  Thu 26 Jul 2012 11:24:50 PM UTC  
 
Category: NonePriority: 5 - Normal
Status: In ProgressPrivacy: Public
Assigned to: Jacob Nevins <jtn>Open/Closed: Open
Planned Release: 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.

 

Wed 08 May 2013 10:57:35 PM UTC, comment #4:

Since this patch has been sat in my stash for a few weeks, I may as well post it here as a preview while I get my act together.
This isn't a candidate for commit as it doesn't have any actual functionality, but it demonstrates the ruleset format and server UI changes I'm thinking of.

(file #17935)

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.
Sun 29 Jul 2012 07:50:48 PM UTC, comment #3:

The list of nations shown in the client help should reflect the selected nationset.

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.
Fri 27 Jul 2012 12:23:34 AM UTC, comment #2:

> I'll raise a separate ticket for a simpler stopgap design for
> 2.4.x.

This is now patch #3449.

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.
Fri 27 Jul 2012 12:06:33 AM UTC, comment #1:

Nations exiting from the "core set" will need to be carefully controlled to avoid savegame compatibility issues.
If loading a savegame with a declared subset and nations inconsistent with it that we know about, we should probably just locally add them to the subset for the duration of that game.

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

Here's a sketch of a design to allow nations to be divided into subsets. It's aimed at solving problems recently discussed with the default nation set -- (a) allowing translators to focus on a smaller "core" of nations if they wish, (b) allowing players not to be overwhelmed by the choice -- but could find other uses. It tries to avoid the problems I pointed out in patch #3432.

This design requires changes to the network protocol and noticeable work on the client UI, so cannot be targeted at 2.4.x. I'll raise a separate ticket for a simpler stopgap design for 2.4.x.

Requirements are:

  • Allow definition of subsets of the nations in a ruleset, such that when a subset is selected, no nations outside that subset will ever be used -- users can't pick them, won't be picked randomly, not used for civil war.
    • This is so that translators can choose to focus on a "core" set, be sure that untranslated strings won't appear if users choose that "core" group.
  • Allow users to easily choose which subset of nations to use, in pregame (not after game start).
    • For single-player, should be as simple as a drop-down in the "pick nation" dialog.
    • For multi-player, should allow server operator to pick, or optionally, players to vote.
  • Allow the same individual nation definition files to be used for different subsets, and don't complain about references outside the subset (civilwar, conflicts_with)
    • ...while still complaining about references that can't be satisfied from the full set, as this is valuable to nation maintainers for spotting typos etc.
  • Allow easy definition of a user-visible "full" subset containing every nation in the ruleset, with a ruleset-defined name, without every nation definition having to remember to declare membership in this set.

Proposal:

In nations.ruleset, allow definition of a nation set with [nset_XXX]. This will look rather similar to [ngroup_XXX], and share the same namespace, but nationsets will be orthogonal to nation groups. Example usage for the case in point:

As with groups, the default set for the ruleset will be the first one defined.

Defining at least one set is mandatory (in order to give it a name). However, if only one set is defined, it will be kept out of the way of the user as much as possible.

In individual nation definitions, set membership is included in the 'groups="Foo", "Bar", "Baz"' just the same as group membership.

In nations.ruleset, define a "default_groups" list of groups/sets of which every nation is a member. Example:

Nations not in any set will cause a warning on ruleset load.

Add a server option "nationset". Value can be "" to use ruleset's default, or an explicitly set string. Allow players to vote to change this setting in pregame, but require some level of agreement.

On changing this setting, any existing nation selections not compatible with the new set go back to "random", clients only display nations/groups in the subset, effective "maxplayers" may change leading to kicks, etc -- so this is not to be done lightly.
(Could resend nations from the server when this changes, or will probably rely on client to hide unavailable nations correctly, to save network traffic on changes. Former means you only pay for "core" nation traffic at client connect if that's what you're using, latter means you don't get a massive burst of network traffic from changing a dropdown in pregame.)

Send the nation sets to the client alongside nation groups. However, they are not to be displayed in the same way as nation groups. Instead, add a drop-down in the client, on the "pick nation" dialog or similar, allowing changing the nation set (if more than one is defined). Changing this triggers a "/set nationset foo" to the server, similar to the aifill dropdown.

The effect of all this mechanism:

On game start, the random nation selection will only consider nations in the selected set. (This should be stronger even than "conflicts_with" -- it should as if the other nations don't exist.)

During the game, civilwar nations will again only be considered from the subset.

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 #17935:  trunk-nation-sets-wip.patch added by jtn (41kB - text/x-patch - trunk r22836: WIP (only ruleset/network changes))

 

Depends on the following items: None found

Digest:
   task 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 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 08 May 2013 10:57:35 PM UTCjtnAttached File-=>Added trunk-nation-sets-wip.patch, #17935
    Sun 21 Apr 2013 01:14:02 PM UTCjtnStatusNeed Info=>In Progress
      Assigned toNone=>jtn
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup