Opened 14 years ago

Closed 13 years ago

#573 closed defect (fixed)

Camera does not reach top map border

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

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 (14)

comment:1 by Jay Weisskopf, 14 years ago

Cc: Sergey jayschwa added

comment:2 by Jay Weisskopf, 14 years ago

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 by Sergey, 14 years ago

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.

in reply to:  2 comment:4 by Philip Taylor, 14 years ago

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 by Sergey, 14 years ago

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 by frapell, 14 years ago

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 by Sergey, 14 years ago

Owner: set to Sergey
Status: newassigned

comment:8 by (none), 14 years ago

Milestone: Unclassified

Milestone Unclassified deleted

comment:9 by Andrew, 14 years ago

Milestone: Backlog

comment:10 by fabio, 14 years ago

Milestone: BacklogAlpha 3

comment:11 by Kieran P, 13 years ago

Milestone: Alpha 3Alpha 4

comment:12 by Kieran P, 13 years ago

Owner: Sergey removed
Status: assignednew

comment:13 by Kieran P, 13 years ago

Priority: Nice to HaveIf Time Permits

comment:14 by philip, 13 years ago

Resolution: fixed
Status: newclosed

(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.