Nescio Posted March 4, 2019 Report Share Posted March 4, 2019 Currently structures and archers have a MaxRange of 72. Because attacks go from centre to edge, this means archers (red) can hit centres or fortresses (blue) without those being able to shoot back: 2 Quote Link to comment Share on other sites More sharing options...
Sundiata Posted March 4, 2019 Report Share Posted March 4, 2019 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) Quote Link to comment Share on other sites More sharing options...
Nescio Posted March 4, 2019 Author Report Share Posted March 4, 2019 (edited) 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): It would also solve things like this: Edited March 4, 2019 by Nescio wonder heal aura 3 Quote Link to comment Share on other sites More sharing options...
nani Posted March 4, 2019 Report Share Posted March 4, 2019 (edited) 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 March 4, 2019 by nani Quote Link to comment Share on other sites More sharing options...
fatherbushido Posted March 4, 2019 Report Share Posted March 4, 2019 Just to be clear, footprint != obstruction shape 1 Quote Link to comment Share on other sites More sharing options...
nani Posted March 4, 2019 Report Share Posted March 4, 2019 3 minutes ago, fatherbushido said: Just to be clear, footprint != obstruction shape Could you describe the technical difference ( is obstruction shape a simplification of the shape?) Quote Link to comment Share on other sites More sharing options...
fatherbushido Posted March 4, 2019 Report Share Posted March 4, 2019 (edited) 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 March 4, 2019 by fatherbushido 2 Quote Link to comment Share on other sites More sharing options...
Nescio Posted March 4, 2019 Author Report Share Posted March 4, 2019 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? Quote Link to comment Share on other sites More sharing options...
fatherbushido Posted March 4, 2019 Report Share Posted March 4, 2019 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). Quote Link to comment Share on other sites More sharing options...
Nescio Posted March 4, 2019 Author Report Share Posted March 4, 2019 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? Quote Link to comment Share on other sites More sharing options...
fatherbushido Posted March 5, 2019 Report Share Posted March 5, 2019 (edited) 7 hours ago, Nescio said: What if an unit has both? https://www.youtube.com/watch?v=PYOnTjHMBFA (from DE 0.0.2 on WFG 0AD a0.23b) Edited March 5, 2019 by fatherbushido Quote Link to comment Share on other sites More sharing options...
Nescio Posted April 3, 2019 Author Report Share Posted April 3, 2019 On 3/5/2019 at 7:07 AM, fatherbushido said: On 3/4/2019 at 11:30 PM, Nescio said: What if an unit has both? https://www.youtube.com/watch?v=PYOnTjHMBFA (from DE 0.0.2 on WFG 0AD a0.23b) Actually biremes, quinqueremes, triremes, and siege towers have both BuildingAI and UnitAI. Quote Link to comment Share on other sites More sharing options...
fatherbushido Posted April 3, 2019 Report Share Posted April 3, 2019 (edited) Yes they have, I showed a fun example. In some mods, there are chariots with it too. (I am still writing the note I promised to you.) Edited April 3, 2019 by fatherbushido 1 Quote Link to comment Share on other sites More sharing options...
elexis Posted April 3, 2019 Report Share Posted April 3, 2019 On 3/4/2019 at 12:32 PM, Nescio said: Currently structures and archers have a MaxRange of 72. Because attacks go from centre to edge, this means archers (red) can hit centres or fortresses (blue) without those being able to shoot back #3381 Quote Link to comment Share on other sites More sharing options...
bb_ Posted November 11, 2020 Report Share Posted November 11, 2020 https://code.wildfiregames.com/D2759 Should indeed fix this. Thx for linking @Nescio Quote Link to comment Share on other sites More sharing options...
Nescio Posted November 11, 2020 Author Report Share Posted November 11, 2020 Another image, to make the difference even clearer range_comparison.svg: black: a structure with a footprint of 120×60 (wonders in 0 A.D. are up to 60×60) blue: range calculated from edge (proposal?), in steps of 20 red: range calculated from centre (current situation), in steps of 20 1 Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted November 11, 2020 Report Share Posted November 11, 2020 On 05/03/2019 at 1:07 AM, fatherbushido said: https://www.youtube.com/watch?v=PYOnTjHMBFA (from DE 0.0.2 on WFG 0AD a0.23b) Thanks I hate it. 2 Quote Link to comment Share on other sites More sharing options...
Nescio Posted January 28, 2021 Author Report Share Posted January 28, 2021 (edited) Another image to highlight the difference in attack range calculations in A23 and A24: range_comparison_3.svg 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 January 28, 2021 by Nescio only 60 2 Quote Link to comment Share on other sites More sharing options...
Edwarf Posted March 23, 2021 Report Share Posted March 23, 2021 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... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.