Dynamic Culture Overview

KyteM

Chieftain
Joined
Mar 4, 2014
Messages
27
So Culture Overview has been an issue for a while now, and while alternatives exist (thanks Leugi and Lockstep for providing them), they aren't optimal.

So I took upon myself to make it so.
Dynamic Culture Overview will scan the database for all non-Wonder buildings with Great Work Slots, and try to assign them a column (or use a pre-existing one if they override the right buildings).

Currently supports up to 13 buildings of 1 to 3 slots each (subject to available space). Any buildings that don't fit in the window will go below the city name along with National and World Wonders.

Since it refreshes the list at game load, it will always pick up every GW building, modded or otherwise.

IN ADDITION:
Feel free to take this mod and incorporate it to your own.

Just credit me, and hopefully my predecessors too. ;)
This mod is compatible with Lockstep and Leugi's fixes, so if they override this one it should still look OK.

To quote Lockstep half a year ago:
- Unique variants of GW buildings (e.g., the Ceilidh Hall) would replace their generic variant when playing as the respective civilization (e.g., the Celts);
- The Royal Library would only show up when playing as the Assyrians;
- Custom unique GW buildings where the generic variant doesn't feature a GW slot would show up in accessory columns for the respective players;
- Mods that add slots to generic GW buildings would not break the Culture Overview;
- Custom generic GW buildings would be inserted according to their prereq tech rank.
This mod has been tested to fulfill 1, 2, 3, 4 and 5.
 

Attachments

  • 2014-04-08_00002.jpg
    2014-04-08_00002.jpg
    232.2 KB · Views: 2,941
  • 2014-04-08_00003.jpg
    2014-04-08_00003.jpg
    224.4 KB · Views: 2,153
  • Dynamic Culture Overview (v 6).civ5mod
    Dynamic Culture Overview (v 6).civ5mod
    21.8 KB · Views: 1,296
Great mod! It seems I can finally declare my "Culture Overview Fix" to be obsolete. ;-)

EDIT: You may want to add references to "Tuscan Civilization" by sukritact, and "Argentina Civilization" by Leugi.

EDIT2: The Tuscan Duomo (replaces Garden, 1 GW slot) is displayed correctly in an accessory column; the Argentina Tanguería (replaces Opera House, 3 GW slots) does not show up in any column, however. (It may show up below the city name if built, which I haven't checked.)
 
Haha, thanks. That's awesome coming from you. :D

If the building has 3 or more GW slots it'll show up with the Wonders, because I didn't add any premade 3-slot columns. Wasn't sure if anybody had bothered to make a 3-slot non-Wonder building.

The Tanguería does, however, open up an edge case I hadn't considered, because I hadn't considered what'd happen if a building override changes the number of Great Work slots. Right now if the BuildingClass is a preexisting one (Amphitheater, Opera House, Museum, Broadcast Tower or Cathedral), it'll slip right through the system and CiV's vanilla systems would take care of it.
I'll have to test further.

Thanks for the heads up!

E: Yep it falls through and gets the Opera House's column, which is meant for 1 slot. So the other two slots end up unavailable. Thinking I'm gonna have to make every column dynamic and show'em sorted by GW count first tech cost second.
 
Very nice; I think I'll be using this from here onwards.

Have you taken a look at the tech tree? It has a horizontal scrollbar, but I'm unsure if it can be adapted.

I'd prefer to have them sorted by tech cost first (and hereby keep the default sorting order). This should also deal with item 5 of my former list, as tech cost is a good proxy for tech rank.

In the end I went with GridX/GridY, which is pretty much the same.
I chose GW as first item of order because reordering columns is basically impossible and I didn't want to leave the museum's 2-slot column mixed in with the rest (and I never did like that arrangement, anyways)

Right now I'm wrestling to see if it's possible to get a nested scrollpanel working, but the game is being quite decisive in telling me "no". I can't get the innermost content to respect the inner scrollpanel, so I think I'm just gonna scrap that idea.

From a user experience perspective, how disruptive would it be if the culture panel's columns shrunk to fit? I did it mostly 'cause I wanted to fit as many buildings in the available space as possible, but then I realized I had a circular dependency going on so the effort was moot (the city name column is as wide as it's needed to fit the wonders/other buildings and the script will try to fit as many buildings into columns as possible and toss the rest with the wonders).
 
I chose GW as first item of order because reordering columns is basically impossible and I didn't want to leave the museum's 2-slot column mixed in with the rest (and I never did like that arrangement, anyways)

You may not like the current arrangement, but it is consistent (first non-religious GW buildings by tech cost, then Cathedral) and IMO intuitive. Another possible intuitive sorting order is by GW type (Amphitheatre; Museum, Cathedral; Opera House, Broadcast Tower). Sorting by GW number seems to me the least intuitive of all.
 
The only thing that changes is the museum's placement. I s'pose I can revert it and make sure only the museum gets that column.

But, for example, the Tangueria, which replaces the Opera House, will end up on the right (or even under the city name, if there's not enough space) because it'll drop its normal 1-slot column and pick a 3-slot column. Thus we get inconsistency.

(I always assumed it was sorted by tech with buildings without tech prereq (such as Cathedral) last)

Alright how about I upload the v3 beta and tell me how it feels. Just need to switch to the main branch....

E: Ok that took longer than expected. Turns out I'd commited some changes into the wrong branch.
 

Attachments

The only thing that changes is the museum's placement. I s'pose I can revert it and make sure only the museum gets that column.

But, for example, the Tangueria, which replaces the Opera House, will end up on the right (or even under the city name, if there's not enough space) because it'll drop its normal 1-slot column and pick a 3-slot column. Thus we get inconsistency.

Maybe I'm missing something ... With your proposed sorting order by GW slots first, a standard civ would end up with

Museum (2), Amphitheatre (1), Opera House (1), Broadcast Tower (1), Cathedral (1)

OTOH, Argentina should see

Tanguería (3), Museum (2), Amphitheatre (1), Broadcast Tower (1), Cathedral (1)

So, either you are already able to display different column-width patterns, or you get inconsistency in case of Argentina.
 
It's GW Ascending.

So Amphitheatre (1), Opera House (1), Broadcast Tower (1), Cathedral (1), Museum (2).
Argentina would see Amphitheatre (1), Broadcast Tower (1), Cathedral (1), Museum (2), Tanguería (3).

There's basically a bunch of premade 1-slot columns, followed by a few 2-slots, then finally 2 3-slot columns. Columns are assigned left to right to buildings (all of them, including vanilla ones, sorted by tech rank), with unused columns staying hidden. So once it gets to the Opera House/Tangueria, it'll see it uses three slots and pick the leftmost 3-slot column, which is on the far right.

What d'you mean with different column-width patterns? I'm not quite grasping your meaning here.
 
There's basically a bunch of premade 1-slot columns, followed by a few 2-slots, then finally 2 3-slot columns. Columns are assigned left to right to buildings (all of them, including vanilla ones, sorted by tech rank), with unused columns staying hidden. So once it gets to the Opera House/Tangueria, it'll see it uses three slots and pick the leftmost 3-slot column, which is on the far right.

What d'you mean with different column-width patterns? I'm not quite grasping your meaning here.

Never mind ... I didn't realize you are able to hide unused columns.

I still somewhat prefer ordering by tech cost first, but if this is not possible, your solution in v3 should work well for custom GW buildings. It's nice, e.g., to see the Tuscan Duomo displayed right after the Amphitheatre.

However, I'd like to see the city name column (and possibly the culture/tourism columns) reverted to standard behaviour, i.e., with fixed width.
 
Sure, 'twas just a leftover from trying to fit more columns, anyways.
(well that and my personal affection for fluid layouts but everything else in civ5 is fixed so it'd just be distracting)

Aaaand it's up.
 
I did some quick tests using the Steam-released v3. Works great for "standard" civilizations and for the Tuscan Duomo. The Argentina Tanguería is correctly displayed last with three GW columns; however, there's a superfluous Pyramids icon in the top row (which also causes incorrect horizontal alignment of the Museum and Tanguería icons).
 
There's basically a bunch of premade 1-slot columns, followed by a few 2-slots, then finally 2 3-slot columns. Columns are assigned left to right to buildings (all of them, including vanilla ones, sorted by tech rank), with unused columns staying hidden.

Another idea how sorting by tech rank first (and removing my Museum pet peeve) might work: If you wanted to support up to a dozen GW building columns, could you start with one 1-slot, one 2-slot, and one 3-slot column, repeat this pattern eleven times and then use it as basis for displaying the discovered GW buildings? Each building (starting with the lowest-ranking) would use the column appropriate for its GW number, while the other two columns would stay hidden.
 
I did some quick tests using the Steam-released v3. Works great for "standard" civilizations and for the Tuscan Duomo. The Argentina Tanguería is correctly displayed last with three GW columns; however, there's a superfluous Pyramids icon in the top row (which also causes incorrect horizontal alignment of the Museum and Tanguería icons).

Huh. My test game didn't have that, but I was also using Cultural Capitals. It was Argentina alone, right?
E: Damn, I'd forgotten to set those buttons to hide by default. Fixed but not yet deployed.

Another idea how sorting by tech rank first (and removing my Museum pet peeve) might work: If you wanted to support up to a dozen GW building columns, could you start with one 1-slot, one 2-slot, and one 3-slot column, repeat this pattern eleven times and then use it as basis for displaying the discovered GW buildings? Each building (starting with the lowest-ranking) would use the column appropriate for its GW number, while the other two columns would stay hidden.

I think I discarded that idea the first time because it'd wreck compatibility even harder, but with how the code evolved that reason is now moot. Not a bad idea, all in all, beyond the sheer copypasting.
Good thing I know Python.

E2: Alright, uploaded. I sure hope it doesn't have some stupid mistake I left in. Diff doesn't point at anything but can't be sure.
 
Also tested v4, and it seems to be perfect. Tested for "standard" civ, Celts, Assyria (Royal Library is displayed first, great!), Tuscany, Argentina.

A small request for clarification: In your Steam description of v3, you also mention sorting by "id (so mod buildings will go after vanilla buildings)". However, the Tuscan Duomo is displayed between Amphitheatre and Opera House (sorted by tech only) -- quite appropriate IMO. Is that because the Duomo is a modded variant of a standard (but non-GW) building, the Garden, or did you drop sorting by id altogether? (EDIT: According to your updated pictures, the latter.)

Great work! I may add a warning to my "Culture Overview Fix" that one should use your mod instead.
 
Also tested v4, and it seems to be perfect. Tested for "standard" civ, Celts, Assyria (Royal Library is displayed first, great!), Tuscany, Argentina.

A small request for clarification: In your Steam description of v3, you also mention sorting by "id (so mod buildings will go after vanilla buildings)". However, the Tuscan Duomo is displayed between Amphitheatre and Opera House (sorted by tech only) -- quite appropriate IMO. Is that because the Duomo is a modded variant of a standard (but non-GW) building, the Garden, or did you drop sorting by id altogether? (EDIT: According to your updated pictures, the latter.)

Great work! I may add a warning to my "Culture Overview Fix" that one should use your mod instead.

It means if two buildings have the same tech prereq, it'll sort by ID. TechX first, TechY second, ID third. I'll clarify.
 
Bug report: It is not possible to sort cities by city name, culture, tourism, or no. of Great Works (sorting does work for other columns). The bug was introduced in version 3 -- sorting does work for all columns with version 2.
 
Back
Top Bottom