UI modifications (suggestions and discussion)

Time to display the tech tree is getting rather long (and will only get worse as we add more techs). Should be fairly easy (??? anyone know this code well ???) to add a checkbox to the research screen 'hide distant eras' which would default to 'on' and not bother building the tree for any era more than 2 removed (in either direction) from your current era...?
 
Time to display the tech tree is getting rather long (and will only get worse as we add more techs). Should be fairly easy (??? anyone know this code well ???) to add a checkbox to the research screen 'hide distant eras' which would default to 'on' and not bother building the tree for any era more than 2 removed (in either direction) from your current era...?
The problem with the code that generates the tech tree is that it is doing its job in a very inefficient way (a lot of looping through all kind of long lists like unit types). There is a LOT of potential to make that faster without cutting off a part of the tech.
 
The problem with the code that generates the tech tree is that it is doing its job in a very inefficient way (a lot of looping through all kind of long lists like unit types). There is a LOT of potential to make that faster without cutting off a part of the tech.
To give more details, the code suffers from the same problem that a lot of other code parts suffer: A lot of information can only be accessed efficiently from one side, not both sides of the connection. Many info XMLs have a tech requirement defined, but to find out what a specific tech enables, you have to loop through all units, buildings and the like. That is expensive.
The tech chooser loops through all techs and then for each of them loops through a lot of other objects to find out which pictures it should display below the tech.
The worst culprits were the unit types and building types but I have already improved them some time ago by looping through them once to fill a cache for efficient inverse lookup of the information that the tech displays need.
Now there are a lot of loops in there still and the same caching strategy could be applied which should improve the runtime a lot (there are over 40 types of the information that the tech chooser gathers but luckily a lot of them are not loops).
 
@AIAndy- This is just a thought, I'm not obviously not familiar with the code so there may be a reason this isn't done. For techs, couldn't you make each tech an instance of a tech class and make the unit images building images and so forth part of that object? That way when the tech is initialized you have all the info you need, and from there just access the information on the object.
I imagine caches would basically do the same thing but I'd like your opinion to learn better what is going on in the background.
 
@AIAndy- This is just a thought, I'm not obviously not familiar with the code so there may be a reason this isn't done. For techs, couldn't you make each tech an instance of a tech class and make the unit images building images and so forth part of that object? That way when the tech is initialized you have all the info you need, and from there just access the information on the object.
I imagine caches would basically do the same thing but I'd like your opinion to learn better what is going on in the background.
Each tech is an instance of CvTechInfo and each building is an instance of CvBuildingInfo. If I want to know, which tech prereq a building has, I look that up in the CvBuildingInfo instance of that building. Unfortunately, that information is not doubled into CvTechInfo, so if I want to know which buildings have a certain tech as prereq, I cannot look that up in CvTechInfo, I have to check all instances of CvBuildingInfo (and that are over 1800).
Currently I collect that for a cache before rendering the tech screen and delete it afterwards. But if you want to add all the reverse lookup information to the info classes themselves, be my guest, it is well worth the memory and will make quite some code considerably faster.
 
This is the problem with having the internal data model the same as the storage data model. In Civ's case the need to edit means that the storage is in XML. I wondered what the data model was like internally but from looking at the coding it is the same. I suppose it does make it easier for modders since they only have to content with one data model.
 
I am not sure I get what you mean. The units/building filters are split in the first place and you switch between them with the buttons to the right of the building list.
And yes, they are not saved in the savegame currently though that is definitely something I can add.

I mean the leftmost button in the filter list on top of the units/buildings. If I acces a city from the map that button hides unavailable buildings. In the city screen it does so for units.
Sometimes after I load a game it is only hiding unavialable units , no matter if I am on the map or in the city screen. Then after using it on a few cities it works like I said above again.
And while it is managable for buildings mostly, the unfiltered list of units tends to become realy long as you advance in techs.
 
I mean the leftmost button in the filter list on top of the units/buildings. If I acces a city from the map that button hides unavailable buildings. In the city screen it does so for units.
Sometimes after I load a game it is only hiding unavialable units , no matter if I am on the map or in the city screen. Then after using it on a few cities it works like I said above again.
And while it is managable for buildings mostly, the unfiltered list of units tends to become realy long as you advance in techs.
Have you tried the three buttons to the right of the units/buildings?
They should allow you to switch between units and buildings.
You can also set the default for the hiding of unavailable buildings/units in BUG (the setting there is only applied when you reload though).
 
I did find out that the right side buttons that jump the list between buildings and units also changes the function of the hide unavailable X button.

So the UI is fine in the end. But maybe someone should make a guide in the long run, because like that many things are not obvious. Most of them you can deduct by lookign carefully ( like crime rating display when hovering over a tile, or the wonder counter in the city screen), but looking at my own experience and some forum questions I´ve seen of others a little help fo new players might be nice.
 
While fixing an abandon building bug I stumbled upon why the city UI get very slow when you make certain changes. Basically whenever anything changes in a city (AI or human) that could effect the optimal placement of worked plots, then that city will recalculate and if necessary change what is being worked (this is why it happens automatically for the human player). In the later game, when many factors are involved, this becomes a time consuming process.

What I am thinking of doing is limitting this auto-setting of worked plots to happen only at the start of each turn, so changes within a turn (apart from a few that make a previosuly worked plot unworkable) don't cause recaclualtion for each such change (after all there could be many such in one turn). For the AI this is just efficiency, and wouldn't have any functional impact. For the human player it would mean that you would need to adjust your worked plots manually if you wanted to change them in response to something you have adjusted mid-turn (leaving them unadjusted would cause the auto-adjustment to kick in at the start of the following turn).

Opinions...?
 
The human player can still trigger a recalculation by deactivating and then activating the citizen manager I assume.
 
Is it possible to change the color of researched technologies in the F6 display? I'd like to change researched techs to black so it is very easy to pick them out.
 
One more suggestion: if you have a Wonder that is civic-linked (like I have with Alamut and Field of the Cloth of Gold, and also Statue of Liberty) and you switch away from the civic that allows the Wonder, the Wonder disappears from the city screen and the F8 Wonders screen. Would it be possible to show them even if their effects are disabled? Even if it's only the F8 screen, that would be really nice.
 
Would it be possible to cut back the volume on the promotion selection when used on a stack? I know there's a volume control for all effects, but if I turn it down far enough to save my eardrums from the promotion drums, combat is nigh silent.
 
1 Sort units and buildings alphabet order like they are in screen that shows after city finish to build something kpop up city screen)

2 add filters options to pop up city screen. Maybe only the most comon used :food: :production: :commerce:

Is it possible. This will make city managment more easy
 
1 Sort units and buildings alphabet order like they are in screen that shows after city finish to build something kpop up city screen)

2 add filters options to pop up city screen. Maybe only the most comon used :food: :production: :commerce:

Is it possible. This will make city managment more easy



You can already do that. The filters are right above the unit/building choices at the bottom. The 2nd toggle menu can be set to different settings such as Cost, Name, Strength, etc. On the far left show a range of icons that do different filters. My favorite is the NO symbol that shows only trainable units/buildings.
 
Would it be possible to cut back the volume on the promotion selection when used on a stack? I know there's a volume control for all effects, but if I turn it down far enough to save my eardrums from the promotion drums, combat is nigh silent.

Hah yeah, promoting a large stack can be... an earful. :lol:

I play with maximized windowed mode (so it's like fullscreen, no window edges, except alt-tab is instant, great for browsing sites etc. when I'm waiting for AI to complete its turn) and I've resorted to just lowering the system volume momentarily those few times I have to promote a stack.
 
Thank You Hydro :)

What about second part of my post. Adding filters to this productian pop up window that shows up when city just finish build something. There is no filter options i think.
 
Thank You Hydro :)

What about second part of my post. Adding filters to this productian pop up window that shows up when city just finish build something. There is no filter options i think.

True, but if you keep adding to your queue then you will hardly see that menu. And with multiple production setting on its within your interest to have a bunch of buildings/units lined up to build.

You also can pick something at random on the popup and then go to the city and use the filters to pick what you really wanted.
 
Top Bottom