Ticket #573 (closed defect: fixed)

Opened 3 years ago

Last modified 2 years ago

Camera does not reach top map border

Reported by: frapell Owned by:
Priority: If Time Permits Milestone: Alpha 4
Component: Core engine Keywords:
Cc: markelov, jayschwa

Description

If you do a full zoom, you're not able to get to the top of the map, you have to zoom out a little. And if you zoom in again, the camera will automatically move back.

I used 'top' here, instead of 'north' because if you rotate the camera, it happens on every border on top.

Change History

comment:1 Changed 3 years ago by Jayschwa

  • Cc markelov, jayschwa added

comment:2 follow-up: ↓ 4 Changed 3 years ago by Jayschwa

Camera pan constraints were added revision [8070] for ticket #554. Anyone who works on this might want to start there. The relevant bit is probably this section of code: http://trac.wildfiregames.com/browser/ps/trunk/source/graphics/GameView.cpp?rev=8070#L684

Intuitively, I thought this could be fixed by just using the current zoom level rather than the default zoom level, but m->Zoom.Get[Smoothed]Value() does something really funky.

comment:3 Changed 3 years ago by markelov

the camera shouldn't reach the very top border. It should reach the margin, which is set to 20.0f for each side. It means that the camera always will be inside the map and a user will always see the map. In the position near a side you should see the edge part of the map without any problems.

comment:4 in reply to: ↑ 2 Changed 3 years ago by Philip

Replying to Jayschwa:

m->Zoom.Get[Smoothed]Value() does something really funky.

The absolute value of m->Zoom is (confusingly) meaningless - only relative changes over time have any significance. (The idea was the camera typically shouldn't move up/down as you scroll over bumpy terrain, so there's no constant distance-from-camera-to-terrain value.)

Since most of our maps have players starting near an edge, and the constraints don't let you zoom in fully on the starting positions, I think it'd be good to tweak the constraints. I don't know exactly what should change, though.

comment:5 Changed 3 years ago by markelov

Since most of our maps have players starting near an edge, and the constraints don't let you zoom in fully on the starting positions, I think it'd be good to tweak the constraints. I don't know exactly what should change, though.

I'll try to play with (zoom level & margin) binding. I think that the more zoom in the lesser margin should be.

comment:6 Changed 3 years ago by frapell

I played around with some diff values for the constraints (if i'm correct, from L677 to L680) but couldn't get nothing.

I think the main problem is treating the margins as a 90º wall, when it should be more like a 30º, 40º, 50º, etc, depending on the camera angle.

What i mean by this, is that min and max margins should be a function that takes camera height and angle, and should return appropriate values.

Anyway, just shooting in the dark here, i'm not too familiar with the code yet :)

comment:7 Changed 3 years ago by markelov

  • Owner set to markelov
  • Status changed from new to assigned

comment:8 Changed 3 years ago by anonymous

  • Milestone Unclassified deleted

Milestone Unclassified deleted

comment:9 Changed 3 years ago by wacko

  • Milestone set to Backlog

comment:10 Changed 3 years ago by fabio

  • Milestone changed from Backlog to Alpha 3

comment:11 Changed 2 years ago by k776

  • Milestone changed from Alpha 3 to Alpha 4

comment:12 Changed 2 years ago by k776

  • Owner markelov deleted
  • Status changed from assigned to new

comment:13 Changed 2 years ago by k776

  • Priority changed from Nice to Have to If Time Permits

comment:14 Changed 2 years ago by philip

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

(In [9011]) Improve camera restraints at edge of map to be independent of zoom, and to work on circular maps. Fixes #573.

Note: See TracTickets for help on using tickets.