We-the-People-civ4col-mod / Mod

This is the repository where the mod resides.
86 stars 36 forks source link

Missing City Screen plots in widescreen Resolution #269

Open jlchamberlain85 opened 4 years ago

jlchamberlain85 commented 4 years ago

First off - this mod is awesome - ive been hooked on this series since the original col

I've seen this issue posted in a few forms before, but didn't see a fix. Running at 2560x1080 the outer plots on the city screen are missing - looks like that window is scaling wrong - rest of the city screen is fine. Is there a fix for this? Anything I can edit manually?

screengrab

Nightinggale commented 4 years ago

Thanks for reporting this. We will clearly have to make a proper fix for this.

For a quick fix, you can edit Assets\XML\GlobalDefinesAlt.xml (restarting the game is needed after editing)

    <Define>
        <DefineName>CAMERA_CITY_ZOOM_IN_DISTANCE_TWO_PLOT</DefineName>
        <fDefineFloatVal>5650</fDefineFloatVal>
    </Define>

You can play around with the numbers until you find one, which you think suits your setup. Please report the number here for others to use and perhaps aid in the proper fix.

jlchamberlain85 commented 4 years ago

Thanks. The max I can take it out to without the globe shifting out is 6150, which is better (See Screen grab). Is there a separate variable that defines when the globe switches to over the weather zoomed out mode? (and thus loss of detail) Camera Zity Zoom at 6150 with 2560x1080 res

Nightinggale commented 4 years ago

The globe settings are set in Assets\XML\Misc\CIV4DetailManager.xml.

I played around with DF_SKY, DF_GLOBE_TERRAIN and DF_GLOBE_MORPH and at least one of them does something correctly like high numbers disable the globe view. The question is which one and what the correct number should be. I honestly have no idea and can't recommend anything other than trial and error. Back up your file first though, just in case it breaks completely.

jlchamberlain85 commented 4 years ago

Thanks - that's super helpful. Will play around and report back.

Nightinggale commented 4 years ago

I found the problem. The game assumes 4:3 resolutions. This means it scales as intended when using say 1600x1200. For this reason it assumes that half the screen in width is 3/4 of the screen in height, hence using those two numbers will make a square.

Using 16:9 breaks this, which is why they look bad. Some resolutions are worse than others. Going all the way to 21:9 seems to break most screens. For instance the Europe screen the "next in line" units will be standing in the water because the pier they should be standing on is behind the yield bar. In other screens columns are much wider than intended. There seem to be a number of those issues, though none of them are major.

The colony screen however looks awful. You can however assign units to each plot, meaning it doesn't take away functionality. It just looks bad and is likely annoying if used for extended periods of time.

Right now both 1 and 2 plot code and the code for all resolutions are actually kind of the same. This means fixing one resolution can break another, something which is horrible in regards to making a quick fix. What should really be done would be to clean up the code and allow the relative size of each screen element to depend on resolution rather than always fixed. Doing something like that would however require #311 to be done first or it will be really messy and potentially buggy.

I don't have 21:9 resolutions in my menu. I can however get them in window mode if I type them manually. Are there other 21:9 resolutions, which should be supported other than 2560x1080?

Nightinggale commented 4 years ago

I managed to get the plots to display correctly. As expected the culprit is CvMainInterface.py. Set CITY_VIEW_BOX_PERCENT_HEIGHT to 47 and subtract 0.05 from y in updateCityScreen will make the plots align perfectly with the window.

However that will increase the area of the screen used for the plots, meaning something else has to be reduced in size. By default that's the build queue, which will actually vanish entirely. For obvious reasons that's not acceptable either. There is code to compensate for different aspect ratios, but it doesn't seem to work as intended.

The entire screen is designed on a flawed concept. The width of everything are set as percentage of the entire screen meaning each box on the screen will be ultra widescreen if that's the resolution. Each building sprite will be stretched to match etc. Rather than stretching everything, we should consider what to "stretch" and how. Maybe set the icon size based on height rather than width, meaning widescreen will not have giant build icons, but rather more icons in each row.

I think the only proper solution is to figure out where in the code it is decided which box goes where and then change it according to resolution/aspect ratio. In 21:9 we can easily make the buildings panel much narrower. This should allow us to move the garrison/transport panel to be flipped and moved to the left. This in turn will make the building queue move downwards, which makes room for the plots to increase in size.

SetGlobals is apparently called when changing resolution, meaning we can use this location to resize and move stuff around according to the resolution. It's possible we need a layout for 4:3, 16:9 and 21:9 in order to make them look good in all resolutions. In fact it can't be ruled out entirely that we need a system where we can enter resolution specific offsets to adjust for imperfections in a generic calculation.

codrinbucur commented 4 years ago

I also love this mod. Thank you for all the great work!

But I am also using 2560x1080 and running into button misalignment especially in the city screen and Europe screen. The buttons for citizens automation, buying the building or for the trade are many times impossible to click. You need to find a very small area next to them where the click is recognized or you need to re-enter the city screen several times until you can click.

On the campaign map, there are similar "misalignment" when you have large units like the Continental Guard or a Fishing Boat already fishing. It is sometimes impossible to access the adjacent tiles/units.

Other than that, 95% of the mod/game/graphics looks great at 2560x1080.

If you could find a way to test and fix these misalignments, it would be amazing

Thanks!

Nightinggale commented 4 years ago

What's wrong with the Europe screen?

As for the colony screen, it is a known issue, but sadly it's the hardest screen to mod. It is however planned.

codrinbucur commented 4 years ago

The Europe screen is stretched but not big deal. One issue is that the buttons for selling ship load overlap with the 4 colonists available and you end up purchasing colonists by mistake instead of selling goods. There were a few other glitches. Need to check and get back. The colony screen is much more problematic though

johan-buret commented 8 months ago

SetGlobals is apparently called when changing resolution, meaning we can use this location to resize and move stuff around according to the resolution. It's possible we need a layout for 4:3, 16:9 and 21:9 in order to make them look good in all resolutions. In fact it can't be ruled out entirely that we need a system where we can enter resolution specific offsets to adjust for imperfections in a generic calculation.

I confirm this.