Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#1827 closed defect (fixed)

[PATCH] It's possible to camera-follow enemy units, even into the FoW

Reported by: zoot Owned by: leper
Priority: Must Have Milestone: Alpha 13
Component: Core engine Keywords: patch
Cc: Patch:

Description (last modified by zoot)

Steps to reproduce:

  1. Select an enemy unit.
  2. Press 'F'.

What happens: The camera follows the enemy unit, even after it has passed into the fog of war.

What I expected to happen: The camera should not follow when the selected unit is an enemy.

Attachments (1)

GameView.cpp.patch (1.1 KB ) - added by Maciej Piekarz 11 years ago.

Download all attachments as: .zip

Change History (13)

comment:1 by zoot, 11 years ago

Description: modified (diff)

comment:2 by Erik Johansson, 11 years ago

Imho it should be possible to follow an enemy unit as well as any other unit. I'd most definitely say that you shouldn't be able to follow it after it passes into the Fog-of-War. I'm assuming this should be possible to fix by automatically deselecting any unit which can't be seen, which would apply to more cases than the follow. I'm not going to change this ticket or open a new at the moment though as we'd need to decide whether we want the player to be able to follow enemy units first.

comment:3 by zoot, 11 years ago

Summary: It is possible to camera-follow enemy unitsIt's possible to camera-follow enemy units, even into the FoW

comment:4 by Jonathan Waller, 11 years ago

Priority: Should HaveMust Have

This is more usefully exploitable by setting a control group for the enemy. Double tapping the group number will then follow the unit even in FoW.

comment:5 by Kieran P, 11 years ago

Milestone: BacklogAlpha 13

by Maciej Piekarz, 11 years ago

Attachment: GameView.cpp.patch added

comment:6 by Maciej Piekarz, 11 years ago

Hi guys

I am new to game developement and thought that contributing to 0ad might be a great opportunity to get some experience. I was looking for a simple task to start and I thought I might try to fix this bug.

Also, I think I fixed a little typo in that file.

comment:7 by Maciej Piekarz, 11 years ago

Keywords: review patch added
Summary: It's possible to camera-follow enemy units, even into the FoW[PATCH] It's possible to camera-follow enemy units, even into the FoW

comment:8 by zoot, 11 years ago

Thanks for taking a shot at this. As far as I can tell, your patch only changes behavior of the camera (GameView). It might be a good idea to do what feneur suggested and outright deselect the unit when it exits LoS, since otherwise the player can still peek at its health stats etc. in the unit panel, which also counts as an exploit (albeit a lesser one).

comment:9 by Maciej Piekarz, 11 years ago

Hey zoot, I can't reproduce the but with selecting unit when it exits LoS. When I built the game, I tested following scenarios:

1) Enemy unit is fighting my unit, I target enemy unit. My unit dies and enemy is no longer visible. Result: Enemy unit is no longer selected.

2) Same as 1), but I clicked "F" to follow enemy unit. I also sent 2nd unit earlier to the battle's location. Result: Camera didn't move. When my 2nd unit came, I could see enemy unit in different position, so camera didn't follow it.

3) Same as 1), but I created a group of enemy unit (CTRL+2) Result: After clicking "2" camera didn't move to enemy unit, neither it selected it.

Maybe someone has already fixed that issue?

in reply to:  9 comment:10 by zoot, 11 years ago

Replying to crezax:

Hey zoot, I can't reproduce the but with selecting unit when it exits LoS.

Okay, great :) I was just interpreting the code manually, so I likely just read it incorrectly.

comment:11 by leper, 11 years ago

Owner: set to leper
Resolution: fixed
Status: newclosed

In 13275:

Stop following units into FoW. Patch by crezax. Fixes #1827.

comment:12 by leper, 11 years ago

Keywords: review removed

Thanks for the patch.

Note: See TracTickets for help on using tickets.