#3168 closed enhancement (fixed)
[PATCH] Let observer change perspective
Reported by: | elexis | Owned by: | elexis |
---|---|---|---|
Priority: | Should Have | Milestone: | Alpha 20 |
Component: | UI & Simulation | Keywords: | patch |
Cc: | Patch: |
Description
Observers should be able to change the perspective, just like the function in the developers overlay. This way they can experience the game from one players perspective and see their fog of war.
This function is also required by the visual replay of games #9, since the program will be in observer mode then and we want to change the perspective when replaying games too.
Attachments (5)
Change History (27)
comment:1 by , 9 years ago
Milestone: | Alpha 19 → Backlog |
---|
comment:2 by , 9 years ago
I think the easiest way to go is to make the dropdown list of the change-perspective tool accessible to observers too, but to make sure that all commands are disabled, unless the change-perspective option in the developers overlay is enabled.
by , 9 years ago
Attachment: | t3168_let_observer_change_perspective_wip1.patch added |
---|
Reuses the "change perspective" dropdown list. Works for the top panel (resources, population count, civ icon), trade & diplomacy window and updates the hero & tech research overlay. TODO: (1) Line-of-sight (How to handle SetCurrentDisplayedPlayer? in SimContext??) (2) How to clean GuiInterface? calls ('differentPlayer')? (3) Probably in another ticket implement TODO in menu.js L643, so that one can see researched techs in the ingame tech tree.
comment:3 by , 9 years ago
Keywords: | patch added |
---|---|
Milestone: | Backlog → Alpha 20 |
Owner: | set to |
Status: | new → assigned |
Summary: | Let observer change perspective → [PATCH] Let observer change perspective |
The patch should be split into multiple commits, starting with a partial, rebased and cleaned version of the pach above.
comment:4 by , 9 years ago
Sometimes one wants to compare two specific players throughout the whole game. However selecting the correct item from the dropdown becomes annoying quickly.
A hotkey with which you could switch back the perspective to the previously selected player would be nice.
comment:5 by , 9 years ago
Actually it should not switch back, it should just switch. In general games at most, you'll have to press the hotkey three times or more, which shouldn't be that much trouble.
by , 9 years ago
Attachment: | t3168_let_observer_change_perspective_wip1.1.patch added |
---|
Rebased. Has a bug when starting as a player and then changing perspective to observer. Still doesn't change fog-of-war.
by , 9 years ago
Attachment: | t3168_preparative_cleanup_v1.patch added |
---|
This should be committed separately.
by , 8 years ago
Attachment: | t3168_let_observer_change_perspective_v1.patch added |
---|
comment:6 by , 8 years ago
Keywords: | review added |
---|
Changing the fog-of-war requires C++ changes, to be done afterwards. If I don't get any complaints, the commit message will be:
Let observers change perspective.
Disable the controls for observers unless the developer-option is enabled. Don't check for g_IsObserver, since observers should be able to use the developer overlay as well. Update all GUI elements when changing the perspective using onSimulationUpdate(). Enable observermode for defeated players.
comment:8 by , 8 years ago
Keywords: | review removed |
---|
Thanks mimo for doing a brief review on satuday.
The ticket is not completely finished since some more things like entity selection and some GUIInterface calls also need to be updated to fully support the dropdown for observers.
by , 8 years ago
Attachment: | t3168_fog_of_war_v1.patch added |
---|
Updates the fog of war if the observer changes the viewed player. This means the SimContext
must be non-const since that class holds the globals checked by the components.
comment:10 by , 8 years ago
Keywords: | review added |
---|
Remaining TODO for this ticket:
- Fog of war changes (see patch above)
- Remove the
player
argument fromGUIInterfaceCall
, since that's mostly unused now
comment:13 by , 8 years ago
Keywords: | review removed |
---|
comment:16 by , 8 years ago
When an observer changes perspective, the selection and health bars also need to be updated.
PickNonGaiaEntitiesOnScreen
(or a called function) needs to remove entities which are not visible in the fog of war of the selected player, if the current playerID is different from the viewed player.
It might be nice to do so for observers, but doing so without ensuring that observers can't send messages on behalf of the player they switched to is required.