Jump to content

Structure range


Nescio
 Share

Recommended Posts

Nice catch. Personally I always thought the range of fortresses was a little too small. You could also reduce the range of archers of course, but since they're a bit of an underused unit as it is, I'd prefer the first option (fortresses aren't much of an obstacle in late game anyway, so a little buff in terms of range won't hurt gameplay, I think) 

Link to comment
Share on other sites

The default fortress has a footprint of 30×30, which means its range ought to be increased by √(15²+15²)≈21 in order to be able to hit archers; the Roman centre has a footprint of 40×40, thus requiring a range increase of √(20²+20²)≈28. However, bolt shooters and stone throwers have a MaxRange of only 80.

Speaking of which, structures need a vision range of at least (structure footprint radius + siege weapon range), otherwise they won't be able to see their attackers.

 

Ideally, ranges (attack, aura, heal, vision) ought to be calculated from the footprint instead of its centre. Then entities with the same MaxRange will always be able to attack each other, regardless of their size, and melee units can simply have a MaxRange of 1 (right now the siege ram has a MaxRange of 6.5, because the Macedonian and Roman rams have a footprint length of 12). However, I guess that's difficult to implement and might affect performance as well (a circle is a simple shape).

For comparison, MaxRange from footprint (blue) and from centre (magenta):

MaxRange.png

It would also solve things like this:

685251686_Screenshotfrom2019-03-0417-56-18.png.f5af64059e3cecb4e675ea6b833ab80c.png

Edited by Nescio
wonder heal aura
  • Like 3
Link to comment
Share on other sites

It can be made a "extendRangeBasedOnShape" class quite easily if the shape is just a rectangle or a circle. I would expect 3x-5x times more expensive than the current circle implementation.

Edited by nani
Link to comment
Share on other sites

10 minutes ago, nani said:

Could you describe the technical difference ( is obstruction shape a simplification of the shape?)

Obstruction shapes are used by the pathfinder. (If I am not wrong, they are only squares and moving units are just points (but they add their radius - clearance - to every obstruction)). So in that current problem it is used when UnitAI places a unit "at range".

Footprints are mainly used for selection rings but also, in our case, for detecting attack collision. (They can be circular or rectangular.)

(Then there is a difference for attacks performed by BuildingAI and the ones performed by UnitAI.)

Edited by fatherbushido
  • Like 2
Link to comment
Share on other sites

33 minutes ago, nani said:

I would expect 3x-5x times more expensive than the current circle implementation.

Doesn't sound too bad.

4 minutes ago, fatherbushido said:

(Then there is a difference for attacks performed by BuildingAI and the ones performed by UnitAI.)

BuildingAI fires in any direction and can have multiple arrows, UnitAI attacks only forward, or are there other differences?

Link to comment
Share on other sites

13 minutes ago, Nescio said:

Doesn't sound too bad.

BuildingAI fires in any direction and can have multiple arrows, UnitAI attacks only forward, or are there other differences?

It's completely different.

UnitAI places unit at range (so taking into account obstruction of the target) (high cost).

BuildingAI do a range query from center to center and fire all things in that range (low cost).

Link to comment
Share on other sites

1 hour ago, fatherbushido said:

It's completely different.

UnitAI places unit at range (so taking into account obstruction of the target) (high cost).

BuildingAI do a range query from center to center and fire all things in that range (low cost).

What if an unit has both?

Link to comment
Share on other sites

  • 5 weeks later...
  • 1 year later...
  • 2 months later...

Another image to highlight the difference in attack range calculations in A23 and A24: range_comparison_3.svg

range_comparison_3.png.d715b85523c33b9643757b5895289036.png

 

  • black: a structure with an obstruction size of 40×40 (e.g. rome civic centre)
  • red: attack range of 60 calculated from the footprint centre (A23 and earlier)
  • green: attack range of 60 calculated from the obstruction edge (not implemented)
  • blue: attack range of 60 calculated from the circle around the obstruction (A24)

As you can see structures with the same attack range can now shoot much farther than they used to, and as a consequence, units can no longer outrange structures with the same attack range.

Edited by Nescio
only 60
  • Like 2
Link to comment
Share on other sites

  • 1 month later...

Hello,

On 28/01/2021 at 12:25 PM, Nescio said:

green: attack range of 60 calculated from the obstruction edge (not implemented)

Will it be implemented in A25 ?

On 28/01/2021 at 12:25 PM, Nescio said:

blue: attack range of 60 calculated from the circle around the obstruction (A24)

Is it the case for all building or only for "arrow shooting" building ? I wonder if it's working for temple, pyramids...

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...