Field of View

ruff_hi

Live 4ever! Or die trying
Joined
Oct 24, 2005
Messages
9,135
Location
an Aussie in Boston
The HOF mod contains the ability to change the field of view (FoV) constant. Effectively, you can set the standard zoom either higher or lower. I always thought this was a DLL addition but I have now found that it is also available via python. I've added a drop down to set the field of view value (the default game value is 42). The higher the number, the more you can see - the lower the number, the less you can see.

The only downside is that the value you select is also used for when you bring up the city view. I've put in code to default the FoV back to 42 but it doesn't take when you open a city. The work around is to flip to the next city (left or right arrow) and then back again.

I'm working on getting it to work without this work around.

These screenies are taken with the value set at 95.


 
Hey - EF, I want to load up dropdown options of 10 to 90 in steps of 1 ... do I really need to fill in the xml values ...

values="10, 11, 12, 13, ..., 88, 89, 90"

... or can we change this so that it has the following:

min="10", max="90", step="1"
 
Hey - EF, I want to load up dropdown options of 10 to 90 in steps of 1

I would like to add this ability, but would you rather have a slider? It looks like adding sliders shouldn't be too tough.
 
I thought about a slider but they would take up a fair amount of screen real estate.
 
I'd prefer an on-screen slider (perhaps as an option.) It wouldn't be all that much room (small icon like a globe, the +, the -, and a 2-digit number) but I do tend to frequent the higher resolutions. What about in the upper right under the advisor buttons (mirror of commerce slider)?
 
we now have an on screen slider (top left) that changes the field of view (main screen only) but still suffers from the 'delay' when bringing up the city screen. Included an option to not show the Field of View slider.

Not sure I like its current location.
 
42 may be the answer to the ultimate question of life, the universe, and everything... but BTS isn't impressed....

Code:
Traceback (most recent call last):

  File "CvScreensInterface", line 947, in forceScreenRedraw

  File "CvMainInterface", line 3000, in redraw

  File "CvMainInterface", line 3364, in updateMiscButtons

  File "BugOptions", line 483, in get

  File "BugOptions", line 584, in getValue

  File "BugOptions", line 1024, in getRealValue

  File "BugOptions", line 335, in getBoolean

  File "configobj", line 804, in as_bool

ValueError: Value "42" is neither True nor False
ERR: Python function forceScreenRedraw failed, module CvScreensInterface

I got several of those when loading a save after updating to revision 1465 and as a result, only half the interface came up
 
Ok, that was apparently an INI remnant of the previous version. After removing the old "Field of View = 42" from my INI it became happy. I like the operation of the slider, but you're right about the placement. If it stays in that general area, I'd prefer it be much closer to the right edge.
 
I tried to have it running all the way to the edge but the right section got chopped off. It might have something to do with the length of the slider. I will try and move it around. The other option was just above (or below) the science / culture / spy sliders.
 
Changing from iX = xResolution - 277 to iX = xResolution - 120 looks pretty good. It looks like you can move beyond the right edge of the slider in either case.

1224474752.jpg


1224474737.jpg


Other random thoughts:

Can we make label show the numerical value (e.g. "Field of View (42)")? Or is that overkill?

Near the culture sliders is interesting but I don't know how well they fit together.

Is the slider value itself saved in the options or just the fact that we want to use it? I'd prefer to not have to reset it everytime I start civ.

While the current behavior that turning the FoV option off causes a reset to 42 makes some sense, it might also be nice to be able to simply hide the slider once you've set it to your liking and/or a way to reset the slider itself back to 42.
 
Changing from iX = xResolution - 277 to iX = xResolution - 120 looks pretty good. It looks like you can move beyond the right edge of the slider in either case.
Good work - lets go with 120. No idea re moving slider beyond the end.

Can we make label show the numerical value (e.g. "Field of View (42)")? Or is that overkill?
ha - was just thinking about that in the shower not 5 minutes ago. However, I was thinking of ... 'Field of View [42]'. Also, that 'Field of View' is hard coded at present - will be converting that to an XML lookup shortly.

Is the slider value itself saved in the options or just the fact that we want to use it? I'd prefer to not have to reset it everytime I start civ.
Noted. Guess we can save the value in the options file.

While the current behavior that turning the FoV option off causes a reset to 42 makes some sense, it might also be nice to be able to simply hide the slider once you've set it to your liking and/or a way to reset the slider itself back to 42.
That would involve another option and I am pretty sure that it could get confusing. It doesn't take up much real estate - lets leave it for the moment and see if we get some complains.
 
Ok - I am done with this. Added the 'remember' option to remember the FoV value. Well, couldn't get it to work. Oh well - someone else can tidy up after me :D

Couldn't fix the city view non default FoV either - any takers on fixing my mess?
 
The field of view slider is nice, but the problem in my mod is, that there is already a slider on the maininterface and "your" slider overrides the values of "my" slider.
So I'd prefer the choice between a slider on screen and a dropdown or slider in a tab.
 
I'll take a look when I get a chance, but no promises. :p I am confident that we can get the remember option to work but not so much on the initial city view.
I tested a few things last night and now FoV is being remembered. Did you do this Dresden - if so, how?
 
I haven't been able to look into it yet (too much ahead of it in my queue) so I haven't made any changes. For me it has been loading and using the INI value if you change it manually, but it seems it doesn't always set the INI value after you change the FoV in-game. Is there some function we have to call to explicitly save the INI after using a set__() function?
 
Is there some function we have to call to explicitly save the INI after using a set__() function?

Yes, you have to call BugOptions.write() to save any changed values. I made it so each set() call didn't write() so that I could eventually add a "Revert" or "Cancel" button on the BOS. The BOS calls write() when you click "Exit" right now from its close() method.

The reason it works for you, Ruff, is probably because you opened the BOS after setting the value on the on-screen slider. It writes all current option values when closing whether or not you have changed any via the screen itself.

One thing I could do is write all options during some game event. It's not all that expensive to call write() since each INI file keeps track of a dirty bit that gets set any time an option value changes.

I also still need to add buttons for reverting to defaults to the BOS. I've been a little distracted this week (taking a break with a new game), but I'm 50% through it according to the saved game screen, so it won't be long before I toss it aside. ;)
 
The reason it works for you, Ruff, is probably because you opened the BOS after setting the value on the on-screen slider. It writes all current option values when closing whether or not you have changed any via the screen itself.
That must be it. I am 'setting' the value each time it is changed by the slider - probably overkill to write the options then.

I should change the hover on the 'remember FoV' option it include a comment such as 'current value only remembered when you exit the BUG Option screen'.
 
Before you do that, let me think of a good event where I can write the options. Maybe I can do it in the update() function which is called every quarter second. It won't be noticeable to the user, but it will minimize the chance they'll exit before it saves.

If I do this, I can also change the two PLE view/mode options to work the same way: instead of choosing "default" values, you just change the view/mode on-screen and that gets saved. I will leave the options in the BOS as well as the hovers explain all the choices.
 
in that case - why not write at the end of the player turn. Sure - not 100% fool proof, but pretty close.
 
Back
Top Bottom