Jump to content

Line of sight for ranged units?


Ayakashi
 Share

Recommended Posts

Sorry if this has been discussed before but are there any plans or considerations to implement a 'line of sight' system for ranged units like archers?

For example: make it so that archers and ballistae cannot shoot through tall buildings and walls unless standing on higher ground such as atop a cliff or tall hill. Exception will be some stone throwing siege units that shoot in arcs who can shoot projectile over them.

I think it will vastly improve the game by adding to realism and making strategic gameplay deeper. It mean walls will become more useful in protecting your units and structures and provide a reason to mount units on walls; and make unit dynamics more varied depending on situations: such as melee units having an edge over archers in built up areas.

Of course, that's if the engine can support this. Does it?

  • Like 2
Link to comment
Share on other sites

Which is kinda sad IMO really. I really find some aspects of the gameplay and visuals very archaic like AOE2 seemingly due to engine limitations: like no 'line of sight rule', siege units having no crew, and soldiers that destroy farms by stabbing them with spears. I guess this is really down to lack of funding/resources then :/

  • Like 1
Link to comment
Share on other sites

Which is kinda sad IMO really. I really find some aspects of the gameplay and visuals very archaic like AOE2 seemingly due to engine limitations: like no 'line of sight rule', siege units having no crew, and soldiers that destroy farms by stabbing them with spears. I guess this is really down to lack of funding/resources then :/

With animations these will be added, units throwing torches and units pushing siege Rams and another engines.
Link to comment
Share on other sites

Why is a 3D pathfinder needed to make units not visible at the other side of a wall that is at the same height as the unit firing?

I do't think is 3d pathf is needed, but there are currently other limitations. Not sure though.

Well I believe that the notion of height is 3D :P

Link to comment
Share on other sites

Pathfinder isn't related to vision range.

But vision area calculation is a whole different algorithm. Currenlty, that algorithm is highly optimised by using the circle symmetry. It can quickly estimate the border tiles (row per row) without many calculations, and then mark all tiles in between as "visible". By going away from that circle-shaped vision, the calculations will be a lot heavier, so it would slow down the game.

I'm not saying that a non-circular vision range isn't possible, but we should try to get rid of the existing lag before introducing features that are guaranteed to add more lag.

  • Like 1
Link to comment
Share on other sites

I wasn't thinking obstruction based on height, but rather based on structures/buildings. I don't think there's any building shorter than a unit, except farms

Enrique is right, it is the building's 2D <obstruction> that block the vision, not its footprint height or anything 3D. Could have flag in entity template to block vision so designer can determine which buildings best for blocking.

Pathfinder isn't related to vision range.

But vision area calculation is a whole different algorithm. Currenlty, that algorithm is highly optimised by using the circle symmetry. It can quickly estimate the border tiles (row per row) without many calculations, and then mark all tiles in between as "visible". By going away from that circle-shaped vision, the calculations will be a lot heavier, so it would slow down the game.

I'm not saying that a non-circular vision range isn't possible, but we should try to get rid of the existing lag before introducing features that are guaranteed to add more lag.

Would add more lag to make the center of vision circle 10 meters in front of unit? Save some optimization but mimic human awareness slightly better?

Edited by wowgetoffyourcellphone
Link to comment
Share on other sites

  • 4 years later...

LOS for ranged units could be done by granting them linear splash damage instead of/in addition to regular damage. Then you check if it deals linear splash damage and if so, you delete the arrow. That would add some lag, but since you would be using linear splash, which is implemented, it shouldn't be a huge amount.

  • Like 1
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...