patchFreeciv - Patches: patch #3454, Multiple selectable flagsets per...

Show feedback again

patch #3454: Multiple selectable flagsets per tileset

Submitted by:  Jacob Nevins <jtn>
Submitted on:  Sat Jul 28 13:22:27 2012  
Category: clientPriority: 5 - Normal
Status: NonePrivacy: Public
Assigned to: NoneOpen/Closed: Open
Planned Release: Contains 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.


Tue Nov 17 05:48:02 2015, comment #3:

> I wonder if there's scope for some kind of load-on-demand for selected sprites

It shouldn't be that hard to do. We already load only those sprites that are use in current ruleset even if the tileset in question would provide more units/terrains/whatever. I think all the flags are currently loaded, as they are needed in pre-game when player selects nation (and then there's no need to load more flags -> not possible to fail at that point - if a new player gets added mid-game (civil war, barbarians, explicit player creation))

Marko Lindqvist <cazfi>
Project Administrator
Mon Nov 16 22:25:14 2015, comment #2:

I've been vaguely thinking about scratching this itch again.

It would be simplest to implement if the flags were all available as named sprites simultaneously, rather than having "sub-tilesets" which are loaded and unloaded when the option changes.

However, a naive implementation would have two lots of >500 flags in client memory at all times with the default ruleset. I don't know if that's a large memory increase, but it seems likely to be noticeable.

I wonder if there's scope for some kind of load-on-demand for selected sprites, where they're not actually allocated until first use. Along with a flush-unreferenced-sprites call, that might make it feasible to have only one set of flags in memory most of the time in practice.
(And perhaps allow us to make even larger flagsets available for use once the game starts; it seems a shame that we have SVG of every flag but only tiny rendered versions; if in practice only those extra-large flags for nations actually in the game were loaded, that might allow us to render and use them in e.g. diplomacy dialogs.)

Jacob Nevins <jtn>
Project Administrator
Sat Aug 18 23:56:26 2012, comment #1:

You have to handle "occupied" icon (on top of flag) in Amplio2 somehow when supporting multiple flag sizes. It was fixed to match larger flag size now used in Amplio2, but that broke it for me who use smaller flags.

Marko Lindqvist <cazfi>
Project Administrator
Sat Jul 28 13:22:27 2012, original submission:

I find the large flags used with Amplio2, while beautiful, do get in my way rather. They cause the citybar to be much bigger, and various dialogs / lists to be spaced out more. This is particularly noticeable on small screens.

Half-baked idea to solve this while still allowing them to be used:

Allow a single tileset to define multiple flagsets. The tileset specifies a default, but there's a client option to override it.

Since a client may switch between tilesets with different flagsets, the situation where the client-selected flagset isn't in the tileset needs handling gracefully. There should be a "default" option which always picks the tileset's default; the client UI should probably be a combo box rather than pure enumerated dropdown; and if the current non-default preference isn't in the current tileset, it should fall back silently to the tileset default. Naming conventions for flagsets will help here too.
(Unless we want to somehow support saving tileset-specific client options.)

So for Amplio2 (and probably the other supplied tilesets), we'd define "standard" and "large" flagsets, with Amplio2 at least defaulting to "large".

This will require some shuffling of where certain graphics live. For instance, the non-citybar occupied sprite is tied to the flag size, so needs to change with the selected flagset (although in principle it could still be per-flagset-per-tileset).

Jacob Nevins <jtn>
Project Administrator


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

Attach File(s):

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


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.


    Error: not logged in



    No Changes Have Been Made to This Item
    Show feedback again

    Back to the top

    Powered by Savane 3.1-cleanup