Jump to content

Possible LoS improvements


Palaxin
 Share

Recommended Posts

Some suggestions, copied from http://trac.wildfiregames.com/ticket/3634

I would be glad to get some opinions, perhaps some of the described features may have been already discussed somewhere somewhen. Feel free to close the trac ticket, if it's annoying you.

Note that I'm not able to implement the "Advanced" and "Fancy" suggestions nor can I say how easy it would be to do so.

The "Simple" ones should be doable for quite some people, not sure if I would succeed.

Overview

It would be nice if the line of sight depended on the surrouding terrain, buildings and other big obstacles. Also the field of view could get a more realistic shape.

This would provide a more strategic role for line of sight, I can think of situations like

  • scouting an enemy army without being seen
  • sneaking from behind to an enemy
  • more realistic guerilla warfare between (blocks of) buildings

Terrain

  • Simple: adjust LoS like archer's range
  • Advanced: units cannot see behind hills/mountains, on top of a plateau (when standing on a lower place) or at the bottom of deep gorges (if not standing at the cliff's edge)

Objects

  • Simple: units get an LoS Bonus when garrisoned on a wall (also tower, fortress or ship if implemented)
  • Advanced: Buildings and gaia elements like rocks with their height above the unit's eyes (human ~1.5m, mounted units ~2.5m, units on elephants ~4m, units on ships, buildings and siege towers perhaps even more) block the vision behind them.
  • Fancy: even if the obstacle's height is below the eyes' height there should be invisible area behind it like shadow is not "visible" for the sun; also smaller objects like trees or large animals could partially block vision (I don't know if this would demand too much resources for a large amount of units and therefore lead to game lags)

Field of View

Humans have a field of view of about 180° with decreasing vision quality at the edges. Animals have various angles and therefore a field of view in the shape of circular sectors. Actually I think it is debatable if animals should have an LoS since they can't communicate and therefore can't provide information - perhaps they could show some passive reaction if they detect something interesting instead?

  • Simple: LoS offset towards the current viewing direction
  • Advanced: semicircle LoS for humans and other circular sectors for animals (if they have LoS)
  • Fancy: modified "semicircle" LoS with less vision range at the edges e.g. vision range is described by something like r(θ)=sin(θ)*R for 0<=θ<=π where R=r(θ=π/2)=r(θ=90°) is the vision range straight forward. For animals the sine function would have to be stretched to match the specific maximum angle.
Edited by Palaxin
Link to comment
Share on other sites

Overview

It would be nice if the line of sight depended on the surrouding terrain, buildings and other big obstacles. Also the field of view could get a more realistic shape.

This would provide a more strategic role for line of sight, I can think of situations like

  • scouting an enemy army without being seen
  • sneaking from behind to an enemy
  • more realistic guerilla warfare between (blocks of) buildings

While I agree this would be an interesting feature to have to an extent, it has the problem of being tremendously slow. This is partly because our LOS code isn't the most elegant, but also because LOS in an RTS is something that is very complicated.

I would like walls, mostly, to stop LOS (and arrows), but even that is very complicated. There is a reason if Age of Empires never did it.

Terrain

  • Simple: adjust LoS like archer's range
  • Advanced: units cannot see behind hills/mountains, on top of a plateau (when standing on a lower place) or at the bottom of deep gorges (if not standing at the cliff's edge)

See above for "Advanced". Your "Simple" advantage might be possible, but it will be slow and difficult.

Objects

  • Simple: units get an LoS Bonus when garrisoned on a wall (also tower, fortress or ship if implemented)
  • Advanced: Buildings and gaia elements like rocks with their height above the unit's eyes (human ~1.5m, mounted units ~2.5m, units on elephants ~4m, units on ships, buildings and siege towers perhaps even more) block the vision behind them.
  • Fancy: even if the obstacle's height is below the eyes' height there should be invisible area behind it like shadow is not "visible" for the sun; also smaller objects like trees or large animals could partially block vision (I don't know if this would demand too much resources for a large amount of units and therefore lead to game lags)
Field of View

I don't believe Field of View can work in the context of 0 A.D. Units can turn instantly, and there really isn't a point to it. We're not Company of Heroes.

Basically all of this would lead to a ton of lag, sadly. Perhaps in the future when computers have gotten faster.

  • Like 1
Link to comment
Share on other sites

Ok, thank you for the explanations. Lag is nothing you wish whatever you get for it :/

I've expected that not all ideas would actually work well, but I didn't know that it's such a great performance issue. Interesting to know... So all in all you would get a little improvement in gameplay but be heavily punished by performance.

I thought the one big problem is always pathfinding (I once read it took 70% of the AoK resources) and LoS would be not that difficult to deal with at least using a dedicated GPU (which I do not have by the way :D)

Perhaps one day I will play around with the "simple" things, if I feel confident enough :) I need to understand the code much more at the moment.

At least units hiding in the forest/trees/bushes is something mensioned in the design document, and is more easy to implement, I think.

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...