Ticket #941 (closed task: fixed)

Opened 21 months ago

Last modified 18 months ago

[PATCH] Experiment with camera FOV

Reported by: Philip Owned by:
Priority: Should Have Milestone: Alpha 8
Component: Core engine Keywords:
Cc:

Description

Extracts from #glest IRC:

15:48 <@softcoder> Philip`, i mentioned this before, people don't like the camera view in 0ad
15:48 <@softcoder> if the camera 'felt more 3d' like in glest I think it would make a lot more people happy
15:50 <@softcoder> A number of people have mentioned to me (When i told them to look at 0ad) its isometric
15:51 < Philip`> softcoder: Maybe it's an issue of having a narrow FOV?
15:51 <@softcoder> i think outs is 45
15:51 < Philip`> Ours is 20 degrees, I believe
15:52  * Philip` has no idea why it's that, other than it being what someone picked about eight years ago and then nobody bothered changing it
15:53 < Swyter> FYI: BFME2 uses a 45º camera

Might be good to try changing CGameView::defaultFOV to see if it can make things look better. (Also, move it into the config file so it's easier to experiment.)

Attachments

FOV-controls-09042011.patch (11.6 KB) - added by historic_bruno 19 months ago.
FOV-improved-11162011.patch (9.0 KB) - added by historic_bruno 19 months ago.

Change History

comment:1 Changed 21 months ago by michael

Agreed. A wider FOV would definitely enhance the 3D feel of the game. 45 degrees is something that I think is standard for 3D games. Something greater than 20 degrees, which is what it is now, would definitely help.

comment:2 Changed 21 months ago by historic_bruno

I played with this a bit, as far as trying a wider FOV and hooking up the config file and some hotkeys (how about Ctrl+MouseWheel and PageUp/Down to increase/decrease the FOV?) Personally I feel the game view is more dramatic at 30-45 degrees. A few bugs I noticed were that the shadows exhibited more obvious "popping" on the edges of the screen and also that the view quad on the minimap got messed up with a higher FOV, I'll look into those.

Changed 19 months ago by historic_bruno

comment:3 Changed 19 months ago by historic_bruno

  • Keywords review added
  • Summary changed from Experiment with camera FOV to [PATCH] Experiment with camera FOV
  • Milestone changed from Backlog to Alpha 8

Attaching patch that implements some FOV controls as previously stated, but needing slightly minimap and shadows fix.

comment:4 Changed 19 months ago by historic_bruno

The interesting thing is that at higher viewing angles, it almost gives a "rounded" feel to the map.

comment:5 Changed 19 months ago by historic_bruno

Example screenshots comparing FOV angles:

That shows what I mean about a more dramatic view with wider FOV. You can see how flat it looks by comparison with narrow FOV. As a side note, I think we would need to adjust zoom behavior especially initial zoom distance, when applying the patch.

comment:6 Changed 19 months ago by michael

45 degrees is ideal and does showcase the 3D nature of the game much better than the original 20 degree FOV. 60 degrees is just too much. This will definitely give Alpha 8+ a newer "look" over previous iterations of the game.

comment:7 Changed 19 months ago by Philip

  • Keywords review removed

From IRC some time ago:

02:00 <@Philip`> I think having controls for changing FOV is bad, because users should never do that, and it's unnecessary complexity just for development purposes (compared to an Engine.SetFOV() in the console or something)

i.e. only add a view.fov in the config file, and don't have all the input stuff in GameView.cpp (since nobody will ever need it). Probably don't even bother with a Engine.SetFOV - it seems we've pretty much agreed on 45 degrees, so we can stick that in the config file and be done.

(This patch might be a good opportunity to move defaultNear and defaultFar into the config file too, for consistency.)

comment:8 Changed 19 months ago by historic_bruno

Thanks, Philip :) I removed the controls, moved default near and far plane distances into default.cfg, and tweaked initial camera zoom/rotation. I tried to keep the view approximately the same with the new 45 degrees FOV as it was with 20 degrees (without the tweaking, it would zoom too far away and you would see too much empty blackness).

The only thing I don't like is using g_Game->GetView()... in certain parts of the renderer, where it sets camera projections. I'm not sure if there's a better way of doing this.

Changed 19 months ago by historic_bruno

comment:9 Changed 19 months ago by historic_bruno

  • Keywords review added

comment:10 Changed 19 months ago by Philip

Looks good :-)

I think the angle limits should be set so that you can't see the horizon (because the sky is ugly, and performance is bad, and it breaks the minimap box, etc). view.rotate.x.min = 28 seems reasonable to me. (It should always be at least > view.fov/2.)

In CRenderer, can you use normalCamera.GetNearPlane() etc instead of g_Game->GetView? (I've not checked that that'll actually work.)

default.cfg should indent comments with spaces, not tabs.

comment:11 Changed 18 months ago by ben

  • Status changed from new to closed
  • Resolution set to fixed

(In [10548]) Moves camera projection settings to default.cfg. Changes field of view (FOV) to 45 degrees per discussion. Fixes #941. Tweaks default camera zoom and rotation accordingly.

comment:12 Changed 18 months ago by historic_bruno

  • Keywords review removed
Note: See TracTickets for help on using tickets.