Opened 9 years ago

Closed 3 years ago

#3381 closed defect (fixed)

Archers outrange buildings despite having less attack range

Reported by: elexis Owned by:
Priority: Should Have Milestone: Alpha 24
Component: Simulation Keywords: patch
Cc: scythetwirler, odalman Patch: phab:D2759

Description (last modified by Nescio)

Problem: Although archers and CCs / fortresses both have 72m attack range, archers outrange the buildings.

Reason: Currently buildings shoot arrows from the center of the structure while archers can shoot at the edge of a structure and thus outrange it.

Why it should be fixed: This means that archers can park in front of a CC and kill it while not being fired at. Even if you use a british forteress that has 80m range and have a hill advantage, archers can outrange that building, which is pretty lame. This is not only a problem in age 1 as athen and mauryans have devastating champion archers. Especially if your city is close to the enemy this can become a pain as the archer-abusing player can hide between the own towers and become almost invincible and only beatable with far superior economy or using other balancing bugs.

Also, as 72m attack range is defined for structures and archers alike, it seems it is intended for them to be able to attack each other.

Quick fix: Just increase the attack range of buildings in the templates by the radius of the structure.

Extended fix: Automatically add the radius of the building when computing the attack range.

Technically the second proposal is also more historically accurate as archers shoot arrows from the embrasure / arrowslits in the walls of fortresses, not from the center.

Change History (14)

comment:1 by elexis, 9 years ago

The second proposal might not be a clean approach as we would have to assume square footprints / obstruction size for defensive buildings (which currently is the case but might change).

comment:2 by Stan, 9 years ago

Well what does that change for the british fortress ?

I mean technically it would just be a little smaller than a square fortress, but that shouldn't be visible anyway.

in reply to:  2 comment:3 by elexis, 9 years ago

Replying to stanislas69:

Well what does that change for the british fortress ?

I mean technically it would just be a little smaller than a square fortress, but that shouldn't be visible anyway.

The british fortress is just a good example as it has 80m range which is clearly more than the archers 72m range. Still the archers can outrange the fortress.

Currently all defensive buildings have a square size, so that proposal to add the size automatically might work for that - but not if the size is not square, i. e. one side is longer than the other. In that case the attack range would be a bit inconsistent if we'd use the width, depth or average of both values to the attack range.

comment:4 by Stan, 9 years ago

Ah yes I see. Then can't you just take the longest distance ?

comment:5 by wraitii, 8 years ago

Milestone: BacklogAlpha 20

I do believe this is somewhat counter-intuitive. this is partly why the tower minrange issue happened

comment:6 by elexis, 8 years ago

Milestone: Alpha 20Backlog

Backlogging due to lack of progress.

comment:7 by Imarok, 5 years ago

Component: UI & SimulationSimulation

Move tickets to Simulation as UI & Simulation got some sub components.

comment:8 by Nescio, 5 years ago

Description: modified (diff)

Adding the footprint's radius works fine for circular entities, but is problematic for rectangular ones. Instead, the problem could also be solved if ranges (attack, aura, heal, vision) are calculated from the edge rather than from the centre. See also: https://wildfiregames.com/forum/index.php?/topic/25424-structure-range/&tab=comments#comment-370075

comment:9 by elexis, 5 years ago

There was also that request: #4585

comment:10 by odalman, 5 years ago

Cc: odalman added

comment:11 by bb, 3 years ago

Keywords: patch added
Milestone: BacklogAlpha 24
Patch: phab:D2759

comment:12 by wraitii, 3 years ago

In 24217:

Update range queries to account for entity size.

CCmpRangeManager queries do not take obstruction size into account, meaning they return fewer entities than they should. This particularly affects buildings with ranged attacks, gates, and a few other templates.

This is, unfortunately, a slight performance decrease.

Discovered following Angen's comment here .

Comments by: Angen

Reviewed By: bb

Refs #3381 (not marking it down as 'fixes' and I'm not entirely sure it was the only moving part here).

Differential Revision: https://code.wildfiregames.com/D2759

comment:13 by wraitii, 3 years ago

Is this closed?

comment:14 by wraitii, 3 years ago

Resolution: fixed
Status: newclosed

Fixed in rP24217

Note: See TracTickets for help on using tickets.