• Our friends from AlphaCentauri2.info are in need of technical assistance. If you have experience with the LAMP stack and some hours to spare, please help them out and post here.

UI class? Changing max/min zoom?

JaceTwice

Chieftain
Joined
Oct 25, 2016
Messages
11
I want to increase the amount you can zoom in and out on the map but the file that hold those limits is beyond me. I've done a few of the simple edits that are floating around to create new WSAD scrolling hotkeys and mess with the camera rotation that's all done in WorldInput.lua but aside from zoom speed and how it ties to the actual scrollwheel there's not a lot I can seem to do in there.

There are however a lot of calls to some UI class that I'm guessing has the functionality I'm looking for. For example:
UI.SetMapZoom();
UI.GetMapZoom();
UI.GetCursorPlotID();
UI.GetCursorPlotCoord();
UI.PlaySound();

Does anyone have any idea where this mythical class is? Or even what functions and members inside of it are available for use?
 
Last edited:
This was also bothering me.

The UI class isn't mythical, it's just in the graphics engine (they couldn't have written the whole game in Lua!). Which means we don't have access to it, and likely never will, even when/if they release the source for the game DLL.

Civ5 had a config.ini entry for Min Zoom (though unfortunately not Max).

UserOptions.txt is the only config file with references to zoom, but those are only for--though this is kind of cool--the settings for how much and whether to zoom in to combats (with different entries for whether it's your turn or not). So unless there's a hidden configuration entry, we might be out of luck. :sad:
 
Well darn. I was fearing it might be hidden away in the engine somewhere.

I admit I'm still curious about what functions are available in it so I might root around for that sort of stuff at least. Thinking aloud: it might be worth checking for references to wonders since the camera gets quite close in during those little completion movies.
 
Ooh, heinous_hat discovered this in the FireTuner console!
In the console, type camera config DebugCamera . That allows zoom below the default minimum.

Type camera listconfigs for a list of alternates. There isn't really anything else useful there, but it does suggest we may be able to write our own camera configurations, provided that these are accessible. The crazy config allows for maximum zoom out... which is way too far... but it would be nice to make a custom configuration that allowed something further than default.

help camera for a full command list
 
Ooh, heinous_hat discovered this in the FireTuner console!

It's actually accessible from the debug console (~ key). You have to enable it in AppOptions.txt.


edit: You can use the existing 'crazy' config to zoom out to maximum distance, but you get rendering problems after a certain point. Haven't found any loose config files to play with or discover their format. I would guess that they're either packed up or compiled.

edit: On my machine, you can zoom out to 1121 world units (whatever those are) before things get funky.
 
Last edited:
Fantastic! The debug camera is almost exactly what I was looking for. Getting a good close up on the art is a lot of fun.

Spoiler :

xPt2wcC.jpg

FPUK7Uf.jpg



There's also a free camera in there that's a little finicky to use. Arrow keys to pan around. Left mouse to move foward, right mouse to move back and holding the right Ctrl key while moving the mouse to rotate the camera.

I've had it crash the game but there's some nice potential in there for looking around the map.

Spoiler :

NFOPE5H.jpg

pbmXh6z.jpg



Now if I could just figure out how to toggle the UI...

Interstingly, the LOD on the terrain does not seem tied to camera distance from the ground. Moving the freecam into certain positions that have a lot of tiles in view will trigger lower detail models to appear even if you're 20 feet from the terrain.
 
I've hooked up hotkeys to toggle city banners and unit icons. You should be able to do the same with worldView, topPanel, etc... have to give it a try.

There is also a command in the console... toggle interface, but you lose mouse and keyboard input relative to the map.
 
Fantastic! The debug camera is almost exactly what I was looking for. Getting a good close up on the art is a lot of fun.

Spoiler :

xPt2wcC.jpg

FPUK7Uf.jpg



There's also a free camera in there that's a little finicky to use. Arrow keys to pan around. Left mouse to move foward, right mouse to move back and holding the right Ctrl key while moving the mouse to rotate the camera.

I've had it crash the game but there's some nice potential in there for looking around the map.

Spoiler :

NFOPE5H.jpg

pbmXh6z.jpg



Now if I could just figure out how to toggle the UI...

Interstingly, the LOD on the terrain does not seem tied to camera distance from the ground. Moving the freecam into certain positions that have a lot of tiles in view will trigger lower detail models to appear even if you're 20 feet from the terrain.

I got the DebugCamera to enable, but I notice no change, are the controls modified? Can't zoom in any more or differently than what I was with default.

Edit:
Camera1, Camera2 and Camera3 all have different max zoom configurations. Wonder where these configs are hiding?
 
Last edited:
Does that include the DEFAULT camera?

Changing values in DEFAULT_CAMERA had no effect, but changing values in "Cameras" did. It appears as though the maximum zoom level is controlled by HeightCurve, or more specifically the variable tied to height:

<m_CollectionName text="HeightCurve"/>
<Element>
<m_Fields>
<m_Values>
<Element class="AssetObjects::FloatValue">
<m_fValue>100.000000</m_fValue>
<m_ParamName text="Time"/>
<Element class="AssetObjects::FloatValue">
<m_fValue>600.000000</m_fValue>
<m_ParamName text="Height"/>
</Element>
</m_Values>
</m_Fields>
<m_ChildCollections/>
<m_Name text="HeightCurve2"/>
</Element>

Changing this value to 35.000000 results in a much higher maximum zoom-in level, however doing so also adversely impacts the maximum zoom out value, which is tied to HeightCurve1:

<Element>
<m_Fields>
<m_Values>
<Element class="AssetObjects::FloatValue">
<m_fValue>0.000000</m_fValue>
<m_ParamName text="Time"/>
</Element>
<Element class="AssetObjects::FloatValue">
<m_fValue>120.000000</m_fValue>
<m_ParamName text="Height"/>
</Element>
</m_Values>
</m_Fields>
<m_ChildCollections/>
<m_Name text="HeightCurve1"/>
</Element>

Increasing that value appears to allow for increased zoom out.

I haven't nailed down exactly how the time variables work, nor have I yet solved the mystery of how tiltvurve1 and tiltcurve2 tilt, but I can guess their functions.
 
Last edited:
Here's my camera.artdef, under "cameras" (not "DEFAULT_CAMERA" which isn't the default, apparently) with:
  • More zoom out (heightcurve)
  • More vertical tiltcurve; less will cause yellow hexes and z-buffering--overlapping polygon flickering--which does happen when fully zoomed out and alt-rotating the camera (but who actually uses this stupid implementation anyway?) and when in tile buy mode or when choosing a tile to build a wonder/district on
  • Less tiltcurve1
  • More zoom in (heightcurve2, I think)
  • No fog_density (since it only goes away when zoomed in close)
I believe that's all I changed but I didn't make a backup (oops) to compare.
 

Attachments

Last edited:
Nice find. Strange place to put those, but whatever :)

-which does happen when alt-rotating the camera but who actually uses this stupid implementation anyway?)

I do! :shifty:. If you use an external mouse utility, you can replicate <alt> with <left button> + <right button> while blocking the original input. It's also useful to disable the camera snap so you can leave the view where you want it. Then you can spin, zoom and pan the map with one hand.

Definitely something that should be directly implemented, but I'm happy.
 
Ok, I think I have got it figured out, though I may have mixed a couple up. If so please let me know so I can update the post.

"HeightCurve" is the CollectionName for all variables relating to height, of which there are 4.

"HeightCurve2" is the subcollection category for the two variables that control camera transition speed and maximum distance when zooming out.

The two variables are:
"Time" - appears to control transition speed and smoothness. 0 is slowest and the higher the variable the quicker and less smooth the transition. The default value is 100.000000.
"Height" - appears to control the maximum distance away from focal point. The default value is 600.000000.

"HeightCurve1" is the subcollection category for the two variables that control camera transition speed and maximum distance when zooming in.

The two variables are:
"Time" - appears to control transition speed and smoothness. 0 is slowest and the higher the variable the quicker and less smooth the transition. The default value is 0.000000.
"Height" - appears to control the maximum zoom level to focal point. The default value is 120.000000.

"TiltCurve" is the CollectionName for all variables relating to pitch, of which there are 4.

"TiltCurve1" appears to be the subcollection category for the two variables that control camera transition speed and maximum distance when zooming out.

The two variables are:
"Time" - appears to control transition speed and smoothness. 0 is slowest and the higher the variable the quicker and less smooth the transition. The default value is 100.000000.
"Tilt" - appears to control the pitch, with lower values pitching down and higher values pitching up, in accordance with the six degrees of freedom. The default value is 45.000000.

"TiltCurve2" appears to be the subcollection category for the two variables that control camera transition speed and maximum distance when zooming in.

The two variables are:
"Time" - appears to control transition speed and smoothness. 0 is slowest and the higher the variable the quicker and less smooth the transition. The default value is 0.000000.
"Tilt" - appears to control the pitch, with lower values pitching down and higher values pitching up, in accordance with the six degrees of freedom. The default value is 55.000000.

Pitch can affect clipping if zoomed too far in, and visa versa. I'll release my preset with screenshots tonight.
 
12@!n submitted a new resource:

KinetiKam - A custom camera presert for Civ VI

aMrwkWi.jpg


INTRODUCTION AND INFO

Tired of the limitations of the default camera? Wanting to zoom in an all the detailed glory of your neighbor's capital right before you nuke it? If so, this mod is for you.

WHAT DOES THIS MOD DO?

This mod is simply a Camera.artdef with a few values tweaked to allow the user to zoom in closer and zoom out further. It also adjusts the pitch of the camera when zoomed in and out. This file...

Read more about this resource...
 
Just wanted to thank all of you, great finds on this stuff. I credited and linked to all of you in KinetiKam and linked to Eep's preset as well.

Cheers.

12@!n
 
Ok, I think I have got it figured out, though I may have mixed a couple up. If so please let me know so I can update the post.

"HeightCurve" is the CollectionName for all variables relating to height, of which there are 4.

"HeightCurve2" is the subcollection category for the two variables that control camera transition speed and maximum distance when zooming out.

The two variables are:
"Time" - appears to control transition speed and smoothness. 0 is slowest and the higher the variable the quicker and less smooth the transition. The default value is 100.000000.
"Height" - appears to control the maximum distance away from focal point. The default value is 600.000000.

"HeightCurve1" is the subcollection category for the two variables that control camera transition speed and maximum distance when zooming in.

The two variables are:
"Time" - appears to control transition speed and smoothness. 0 is slowest and the higher the variable the quicker and less smooth the transition. The default value is 0.000000.
"Height" - appears to control the maximum zoom level to focal point. The default value is 120.000000.

"TiltCurve" is the CollectionName for all variables relating to pitch, of which there are 4.

"TiltCurve1" appears to be the subcollection category for the two variables that control camera transition speed and maximum distance when zooming out.

The two variables are:
"Time" - appears to control transition speed and smoothness. 0 is slowest and the higher the variable the quicker and less smooth the transition. The default value is 100.000000.
"Tilt" - appears to control the pitch, with lower values pitching down and higher values pitching up, in accordance with the six degrees of freedom. The default value is 45.000000.

"TiltCurve2" appears to be the subcollection category for the two variables that control camera transition speed and maximum distance when zooming in.

The two variables are:
"Time" - appears to control transition speed and smoothness. 0 is slowest and the higher the variable the quicker and less smooth the transition. The default value is 0.000000.
"Tilt" - appears to control the pitch, with lower values pitching down and higher values pitching up, in accordance with the six degrees of freedom. The default value is 55.000000.

Pitch can affect clipping if zoomed too far in, and visa versa. I'll release my preset with screenshots tonight.

Ooooh this is fantastic. Excellent work everyone! Who knew the key to this would be hiding away in an artdef? Makes me wonder what else is in those things.

Glad to see there's so many controls available. I was actually going to implement this implement this pitch functionality myself but I guess now I don't have to since it's so nicely packed up here already.
 
Nice find. Strange place to put those, but whatever :)



I do! :shifty:. If you use an external mouse utility, you can replicate <alt> with <left button> + <right button> while blocking the original input. It's also useful to disable the camera snap so you can leave the view where you want it. Then you can spin, zoom and pan the map with one hand.


Definitely something that should be directly implemented, but I'm happy.

Heinous can you send me a PM on how to do this?

I know how to pan the camera but the snap back is annoying. I have an 'MMO' mouse with 10 side buttons for MMO's so mapping stuff should be easy.
 
Back
Top Bottom